4

Is it valid GML if the boundary of a polygon intersects itself? E.g. I have this polygon consisting of some gml:LineStingSegment and one gml:Arc: enter image description here

My task is to import GML based data (german ALKIS data in NAS format) to Oracle spatial.

In Oracle some polygons have a invalid geometry after import: ORA-13349 The boundary of a polygon intersects itself

So I wonder if it is allowed in GML to define a polygon with a boundary that intersects itself.

Here is a snippet of the GML:

> <gml:Surface gml:id="BRPPR">  <gml:patches>       <gml:PolygonPatch>
>           <gml:exterior>
>               <gml:Ring>
>               ...
>                   <gml:curveMember>
>                       <gml:Curve gml:id="BRPPW">
>                           <gml:segments>
>                               <gml:LineStringSegment>
>                                   <gml:posList>323671.155 5538007.151 323674.553 5538013.270</gml:posList>
>                               </gml:LineStringSegment>
>                           </gml:segments>
>                       </gml:Curve>
>                   </gml:curveMember>
>                   <gml:curveMember>
>                       <gml:Curve gml:id="BRPPX">
>                           <gml:segments>
>                               <gml:Arc>
>                                   <gml:posList>323674.553 5538013.270 323673.358 5538012.318 323671.840 5538012.488</gml:posList>
>                               </gml:Arc>
>                           </gml:segments>
>                       </gml:Curve>
>                   </gml:curveMember>
>                   ...
>               </gml:Ring>             </gml:exterior>         </gml:PolygonPatch>     </gml:patches> </gml:Surface>

2 Answers 2

3

GML is built on the Simple Feature geometry model. The SFM says that a self-intersecting polygon is not "simple" and thus not valid. So I would say no, GML does not allow that.

1
  • 1
    Well almost. "GML-SF", the Simple Features Profile for GML is built on the Simple Features model, but that wouldn't allow a curved Arc in there anyway... But I suspect any reasonable geographic feature model would exclude self-intersecting arcs from validity anyway.
    – Spacedman
    Apr 4, 2016 at 14:13
3

As a comment to an answer by @bugmenot a quotation from GML-SF document http://portal.opengeospatial.org/files/?artifact_id=11266, GML is more than simple features.

In both GML and previous Simple Features (SF) specifications for OGC, such as Simple Features for SQL (SF-SQL) [10], features are considered to be objects which can have geometry and other properties. The SF specifications are more restrictive than GML, however, in that geometry is limited to points, lines, and polygons (and collections of these), with linear interpolation between vertices of lines, and planar (flat) surfaces within polygons. This GML Simple Features (GML-SF) profile has a similar understanding of the structure and geometry of features as SF-SQL. However, GML-SF goes beyond SF-SQL in some important ways: GML-SF supports three-dimensional coordinates (location and elevation) on feature geometry, where SF-SQL just supports two dimensions (location). GML-SF also goes beyond SF-SQL by supporting metadata (section 7.4), a means of referencing local or remote resources which could be used for primary/foreign key references (section 8.4.3.10), and dynamic codelists (section 8.4.3.11). These extensions have been incorporated into GML-SF based on their usefulness across a large base of applications.

When it comes self-intersection and patches, I can't really say if they are denied in general GML. Polygon is a simple patch and it is defined to consist of LinearRings and this is what GML 3.2.1 says about those:

10.5.8 LinearRingType, LinearRing

<complexType name="LinearRingType"> 
<complexContent> 
<extension base="gml:AbstractRingType"> 
<sequence> 
<choice> 
<choice minOccurs="4" maxOccurs="unbounded"> 
<element ref="gml:pos" /> <element ref="gml:pointProperty" /> 
<element ref="gml:pointRep"/> 
</choice> <element ref="gml:posList" /> 
<element ref="gml:coordinates" /> 
</choice> 
</sequence> 
</extension> 
</complexContent> 
</complexType> 
<element name="LinearRing" type="gml:LinearRingType" substitutionGroup="gml:AbstractRing" />

A gml:LinearRing is defined by four or more coordinate tuples, with linear interpolation between them; the first and last coordinates shall be coincident. The encoding of the control points follows the pattern described in 10.1.4.4. The number of direct positions in the list shall be at least four.

I did not went on to AbstractRing for checking if self-intersections are denied at that level. However, in a document about validating City GML http://files.sig3d.de/file/ag-qualitaet/20110531_Regeln_GML_final_EN.pdf self-intersections are not allowed.

In practice spatial operations tend to create topologically incorrect geometries every now and then. It would be hard to handle and fix those topology errors if it would be impossible to save the result even it is known to be wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.