Solved

Failed to replace feature geometry from multi-polygon GML geometry

  • 26 April 2023
  • 1 reply
  • 5 views

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)

 

icon

Best answer by ronan.herve 2 May 2023, 15:26

View original

1 reply

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