[Gdal-dev] ogrinfo and sql option

Frank Warmerdam warmerdam at pobox.com
Mon Oct 23 12:25:16 EDT 2006


matt.pettis at thomson.com wrote:
> Is there a way to use ogrinfo to get a listing of just the .dbf 
> attribute values without listing the line/polygon coordinates with 
> them?  my coordinate sets are large, and i am interested in exploring 
> the .dbf values of my shapefiles.

Matt,

Unfortunately, the geometries get implicitly carried along with sql
statement results, so I can't think of an easy way of just selecting
attributes.  But you could use grep (on linux or cygwin) or something
similar to filter the geometries out of the text result.

eg.
ogrinfo polygon.shp -al | grep -v POLYGON

This will drop all lines with POLYGON in them.

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