[Gdal-dev] Geodatabase drive and layer types

Craig Miller craig.miller at spatialminds.com
Tue Nov 14 19:21:32 EST 2006


The ESRI Geodatabase driver always returns wkbUnknown as the layer type.  It
originally returned the type as described in the Geodatabase but when I
discovered that some wkbPoint layers also had wkbMultipoints Frank updated
the code to always return wkbUnknown.  At the time this seemed like the most
reasonable solution.  Since then I've done a bit of thinking and have a few
ideas for possible workarounds:

3 separate ideas from the simplest to the most complex:

- Return wkbGeometry instead of wkbUnknown:  ESRI describes the datatype for
each layer but then goes on to mix the datatype.  E.g. in a point layer you
see point/multipoint values.  So, the description they provide is enough to
confirm that it is in fact geometry in the table and not just tabular data.
This seems to align better with the wkbGeometry type.

- Inspect Geometry:  Force the driver to inspect all geometry and decide for
itself what the type is.  This is expensive, but is consistent with the
layer extent function.  Once inspected it would be returned as wkbPoint,
wkbMultipoint, etc, or wkbGeometry if mixed Type/multiType.

- Force to one type:  return the layer type as is described in the meta data
table.  When fetching geometry the driver could automatically force the type
to the one described.  This is my favorite because everything behaves as
expected and is transparent to the user of OGR which is the primary reason
for using a library like this (to get the same view onto all data sources).

--Craig







More information about the Gdal-dev mailing list