[gdal-dev] GDAL ogr2ogr OracleSpatial to Shape: Multipolygons with wholes/multiparts are missing

Kurt Kotthoff kotthoff.kurt at gmail.com
Wed Aug 22 11:00:34 PDT 2018


Hello GDAL-DEV-Team,

recently I faced a problem, which I wasn't able to solve. It regards to 
ogr2ogr Oracle Spatial to Shape-file convertion:



We're holding geodata in an Orcale database (11g) with spatial 
extension. I want to unload specific polygons and convert them into 
Shape for further local processing.

The table where I'm unloading from holds polygons/multipolygons: Oracle 
Spatial GeomTypes are 4003 and 4007 (4D-Polygon and 4D-Multipolygon - 
third and fourth axis are not used however).

For unloading and conversion I use this command within a python-script:

/ogr2ogr.main(["", "-f", "ESRI Shapefile", result_path + query_result, 
connection_params,"-nlt", "MULTIPOLYGON", "-sql", the_sql_query_here])/


Connection and full conversion only seems to work for polygons with 
GeomType 4003 however. The geometry-parts of multipartpolygons or 
polygons with wholes (GeomType 4007) are completely missing in the 
shape-file (white gaps within the map). Non-spatial attributes and 
values of these objects appear in the shape-file object-table though. I 
already tried to rerun the command above with /POLYGON/ or 
P/ROMOTE_TO_MULTI/ instead of /MULTIPOLYGON/ and /POLYGON/. No change in 
the result though.

As an example I provide the geometry of an Oracle-Spatial-object, whose 
geometry could not be converted (its a two-part multipolygon):

/MDSYS.SDO_GEOMETRY(4007,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1005,5,1,2,1,5,2,1,9,2,1,13,2,1,17,2,1,25,1005,5,25,2,1,29,2,1,33,2,1,37,2,1,41,2,1),MDSYS.SDO_ORDINATE_ARRAY(33433109.145,5711835.706,9999.9999,0,33433166.721,5711687.09,9999.9999,0,33433229.435,5711904.544,9999.9999,0,33433205.628,5711904.647,9999.9999,0,33433175.618,5711821.022,9999.9999,0,33433109.145,5711835.706,9999.9999,0,33433020.391,5711673.812,9999.9999,0,33433153.215,5711635.136,9999.9999,0,33433164.011,5711674.531,9999.9999,0,33433099.673,5711838.076,9999.9999,0,33433071.502,5711844.871,9999.9999,0,33433020.391,5711673.812,9999.9999,0))/

You can find more information, including pictures, here:
/
//https://gis.stackexchange.com/questions/292942/gdal-ogr2ogr-oraclespatial-to-shape-multipolygons-with-wholes-multiparts-are-mi/

My GDAL is v2.1.2. Any known caveats or workarounds regarding this problem?


Thank you very much and best regards,
knutella

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180822/89ab33d1/attachment.html>


More information about the gdal-dev mailing list