[Gdal-dev] OGR and multiple geometries per feature type

Andrea Aime aaime at openplans.org
Sun Feb 4 11:31:23 EST 2007


Hi,
does OGR support features with multiple geometries?
 From the API it seems it does not, but I may be overlooking something.

When I connect ogrinfo to a Postgis table that happens
to have 4 geometry columns, each registered in the
geometry_columns table, I get the following:

ogrinfo -so PG:"host=localhost port=5432 user=myuser
  password=mystery dbname=tiger2005fe" major_roads

INFO: Open of `PG:host=localhost port=5432 user=myuser password=mystery 
dbname=tiger2005fe' using driver `PostgreSQL' successful.

Layer name: major_roads
Geometry: Unknown (any)
Feature Count: 105628
Extent: (-170.837387, -14.377902) - (144.914001, 66.922287)
Layer SRS WKT:
(unknown)
Geometry Column = gen_full
fid: Integer (0.0)
interstate: Integer (0.0)
othername: String (0.0)
state: String (0.0)
statehighway: Integer (0.0)
ushighway: Integer (0.0)

Layer name: major_roads
Geometry: Unknown (any)
Feature Count: 105628
Extent: (-170.837387, -14.377902) - (144.914001, 66.922287)
Layer SRS WKT:
(unknown)
Geometry Column = gen_full
fid: Integer (0.0)
interstate: Integer (0.0)
othername: String (0.0)
state: String (0.0)
statehighway: Integer (0.0)
ushighway: Integer (0.0)

Layer name: major_roads
Geometry: Unknown (any)
Feature Count: 105628
Extent: (-170.837387, -14.377902) - (144.914001, 66.922287)
Layer SRS WKT:
(unknown)
Geometry Column = gen_full
fid: Integer (0.0)
interstate: Integer (0.0)
othername: String (0.0)
state: String (0.0)
statehighway: Integer (0.0)
ushighway: Integer (0.0)

Layer name: major_roads
Geometry: Unknown (any)
Feature Count: 105628
Extent: (-170.837387, -14.377902) - (144.914001, 66.922287)
Layer SRS WKT:
(unknown)
Geometry Column = gen_full
fid: Integer (0.0)
interstate: Integer (0.0)
othername: String (0.0)
state: String (0.0)
statehighway: Integer (0.0)
ushighway: Integer (0.0)

whilst the table definition is:

tiger2005fe=# \d major_roads
                              Table "public.major_roads"
     Column    |   Type   |                         Modifiers
--------------+----------+-----------------------------------------------------------
  state        | text     |
  gen_full     | geometry |
  gen_1        | geometry |
  gen_2        | geometry |
  gen_3        | geometry |
  interstate   | integer  |
  ushighway    | integer  |
  statehighway | integer  |
  othername    | text     |
  fid          | integer  | not null default 
nextval('major_roads_fid_seq'::regclass)
Indexes:
     "fid_pkey" PRIMARY KEY, btree (fid)
     "major_roads_spatial_ind" gist (gen_full)
     "major_roads_spatial_ind1" gist (gen_1)
     "major_roads_spatial_ind2" gist (gen_2)
     "major_roads_spatial_ind3" gist (gen_3)

If you're wondering why I do have 4 geometry columns, it's because each
column contains the geometry at a different generalization level.
But it may well be something different, like having both center-line and 
polygon representation for a road, and so on...

Cheers
Andrea



More information about the Gdal-dev mailing list