Skip to main content
Solved

Failed to replace feature geometry from multi-polygon GML geometry

  • April 26, 2023
  • 1 reply
  • 36 views

Forum|alt.badge.img+2

Hi FME Community,

I have an error when trying to replace some geometry from GML encoded geometry with the GeometryReplacer transformer :

xml-donut Geometry Builder: unable to adopt the below geometry because construction for its own geometry has already been finalized
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: `'
Attribute(string: UTF-8): `fme_geometry' has value `fme_polygon'
Attribute(string: UTF-8): `fme_type' has value `fme_area'
Coordinate System: `'
Geometry Type: IFMEPolygon
Name(UTF-16LE): `surfaceMembers'
Boundary:
   Geometry Type: IFMELine
   Number of Coordinates: 5 -- Coordinate Dimension: 2
   (1.2582468599656544,45.82094218175942)(1.2582468599656544,45.82094217549903)(1.2582638025631208,45.82094217549903)(1.2582638025631208,45.82094218175942)(1.2582468599656544,45.82094218175942)

The cause seems to be multi-polygon geometries. However, the GML syntax seems correct (I can visualize it with Data Inspector tool) :

<?xml version="1.0" encoding="UTF-16"?>
<geometrie srsName="EPSG:4326">
    <gml:surfaceMembers xmlns:gml="http://www.opengis.net/gml/3.2">
        <gml:Polygon>
            <gml:exterior>
                <gml:LinearRing>
                    <gml:posList srsDimension="2">1.2582694531028737 45.82096974058584 1.2582694531028737 45.820969734325445 1.2582186430744309 45.820969734325445 1.2582186430744309 45.82096974058584 1.2582694531028737 45.82096974058584</gml:posList>
                </gml:LinearRing>
            </gml:exterior>
        </gml:Polygon>
        <gml:Polygon>
            <gml:exterior>
                <gml:LinearRing>
                    <gml:posList srsDimension="2">1.2582468599656544 45.82094218175942 1.2582468599656544 45.82094217549903 1.2582638025631208 45.82094217549903 1.2582638025631208 45.82094218175942 1.2582468599656544 45.82094218175942</gml:posList>
                </gml:LinearRing>
            </gml:exterior>
        </gml:Polygon>
    </gml:surfaceMembers>
</geometrie>

Here are the transformer parameters :

GeometryReplacerDo you have any idea how to solve or work around the issue ?

Thanks !

Version : FME(R) 2022.2.5.0 (20230329 - Build 22795 - WIN64)

 

Best answer by ronan.herve

Solution provided by the SAFE support team : 

The geometry encoded in the XML is not quite complete for the multi-polygons. It should be enclosed by a MultiSurface. Please try adding a StringReplacer before the GeometryReplacer, and replace 'geometrie' in the xml_fragment with 'MultiSurface'.

This will make all the polygons into multi-polygon aggregates. You can use a GeometryRefiner after the GeometryReplacer to convert the single part multi-polygons back to simple polygons.

View original
Did this help you find an answer to your question?

1 reply

Forum|alt.badge.img+2
  • Author
  • Best Answer
  • May 2, 2023

Solution provided by the SAFE support team : 

The geometry encoded in the XML is not quite complete for the multi-polygons. It should be enclosed by a MultiSurface. Please try adding a StringReplacer before the GeometryReplacer, and replace 'geometrie' in the xml_fragment with 'MultiSurface'.

This will make all the polygons into multi-polygon aggregates. You can use a GeometryRefiner after the GeometryReplacer to convert the single part multi-polygons back to simple polygons.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings