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?


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.


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.

  • That is not correct. You can enforce the data type in Add delimited text layer if you use a CSVT, – Alexandre Neto Jan 13 '16 at 0:27
  • 2
    I tried and you were right (tested with no geometry). Thanks. I learn something too ;) – ThomasG77 Jan 13 '16 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.