The GDAL documentation describes how to convert a ShapeFile into CSV data. The layer create options (-lco
parameter) allows to prepend the coordinates of Point features to the actual attributes values.
ogr2ogr -f CSV output.csv input.shp -lco GEOMETRY=AS_XY
Note that I omitted the Z-dimension for my example here.
For some reason this results in the following error message:
FAILED: Layer input already exists, and -append not specified.
Consider using -append, or -overwrite.
ERROR 1: Terminating translation prematurely after failed
translation of layer input (use -skipfailures to skip errors)
I am using GDAL 1.10.0.
Questions:
- How can I get this running?
- Is there an option to omit the feature attributes: I only want to export the latitude and longitude values?