5

I tried to import CSV files to QGIS using the "Add delimited text layer" feature. For some reason, some of the numeric variables became QString.

How do I make them become integer so I can perform heatmap calculations?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jan 12, 2016 at 23:32
1

2 Answers 2

3

You could run the Refactor fields tool from the Processing Toolbox to change the field type once you have added your .csv file to QGIS:

Refactor fields

You can save this as a new shapefile and use this for your heatmap analysis.

answered Jan 13, 2016 at 10:15
3

You can enforce the data type behaviour you want with "Add delimited text layer" using a CSVT (my previous statement was it wasn't possible at all but due to Alexandre Neto feedback, I changed my answer)

You can follow this blog post to learn about CSVT files.

You can also add your CSV file with "Add Vector Layer" and use a CSVT file again.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Jan 12, 2016 at 23:38
2
  • That is not correct. You can enforce the data type in Add delimited text layer if you use a CSVT, Commented Jan 13, 2016 at 0:27
  • 2
    I tried and you were right (tested with no geometry). Thanks. I learn something too ;) Commented Jan 13, 2016 at 0:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.