[gdal-dev] Select a geometry attribute from multiple geometry input?

Frank Warmerdam warmerdam at pobox.com
Wed Jan 30 12:05:00 EST 2008


Stefan Keller wrote:
> Hi all,
>  
> There are formats which allow a feature class to have multiple geometry 
> attributes.
> I currently look at the INTERLIS input driver with a dataset which 
> contains label features.
> They have a position (POINT) and direction (LINESTRING) and obviously 
> the input
> driver takes the last one. The same problem can occur with GML.
>  
> How can I select a geometry attribute from input to be passed to an
> OGR simple feature when there are many?

Stefan,

The OGR data model assumes at most one geometry per feature.  In theory
you could merge multiple features as a feature collection, but that will
generally be unsatisfactory in actual use.  I have contemplated having
drivers like the PostGIS driver treat this case as distinct layers.  So
for instance, a table with two geometry columns might appear through
OGR as two layers, one for each geometry column.

We could potentially extend the OGR API to allow multiple geometries.  It
would *likely* have to be accomplished by basically reporting the geometry
properties available for a layer, and providing a call to select which of
them would be in use for a given set of operations.  But even this modest
change would be a non-trivial effort.  It would require an RFC and someone
willing to work on it.

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