Skip to main content
Question

How to define/create a separate envelope element for each geometry within a feature and for the feature itself? (KML to CityGML transformation)


The first image shows my aim - each geometry has an envelope containing info for upper and lower corners. The second image shows where I am now. Note that in my current version I have the envelope outside the building, but I would need to have it inside, and also would need a separate envelope inside the ground surface.Screenshot 2021-03-14 at 1.36.54 AMScreenshot 2021-03-14 at 1.38.54 AM

2 replies

mark2atsafe
Safer
Forum|alt.badge.img+46
  • Safer
  • March 17, 2021

I think there are a few ways here, depending on the interpretation of the question (sorry, it's not totally clear to me). If you read the data with a GML reader, either you'll get all of the geometries as a separate feature, or you'll get a single feature that you could explode into multiples with a Deaggregator. From there you could create an envelope using a transformer like the BoundingBoxReplacer.

 

Alternatively, you could fish the envelopes out of the GML directly! You would use the XMLFragmenter transformer to read the GML and scan it for gml:Envelope tags. It can flattens the attributes inside it, to give us lowerCorner and upperCorner as attributes. You can split each of these into separate X and Y values and then run it through a 2DBoxReplacer to create the envelope.

 

So, yes, a couple of potential solutions there. I hope this helps, but apologies if I misunderstood the question.


  • Author
  • March 18, 2021
mark2atsafe wrote:

I think there are a few ways here, depending on the interpretation of the question (sorry, it's not totally clear to me). If you read the data with a GML reader, either you'll get all of the geometries as a separate feature, or you'll get a single feature that you could explode into multiples with a Deaggregator. From there you could create an envelope using a transformer like the BoundingBoxReplacer.

 

Alternatively, you could fish the envelopes out of the GML directly! You would use the XMLFragmenter transformer to read the GML and scan it for gml:Envelope tags. It can flattens the attributes inside it, to give us lowerCorner and upperCorner as attributes. You can split each of these into separate X and Y values and then run it through a 2DBoxReplacer to create the envelope.

 

So, yes, a couple of potential solutions there. I hope this helps, but apologies if I misunderstood the question.

Hi!

 

No, this is exactly what I was wondering!

I will try it and update you with the outcome. I found my way around it, but it is outside of FME and I would like to have everything correct within the engine without extra steps. Your solutions sound exactly like such.

 

Thank you so much!

 

Ayda


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