0

How can I read with 'deegree' a GML3.2 with an arc?

The simplified data contains an arc:

<gml:Polygon>
  <gml:exterior>
    <gml:Ring>
      <gml:curveMember>
        <gml:Curve>
          <gml:segments>
            <gml:LineStringSegment>
              <gml:posList>44.605 773.516 40.806 775.320</gml:posList>
            </gml:LineStringSegment>
            <gml:LineStringSegment>
              <gml:posList>40.806 775.320 38.522 759.491</gml:posList>
            </gml:LineStringSegment>
            <gml:LineStringSegment>
              <gml:posList>38.522 759.491 45.178 773.702</gml:posList>
            </gml:LineStringSegment>
            <gml:Arc>
              <gml:posList>45.178 773.702 44.930 773.491 44.605 773.516</gml:posList>
            </gml:Arc>
          </gml:segments>
        </gml:Curve>
      </gml:curveMember>
    </gml:Ring>
  </gml:exterior>
</gml:Polygon>

When performing this method

GMLObject gmlObject = null;
XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(gml));
GMLStreamReader gmlStreamReader = GMLInputFactory.createGMLStreamReader(gmlVersion, r);
gmlObject = gmlStreamReader.read(); // --> error 1
gmlObject.toString(); // --> error 2

I get these errors:

  1. Method threw 'java.lang.IllegalArgumentException' exception. Cannot evaluate org.deegree.geometry.standard.primitive.DefaultPolygon.toString()
  2. java.lang.IllegalArgumentException: Cannot determine control points for ring, contains non-linear segments.

How to cope with this issue?

4

1 Answer 1

1

EDIT

[The GML is not valid] -> I suppose that deegree thinks that the GML is not valid, because the upper level element is <gml:Polygon>, and by some definitions polygons can contain only straight segments. Maybe therefore <gml:Arc> that appears deeper in the data gives an error.

Arc and other curved element are allowed in a PolygonPatch https://datypic.com/sc/niem21/e-gml32_PolygonPatch.html.

2
  • Is the above really true? Other systems can work with arcs within a polygon. This is what I can find: datypic.com/sc/niem21/e-gml32_Polygon.html. You can click on polygon > exterior > ring > curveMember > curve > segments > arc.
    – tm1701
    Commented Sep 15, 2023 at 13:06
  • 1
    I edited the answer to ponder if that's how the deegree software is analyzing the GML.
    – user30184
    Commented Sep 15, 2023 at 17:19

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.