Skip to main content
Solved

I could not visualize the boundry of the polygon and extract the geograhphic location


hiyhelg
Contributor
Forum|alt.badge.img+4

 

Dear FME community.

I got xml data with geographic location,  I tried to use coordinateExtractor but I could not get x and y coordinates and I could not also visualize the polygon using FME inspector. How do  Extract the X and y attribute? 

Any idea would be apricated and thank you in advance.

 

 

Best answer by becchr

I’m not familiar with data interoparability, but it should be the same transformers indeed.

Thanks for your workspace, but the sourcefile is missing (test.xml), if you could share it might be easier to help?

I see you use an attribute “vlaklocatie.surfaceMember.Polygon.exterior.LinearRing.posList” in the geometryreplacer, but that should be “vlaklocatie.surfaceMember” (I think, as geomancer mentioned it should be the gml-part of the xml)

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

10 replies

geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • March 7, 2024

You can extract the GML data in the XMLFragmenter, followed by a GeometeryReplacer to convert the GML to a geometry.

You can also use a StringSearcher to search for the GML part of the XML. The regular expression in the StringSearcher could be something like

 (<gml:Surface .*?</gml:Surface>)

The exact implementation depends on your XML data.


hiyhelg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 7, 2024

Thank you for your prompt replay. I don’t know if I have formulated my question good.  FME is not understanding the list of coordinates in my XML. I tried to use the transformer 

"GeometeryReplacer "like  you said, still I am getting error.

 


becchr
Influencer
Forum|alt.badge.img+25
  • Influencer
  • March 7, 2024

Hi, seems to work fine on 2023.2, could the workspace attached help you?

Entered the gml from your screenshot as an attribute, makes a geometry of it!


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • March 7, 2024

I think the question behind the question is how to extract the GML data from the XML.

 


hiyhelg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 7, 2024

 

Thank you.  I am using data Interoperability ,I guess it is has same  transformers as FME. Still I am not getting Geometric attributeT

 

GeometryReplacer_<Rejected> (TeeFactory): GeometryReplacer_<Rejected>: Termination Message: 'GeometryReplacer output a <Rejected> feature.  To continue translation when features are rejected, change 'Workspace Parameters' > Translation > 'Rejected Feature Handling' to 'Continue Translation''
 

 


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • March 7, 2024

You use the whole XML in the GeometryExtractor, but you should first create an attribute that contains only the GML part of the XML. 

The exact implementation depends on your XML data.


becchr
Influencer
Forum|alt.badge.img+25
  • Influencer
  • Best Answer
  • March 7, 2024

I’m not familiar with data interoparability, but it should be the same transformers indeed.

Thanks for your workspace, but the sourcefile is missing (test.xml), if you could share it might be easier to help?

I see you use an attribute “vlaklocatie.surfaceMember.Polygon.exterior.LinearRing.posList” in the geometryreplacer, but that should be “vlaklocatie.surfaceMember” (I think, as geomancer mentioned it should be the gml-part of the xml)


hiyhelg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 8, 2024

 

 I really appreciate for your help. Indeed it is easier if I send the example of XMl I am dealing with. Hooping you will get some time to look at it.

Once again Thank you!!


becchr
Influencer
Forum|alt.badge.img+25
  • Influencer
  • March 8, 2024

Thanks, if in the XML-reader you set ‘Elements to Match’ to (based on the xml you just send):

xml-tables/projectlocaties-table/projectlocaties xml-tables/projectlocaties-table/projectlocaties/projectlocaties/projectlocatie/coordinatenEtrs/vlaklocatie

 

it will extract the GML-part you need to an attribute xml_fragment:

You can use this attribute in the GeometryReplacer and you’ll get the geometry

I see there’s the same geometry in a different coordinate system too (RD), if you prefer that one, the ‘Elements to match’ should be:

xml-tables/projectlocaties-table/projectlocaties xml-tables/projectlocaties-table/projectlocaties/projectlocaties/projectlocatie/coordinatenOpgegeven/vlaklocatie

 

Hope this helps, not sure how to implement it in Data Interoperability but guess it won’t be that different?


hiyhelg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 19, 2024

Beste becchr and geomancer

 Thank you for your help. Now it is working . The probleem was with the workspace Parameter. It was rejecting it now i changed the setting to continue  Translation

Workspace Parameters' > Translation > 'Rejected Feature Handling' to 'Continue Translation''

 Once again  Thank you

Greetings

Helen


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