[gdal-dev] Invalid geometry reading from Oracle via OGR OCI driver

Niccolo Rigacci niccolo at rigacci.org
Thu Sep 9 09:44:47 EDT 2010


In an Oracle Spatial DB I have a geometry like this:

MULTIPOLYGON = (((POLYGON), (HOLE)), ((POLYGON), (HOLE)))

When I dump the geometry via ogrinfo, I get an invalid geometry: 

MULTIPOLYGON = (((POLYGON)), ((POLYGON)), ((POLYGON)), ((POLYGON)))

The dump is done with:
ogrinfo "OCI:..." table_name

The same problem results when I import the Oracle geometry into a
Postgres database via ogr2ogr. The resulting geometry is invalid.

Strange enough, if I convert the same Oracle geometry into a 
shapefile, the result IS valid: two polygons with one hole 
each. The conversion is made with:
ogr2ogr -f "ESRI Shapefile" shapefile "OCI:..."

I noticed also that the polygons into the shapefile are 
clock-wise inverted respect the original Oracle ones, but the 
geometry is valid.


I'm using GDAL/OGR 1.6.3.

Am I missing some OGR parameter?
Is this a known bug fixed in newer versions?

Thank you very much for any hints.

-- 
Niccolo Rigacci
Firenze - Italy


More information about the gdal-dev mailing list