From 837ba636109452a6595256967e0e8149616af0a2 Mon Sep 17 00:00:00 2001 From: Clemens Portele Date: Sat, 4 Jul 2026 16:50:16 +0200 Subject: [PATCH] fix schema-invalid GML for polygon rings when useSurfaceAndCurve is enabled Plain polygons were encoded as Ring > curveMember > LineStringSegment, but gml:curveMember requires an element from the gml:AbstractCurve substitution group. The ring is now delegated to the geometry encoder, producing Ring > curveMember > Curve > segments > LineStringSegment, consistent with the existing curve-polygon path. Curve polygons were not affected. - GeometryEncoderGml: delegate polygon rings to the embedded encoder in the USE_SURFACE_RING_CURVE branch - GeometrySpec: expect the wrapped, schema-valid encoding --- .../xtraplatform/features/gml/domain/GeometryEncoderGml.java | 4 +--- .../ii/xtraplatform/features/gml/domain/GeometrySpec.groovy | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/xtraplatform-features-gml/src/main/java/de/ii/xtraplatform/features/gml/domain/GeometryEncoderGml.java b/xtraplatform-features-gml/src/main/java/de/ii/xtraplatform/features/gml/domain/GeometryEncoderGml.java index 992182fb2..06f0eb131 100644 --- a/xtraplatform-features-gml/src/main/java/de/ii/xtraplatform/features/gml/domain/GeometryEncoderGml.java +++ b/xtraplatform-features-gml/src/main/java/de/ii/xtraplatform/features/gml/domain/GeometryEncoderGml.java @@ -495,9 +495,7 @@ public Void visit(Polygon geometry) { if (useSurfaceAndCurve) { writeStartTagObject(RING, true); writeStartTagProperty(CURVE_MEMBER); - writeStartTagDataType(LINE_STRING_SEGMENT); - writePositionList(ring.getValue().getCoordinates(), geometry.getAxes()); - writeEndTag(); + ring.accept(encodeAsEmbeddedGeometry.orElse(this)); writeEndTag(); } else { writeStartTagObject(LINEAR_RING, true); diff --git a/xtraplatform-features-gml/src/test/groovy/de/ii/xtraplatform/features/gml/domain/GeometrySpec.groovy b/xtraplatform-features-gml/src/test/groovy/de/ii/xtraplatform/features/gml/domain/GeometrySpec.groovy index bc5acd08a..5c6ed3ceb 100644 --- a/xtraplatform-features-gml/src/test/groovy/de/ii/xtraplatform/features/gml/domain/GeometrySpec.groovy +++ b/xtraplatform-features-gml/src/test/groovy/de/ii/xtraplatform/features/gml/domain/GeometrySpec.groovy @@ -445,7 +445,7 @@ class GeometrySpec extends Specification { String gmlOut = sw.toString() then: - gmlOut == "0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0" + gmlOut == "0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0" } def 'CURVEPOLYGON XY with USE_SURFACE_RING_CURVE'() {