[gdal-dev] ogr2ogr - output WKT to console?

Elijah Robison elijah at villagis.com
Wed Aug 31 16:44:55 EDT 2011


Hi Devs,

When troubleshooting geodata integrity issues, we sometimes use ogr2ogr 
to push WKT expressions to a .csv file using a script like I show below. 
It uses an ogr sql statement to grab a single feature from a raw 
shapefile data source, then it saves the output to a CSV:

ogr2ogr -f "CSV" "C:\xData\CountyData\Shps\OriginalParcelCSV" 
"C:\xData\CountyData\Shps\parcel_polygons.shp" -sql "select * from 
parcel_polygons where id= 9080" -lco "GEOMETRY=AS_WKT" -lco 
"LINEFORMAT=CRLF" -lco "SEPARATOR=SEMICOLON"

As our needs in this situation are very transient, I'm curious if it is 
possible to output the WKT directly to the console?

Very Best,

Elijah Robison
elijah at villagis.com


More information about the gdal-dev mailing list