[Gdal-dev] coordinates for csv-files with ogr2ogr

Frank Warmerdam warmerdam at pobox.com
Tue Oct 24 09:00:33 EDT 2006

C.Strobl at dlr.de wrote:
> hello all,
> is there a possibility to generate with ogr2ogr a csv-file which
> contains also the coordinates and not only the attributes.
> thanks and greetings from munich.


This is not possible with the current csv driver.  Geometries are always
discarded.  In theory it would not be hard to modify it to allow geometries
to be emitted as a WKT column, or perhaps for point data to be split into
an X, Y (and Z) column.

> christian
> p.s. besides this ogr2ogr generates always with the csv-option a folder
> AND a file with the same name, e.g. .../file.csv/file.csv 

Right - on creation the driver always creates a directory and creates
each layer as a csv file inside that.  Some drivers, like the shapefile
driver, have hacky logic to try and determine if a single shp/shx/dbf file
set should be created or a whole directory.  But this is complex and problem
prone and this capability was not replicated in the csv driver which is by
design fairly simple.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list