[Gdal-dev] FeatureDefn.getGeometryType and actual geometry type

Andrea Aime aaime at openplans.org
Sun Feb 4 13:20:43 EST 2007


Frank Warmerdam ha scritto:
> Andrea Aime wrote:

> Andrea,
> 
> It is a known bug that I am very nervous about changing.  If I
> were to change the declaration to multipolygon then I would have
> to convert all polygon geometries to multipolygons which would no
> doubt confuse and confound many users and applications.

That's what we do, in fact, in the shapefile datastore.
But we have always been doing this, so we don't have backwards
compatibility issues.
Maybe, you could add a flag to allow

> I'm more likely to fallback to considering the layers of type Geometry -
> ie. no known type of geometry.
> 
> In summary, you shouldn't trust the geometry types too much currently.

Ouch... the issue is, in Geotools we need consistency between the
declared geometry type and the actual one, or our internal checks will
throw exceptions.
Do you have a list of inconsistencies, or should I always use multi 
geometry types, even when OGR tells me that we're going to get simple 
ones? Oh, another possibility is to give up the classification and
say I just have a generic Geometry, that may break some SLD styles though...

Cheers
Andrea



More information about the Gdal-dev mailing list