10 Replies Latest reply on May 31, 2013 6:13 PM by Bkazar-Oracle

    sdo_util.to_gml311geometry returns null for polygon with circular arcs.

    Rene W.
      The following statement results in an null value:
      select sdo_util.to_gml311geometry(mdsys.sdo_geometry(2003
                                                          ,90112
                                                          ,null
                                                          ,mdsys.sdo_elem_info_array(1, 1003, 2)
                                                          ,mdsys.sdo_ordinate_array(154817.081
                                                                                   ,464139.198
                                                                                   ,154814.081
                                                                                   ,464142.199
                                                                                   ,154811.081
                                                                                   ,464139.198
                                                                                   ,154814.081
                                                                                   ,464136.197
                                                                                   ,154817.081
                                                                                   ,464139.198))) gml
      
        from dual
      Is this kind of geometry not supported?

      Oracle 11.2.0.3.0

      Edited by: Rene W. on May 24, 2013 12:11 AM
        • 1. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
          Rene W.
          Should have read the manual:

          http://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_util.htm#BJEGEJGI

          This function does not convert circles, geometries containing any circular arcs, LRS geometries, or geometries with an SDO_ETYPE value of 0 (type 0 elements); it returns an empty CLOB in these cases.

          What are my options for converting geometry to GML without changing the geometry by the use of arc_densify?

          Any pointers are welcome.
          • 2. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
            Stefan Jager
            :-)

            Hallo Rene,

            According to [url http://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_util.htm#autoId27]that same documentation, none:
            Documentation says:
            Any circular arcs or circles must be densified (using the SDO_GEOM.SDO_ARC_DENSIFY function) or represented as polygons (using the SDO_GEOM.SDO_BUFFER function) before being passed to > the TO_GMLGEOMETRY function. (See the Examples section for an example that uses SDO_ARC_DENSIFY with the TO_GMLGEOMETRY function.)
            Unless of course you are willing and able to write your own function specifically for arcs.... [url http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd]GML 3.1.1 does support Arcs:
            <complexType name="ArcStringType">
              <annotation>
                <documentation>
                  An ArcString is a curve segment that uses three-point circular arc interpolation.
                </documentation>
              </annotation>
              <snip... />
            <complexType name="ArcType">
              <annotation>
                <documentation>
                  An Arc is an arc string with only one arc unit, i.e. three control points.
                </documentation>
              </annotation>
              <snip ... />
            Regards,
            Stefan
            • 3. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
              Rene W.
              Thanks Stefan,

              sdo_util.to_gml311geometry seems to be a bit of a misnomer.

              The thing to consider for us now is if we still want to do the conversion in the database or to do it outside of the database. The resulting GML is only used in external communications.
              • 4. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
                Stefan Jager
                Rene W. wrote:
                The thing to consider for us now is if we still want to do the conversion in the database or to do it outside of the database. The resulting GML is only used in external communications.
                In that case you may want to consider FME, or if you have a GIS Desktop application you could use that too. I know for a fact that GeoMedia does a pretty decent job, if you prep it well. And I assume ESRI can also do it. If it's a returning (weekly/monthly) export, I'd seriously consider FME since you can easily run that from the command line once it's set up correctly.

                Doing it from within oracle is nice, but if you need to support the Dutch way of doing things it can be a bit of a pain.

                HTH,
                Stefan
                • 5. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
                  Paul Dziemiela
                  Hi Rene,

                  Our friends at Oracle proudly trumpet the compliance of Oracle Spatial with OGC standards:
                  http://www.oracle.com/technetwork/database/enterprise-edition/spatial-stds-support-094078.html
                  Now each of us can independently judge the letter and the spirit of such statements. But there they are.

                  Probably the best we can do as a community is to encourage you to submit an enhancement SR on the matter and post the resulting bug number here (history shows it will go into metalink as an unsearchable bug). Then those of us with an interest in GML can then add ourselves to your enhancement request.

                  For example, I believe it would take the spatial team about 15 minutes to add support for GML 3.2 to the existing functions
                  Oracle Spatial and support for GML 3.2.1?
                  If having GML 3.2 support out-of-the box would be helpful to you please add yourself to my enhancement request (under bug 9788193).

                  Now of course I have not been able to hold off producing GML 3.2 for the three years since I submitted that enhancement request. I long ago just whipped up my own GML 3.2 reader and writer using PLSQL and XMLTYPE.

                  Cheers,
                  Paul
                  1 person found this helpful
                  • 6. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
                    Rene W.
                    Hi Paul,

                    I found your Bug. Don't know what you mean by "add yourself to".

                    Rene
                    • 7. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
                      Paul Dziemiela
                      Hi Rene,

                      What I mean by adding yourself to the bug would be to create your own SR with Oracle but mention the existing bug number so that they do not mistakenly create a duplicate (can happen depending on how you describe things to them). At the bottom of each bug is some cryptic timestamped notes where Oracle will track that another customer is complaining about the same issue. So for my GML bug, at the bottom you can see that in March 2011 some folks associated with the INSPIRE initiative "added themselves" to my bug. However, no one else has. :(
                      So perhaps indeed there is no need for GML 3.2 or GML 3.3 functionality with Oracle Spatial.

                      Cheers,

                      Paul
                      • 8. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
                        Bkazar-Oracle
                        Hi,-
                        we do support arcs and circular arcs (full arc in this case) for GML 311.
                        I still dont see what kind of geometry the following is:
                        mdsys.sdo_geometry(
                                         2003
                                                                            ,null
                                                                            ,null
                                                                            ,mdsys.sdo_elem_info_array(1, 1003, 2)
                                                                            ,mdsys.sdo_ordinate_array(154817.081
                                                                                                     ,464139.198
                                                                                                     ,154814.081
                                                                                                     ,464142.199
                                                                                                     ,154811.081
                                                                                                     ,464139.198
                                                                                                     ,154814.081
                                                                                                     ,464136.197
                                                                                                     ,154817.081
                                                                                                     ,464139.198))
                        Is this meant to be circular arc in that case etype's last component ie, interpretation should be 4 instead of 2.
                        If this is an arc, then you need to change the gtype to 2002.
                        If this is meant to be a compound polygon, then you need to have first 1005 triplet etc.

                        Please give us more information and we can resolve this.
                        Thanks

                        Ps. We are working on Bug 9788193 to support GML 3.2.
                        • 9. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
                          Rene W.
                          What do you mean you don't know what this geometry is supposed to be? All the information is right there !

                          Gtype 2003 : 2 dimensional, non-LRS, polygon
                          Elem-info (1,1003,2): ordinates offset 1, exterior ring, made up of a sequence of circular arcs.

                          You may want to read the manual.

                          Oh, and what do you mean we support circular arcs:
                          "This function does not convert circles, geometries containing any circular arcs, LRS geometries, or geometries with an SDO_ETYPE value of 0 (type 0 elements); it returns an empty CLOB in these cases."

                          Also in the manual.

                          Edited by: Rene W. on May 29, 2013 10:42 PM
                          • 10. Re: sdo_util.to_gml311geometry returns null for polygon with circular arcs.
                            Bkazar-Oracle
                            That is an ok geometry.
                            Please file a bug on this.
                            As a workaround:
                            SQL> select sdo_util.to_gml311geometry(
                                             mdsys.sdo_geometry(
                                             2003
                                                                                ,90112
                                                                                ,null
                                                                                ,mdsys.sdo_elem_info_array(1, 1005, 2, 1, 2, 2, 5, 2, 2)
                                                                                ,mdsys.sdo_ordinate_array(154817.081,464139.198
                                                                                                         ,154814.081,464142.199
                                                                                                         ,154811.081,464139.198
                                                                                                         ,154814.081,464136.197
                                                                                                         ,154817.081,464139.198))) from dual;
                            
                            
                            SDO_UTIL.TO_GML311GEOMETRY(MDSYS.SDO_GEOMETRY(2003,90112,NULL,MDSYS.SDO_ELEM_INF
                            --------------------------------------------------------------------------------
                            <gml:Polygon srsName="SDO:90112" xmlns:gml="http://www.opengis.net/gml"><gml:ext
                            erior><gml:Ring><gml:curveMember><gml:Curve><gml:segments><gml:Arc><gml:posList
                            srsDimension="2">154817.081 464139.198 154814.081 464142.199 154811.081 464139.1
                            98 </gml:posList></gml:Arc></gml:segments></gml:Curve></gml:curveMember><gml:cur
                            veMember><gml:Curve><gml:segments><gml:Arc><gml:posList srsDimension="2">154811.
                            081 464139.198 154814.081 464136.197 154817.081 464139.198 </gml:posList></gml:A
                            rc></gml:segments></gml:Curve></gml:curveMember></gml:Ring></gml:exterior></gml:
                            Polygon>