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?
-
1Try this solution from @Underdark anitagraser.com/2011/03/07/…Inactivated Account– Inactivated Account2016年01月12日 23:38:57 +00:00Commented Jan 12, 2016 at 23:38
2 Answers 2
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:
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– Alexandre Neto2016年01月13日 00:27:25 +00:00Commented Jan 13, 2016 at 0:27
-
2I tried and you were right (tested with no geometry). Thanks. I learn something too ;)ThomasG77– ThomasG772016年01月13日 00:59:52 +00:00Commented Jan 13, 2016 at 0:59