1 Reply Latest reply: Jun 19, 2013 4:52 PM by Paul Dziemiela RSS

    sdo_util.from_gml311geometry returns Message:Invalid Polygon

    Rene W.

      The following query executed on 11.2.0.3 returns an exception:



      SELECT sdo_util.from_gml311geometry('<gml:Surface srsName="urn:ogc:def:crs:EPSG::28992" xmlns:gml="http://www.opengis.net/gml"><gml:patches><gml:PolygonPatch><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="7">83665.185 437483.078 83655.784 437479.597 83667.002 437448.834 83669.197 437449.752 83673.781 437451.666 83676.38 437452.753 83665.185 437483.078</gml:posList></gml:LinearRing></gml:exterior></gml:PolygonPatch></gml:patches></gml:Surface>') FROM dual;

       


      ORA-29532: Java call terminated by uncaught Java exception: java.lang.RuntimeException: Message:Invalid Polygon
      Description:
      ORA-06512: at "MDSYS.SDO_UTIL", line 227


      Is surface not supported?

       

      How do I insert <code> tags as I used to?

        • 1. Re: sdo_util.from_gml311geometry returns Message:Invalid Polygon
          Paul Dziemiela

          Hi Rene,

           

          It sure would be easier if that error message said something like "Surface not supported".  I think that Oracle Spatial only supports "Simple Geometric Primitives" (section 9.2) in the 3.1.1 specification whereas Surface is an "additional" geometric primitive in section 10.2.  The Oracle documentation does not mention such details so I think you'd need to submit an SR to get a definitive answer.   I've never tested each and every primitive to see if each one works or not, but I'd guess its just the simple ones that work.

           

          Your GML snippet works just fine in PostGIS

          SELECT ST_AsText(ST_GeomFromGML('<gml:Surface srsName="urn:ogc:def:crs:EPSG::28992" xmlns:gml="http://www.opengis.net/gml"><gml:patches><gml:PolygonPatch><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="7">83665.185 437483.078 83655.784 437479.597 83667.002 437448.834 83669.197 437449.752 83673.781 437451.666 83676.38 437452.753 83665.185 437483.078</gml:posList></gml:LinearRing></gml:exterior></gml:PolygonPatch></gml:patches></gml:Surface>'));

          which is running JTS under the covers.  So one option is to use JTS in Oracle as Simon Greener does

          http://www.spatialdbadvisor.com/oracle_spatial_tips_tricks

           

          If that is not a fit, coding your own GML reader using PLSQL and XMLTYPE is not that hard to do and gives you the ability to work around any oddities in the incoming GML.

           

          Cheers,

          Paul