On 11/26/2011 04:58 PM, David wrote:
Hello again
I'm still having trouble using a csv file.     

Having loaded the csv file as a layer, right click properties opens the layer properties box for the csv file and Fields has the full list of columns in my file: so far, so good.   

However they are all described as string, width 0 and precision 0 when many should be integer or decimal.     Is it possible to change them in the properties box?   I looked at the User Manual but don't understand the Edit widget.


Maybe try creating the associated *.csvt file. From the GDAL [1] site:
Limited type recognition can be done for Integer, Real, String, Date (YYYY-MM-DD), Time (HH:MM:SS+nn) and DateTime (YYYY-MM-DD HH:MM:SS+nn) columns through a descriptive file with same name as the CSV file, but .csvt extension. In a single line the types for each column have to be listed: double quoted and comma separated (e.g., "Integer","String"). It is also possible to specify explicitely the width and precision of each column, e.g. "Integer(5)","Real(10.7)","String(15)". The driver will then use these types as specified for the csv columns.

And a bit more on Anita's blog [2].

[1] http://www.gdal.org/ogr/drv_csv.html
[2] http://underdark.wordpress.com/2011/03/07/how-to-specify-data-types-of-csv-columns-for-use-in-qgis/
David Asquith
UK


This mail was received via Mail-SeCure System.
_______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user

This mail was received via Mail-SeCure System.




-- 
Micha Silver
GIS Consultant, Arava Development Co.
http://www.surfaces.co.il
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to