I have an attribute that contains GML geometry that I would like to convert to WKT geometry but its not going so well. For the easy geometry in these files a simple GeometryReplacer does the trick and with a simple stringsplit action in python this is also converted without using too much resources.
<?xml version="1.0" encoding="UTF-16"?>
<stufgeo:kruinlijnBegroeidTerreindeel xmlns:stufgeo="http://www.geostandaarden.nl/imgeo/2.1/stuf-imgeo/1.3">
<gml:Curve srsName="EPSG:28992" xmlns:gml="http://www.opengis.net/gml">
<gml:segments>
<gml:LineStringSegment>
<gml:posList srsDimension="2">161274.467 453784.372 161277.253 453785.924 161279.958 453787.131 161280.921 453787.508</gml:posList>
</gml:LineStringSegment>
</gml:segments>
</gml:Curve>
</stufgeo:kruinlijnBegroeidTerreindeel>
Using stringsplit or Python the result would look like this:
LINESTRING(161274.467 453784.372,161277.253 453785.924,161279.958 453787.131,161280.921 453787.508)
But i have problems getting the results of these mixed GML's
<?xml version="1.0" encoding="UTF-16"?>
<imgeo:kruinlijnOndersteunendWegdeel xmlns:imgeo="http://www.geostandaarden.nl/imgeo/2.1/stuf-imgeo/1.3">
<Curve srsName="urn:ogc:def:crs:EPSG::28992" xmlns="http://www.opengis.net/gml">
<segments>
<LineStringSegment>
<posList srsDimension="2">168343.153 449846.404 168341.911 449843.424 168340.901 449841.832</posList>
</LineStringSegment>
<Arc>
<posList srsDimension="2">168340.901 449841.832 168335.828 449829.203 168330.801 449816.556</posList>
</Arc>
<LineStringSegment>
<posList srsDimension="2">168330.801 449816.556 168323.346 449795.591 168322.728 449793.771</posList>
</LineStringSegment>
<Arc>
<posList srsDimension="2">168322.728 449793.771 168318.423 449780.815 168314.308 449767.798</posList>
</Arc>
<Arc>
<posList srsDimension="2">168314.308 449767.798 168310.486 449755.177 168306.851 449742.500</posList>
</Arc>
<Arc>
<posList srsDimension="2">168306.851 449742.500 168304.954 449735.475 168303.402 449728.365</posList>
</Arc>
<Arc>
<posList srsDimension="2">168303.402 449728.365 168303.202 449727.504 168303.045 449726.635</posList>
</Arc>
</segments>
</Curve>
</imgeo:kruinlijnOndersteunendWegdeel>
Is there a way in FME to convert these to WKT directly before i need to think about using the PythonCaller here? The GeometryReplacer does not work for this example.