[FWTools] Fw: ogr2ogr -f "CSV" fileout filein.gml -select ...

Frank Warmerdam warmerdam at pobox.com
Tue Nov 6 13:43:14 EST 2007


E.Stefanakis wrote:
> I tried the command
> 
> ogr2ogr -f CSV out.csv in.gml -sql 'select *,OGR_GEOM_WKT from 
> srclayername'
> 
> where 'srclayername' the name of the layer in GML
> 
> however I got the following error message:
> 
> *** layer names ignored in combination with -sql.
> *** Error 1: SQL: Missing FROM clause in SELECT statement

Emmanuel,

If you are on windows you need to use double quotes instead of single
quotes (I think).  I tried:

ogr2ogr -f CSV 3dpoints.csv 3dpoints.shp -sql 'select *, OGR_GEOM_WKT from 
3dpoints'

successfully on a file I have here.

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 FWTools mailing list