Solved

GeometryPropertyRemover doesn't seem to work when writing to GML

  • 11 February 2022
  • 3 replies
  • 0 views

Hi all,

 

I am designing an automated proces to transform a File Geodatabase into a GML that is validated by an XSD. The validation fails, because the gml_id is part of the geometry trait of the feature, where this shouldn't be the case. When temporarily turning the validate output parameter off, the result looks like this:

GML1" data-fileid="0694Q00000H4l5hQAB 

The red line in the picture above indicates the gml_id I'm talking about. For the XSD validation to work, the gml_id in the geometry needs to be removed.

 

When checking the attributes of the point feature, I see that the gml_id clearly is a geometry trait of this feature. See the picture below:

GML2" data-fileid="0694Q00000H4l5NQAR With this information, I made the assumption that with a GeometryPropertyRemover, this gml_id could easily be removed, leaving me with only the coordinate system, the dimensions and the actual geometry. I used a GeometryPropertyRemover with the following settings. Note that my client uses FME 2018:

GML3" data-fileid="0694Q00000H4l5SQAR 

After running the workspace, the FME Data Inspector shows that the gml_id is removed.

 

In the resulting GML however, the gml_id isn't removed, it has '-0' appended to it:

 

GML4" data-fileid="0694Q00000H4l5cQAB 

 

Quite strange, if you ask me. Does anyone have an idea why this happens and how I can solve this? I need that gml_id to be removed..

 

Cheers,

 

Vince

icon

Best answer by mark2atsafe 12 February 2022, 00:43

View original

3 replies

Userlevel 4
Badge +25

The easiest way to achieve what you ask is to run the data back through an XMLUpdater transformer, like so:

 

image 

So I read the source data and write it to GML with a FeatureWriter transformer. Then the XMLUpdater reads it back and updates the content. The AttributeFileWriter pushes it out to the file again.

 

The search path (for me) is:

//fme:Parks/@gml:id

...where Parks is the tag and the at symbol denotes the attribute.

 

There could be a more official way to do this, but I haven't found it. As far as I can tell, for "features" in GML (as opposed to "geometries") the gml:id is more or less compulsory. That's why (I believe) FME adds them regardless. But it does look like your data is more of a geometry than a feature. 

 

Sorry, I don't know enough about GML to give you a clear answer "why", but the XMLUpdater method should be the "how" that you need.

 

 

Badge

The easiest way to achieve what you ask is to run the data back through an XMLUpdater transformer, like so:

 

image 

So I read the source data and write it to GML with a FeatureWriter transformer. Then the XMLUpdater reads it back and updates the content. The AttributeFileWriter pushes it out to the file again.

 

The search path (for me) is:

//fme:Parks/@gml:id

...where Parks is the tag and the at symbol denotes the attribute.

 

There could be a more official way to do this, but I haven't found it. As far as I can tell, for "features" in GML (as opposed to "geometries") the gml:id is more or less compulsory. That's why (I believe) FME adds them regardless. But it does look like your data is more of a geometry than a feature. 

 

Sorry, I don't know enough about GML to give you a clear answer "why", but the XMLUpdater method should be the "how" that you need.

 

 

Thank you. 

Would you please help me formulate an XQuery for the following GML to reach the gml id in the geometry?

 

<?xml version="1.0" encoding="UTF-8"?>
<gml:FeatureCollection xmlns:img="http://www.geluidgegevens.nl/IMGeluid/1.2" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:dlogger="http://www.armatiek.nl/functions/dlogger-proxy" xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0" gml:id="idb5c7c638-ba3c-4871-a520-9970d016ce9e">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:28992" srsDimension="3">
<gml:lowerCorner>60065.936400000006 410493.4679999985 -999</gml:lowerCorner>
<gml:upperCorner>146050.5309999995 474731.5689999983 28.769000000000233</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<gml:featureMember>
<img:Diffractor gml:id="NL.img.12345678.27364178.806b84dc-064a-4c36-9908-c7fb4bd9e2ee">
<img:identificatie>
<img:NEN3610ID>
<img:namespace>NL.img</img:namespace>
<img:lokaalID>27364178.806b84dc-064a-4c36-9908-c7fb4bd9e2ee</img:lokaalID>
</img:NEN3610ID>
</img:identificatie>
<img:naam>D1</img:naam>
<img:omschrijving>Test_diffractor</img:omschrijving>
<img:breedte>1</img:breedte>
<img:statusZwevend>false</img:statusZwevend>
<img:diffractoreffect>
<img:WaardePerOctaafband>
<img:band31Hz>0.5</img:band31Hz>
<img:band63Hz>0.5</img:band63Hz>
<img:band125Hz>0.5</img:band125Hz>
<img:band250Hz>0.5</img:band250Hz>
<img:band500Hz>0.6</img:band500Hz>
<img:band1000Hz>0.8</img:band1000Hz>
<img:band2000Hz>0.5</img:band2000Hz>
<img:band4000Hz>0.5</img:band4000Hz>
<img:band8000Hz>0.5</img:band8000Hz>
</img:WaardePerOctaafband>
</img:diffractoreffect>
<img:geometrie>
<gml:LineString gml:id="NL.img.12345678.27364178.806b84dc-064a-4c36-9908-c7fb4bd9e2ee-0" srsName="EPSG:28992" srsDimension="3">
<gml:posList>84611.99240000173 451716.78979999945 0 84669.93499999866 451782.63369999826 0</gml:posList>
</gml:LineString>
</img:geometrie>
</img:Diffractor>
</gml:featureMember>

I need to remove gml_id in Line 35

Hi Mark,

 

Thank you for your response. '//gml:Point/@gml:id' did the trick in my scenario.

 

Cheers,

 

Vince

Reply