[GRASS-user] Importing vectors (polygons) without building topology

Tom Russo russo at bogodyn.org
Sun Jun 25 15:18:05 EDT 2006


On Sun, Jun 25, 2006 at 01:08:00PM -0600, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> I don't use PostGIS, so am not familiar with the correct way to specify
> PostGIS layers in OGR commands.  If the layer were already in a shapefile
> format, you'd do something like this, assuming for example that the
> distinguishing attribute was called "entity_type" and had string values:
> 
> ogr2ogr -where 'entity_type="SomeParticularType"' reduced.shp original_full.shp

Sorry, that's wrong.  The correct usage would be:
ogr2ogr -where "entity_type='SomeParticularType'" reduced.shp original_full.shp

(the single and double quotes need to be in that order)

Also, for postgis input and shape output you'd just do:

ogr2ogr -f "ESRI Shapefile" -where "enity_type='SomeParticularType" output.shp \
     PG:'dbname=russo' input_table_name

HTH,
T.

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236  SKCC#2002
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick




More information about the grass-user mailing list