Skip to main content
Solved

Trying to shrink GML data to specific buildings

  • May 8, 2023
  • 5 replies
  • 20 views

I downloaded gml file of munich and want to use only few buildings, specifically TUM, from it. However the gml covers large area.

 

How do I cut out the buildings that I want and remove the other buildings from the gml and then save it?

 

I tried using "Clipper" transformers but I dont have any other information or files to use other than personally knowing that I only want the specific few buildings.

 

Best answer by kailinatsafe

Hello @khairilariffin​, there are probably a few different ways you can do this in FME Form. However, is there a unique identifier / attribute on the building features? 

 

If so, the easiest way might be to use a Tester transformer to select or isolate the buildings of interest. Afterwards, you can use a BoundingBoxAccumulator to create a clipper feature and clip the original dataset! 

 

In this example, I used a sample GML dataset of FireHalls in the Vancouver area. A unique attribute called ‘FireHall’ (eg. stored the number of each firehall) allowed me to select the FireHalls nearest the coast (FireHall = 7 OR FireHall = 8). Afterwards, a BoundingBoxAccumulator can be used to generate a bounding box. The original dataset is clipped with the new bounding box: 

 

GMLFireHallsOtherwise, perhaps you could try using the BoundsExtractor on another feature to select an area, or even a SpatialRelator to select your features of interest. Let me know if you have any other questions! Happy to help, Kailin.

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

kailinatsafe
Safer
Forum|alt.badge.img+23
  • Safer
  • 720 replies
  • Best Answer
  • May 8, 2023

Hello @khairilariffin​, there are probably a few different ways you can do this in FME Form. However, is there a unique identifier / attribute on the building features? 

 

If so, the easiest way might be to use a Tester transformer to select or isolate the buildings of interest. Afterwards, you can use a BoundingBoxAccumulator to create a clipper feature and clip the original dataset! 

 

In this example, I used a sample GML dataset of FireHalls in the Vancouver area. A unique attribute called ‘FireHall’ (eg. stored the number of each firehall) allowed me to select the FireHalls nearest the coast (FireHall = 7 OR FireHall = 8). Afterwards, a BoundingBoxAccumulator can be used to generate a bounding box. The original dataset is clipped with the new bounding box: 

 

GMLFireHallsOtherwise, perhaps you could try using the BoundsExtractor on another feature to select an area, or even a SpatialRelator to select your features of interest. Let me know if you have any other questions! Happy to help, Kailin.

 


Hello @khairilariffin​, there are probably a few different ways you can do this in FME Form. However, is there a unique identifier / attribute on the building features? 

 

If so, the easiest way might be to use a Tester transformer to select or isolate the buildings of interest. Afterwards, you can use a BoundingBoxAccumulator to create a clipper feature and clip the original dataset! 

 

In this example, I used a sample GML dataset of FireHalls in the Vancouver area. A unique attribute called ‘FireHall’ (eg. stored the number of each firehall) allowed me to select the FireHalls nearest the coast (FireHall = 7 OR FireHall = 8). Afterwards, a BoundingBoxAccumulator can be used to generate a bounding box. The original dataset is clipped with the new bounding box: 

 

GMLFireHallsOtherwise, perhaps you could try using the BoundsExtractor on another feature to select an area, or even a SpatialRelator to select your features of interest. Let me know if you have any other questions! Happy to help, Kailin.

 

Thanks for the advice, I tried giving the BoundingBoxAccumulator the BoundsExtractor with X and Y coordinates but it didnt seem to work. Do you know any method or transformers to set up the bounding box with the X and Y coordinates.


kailinatsafe
Safer
Forum|alt.badge.img+23
  • Safer
  • 720 replies
  • May 9, 2023

Thanks for the advice, I tried giving the BoundingBoxAccumulator the BoundsExtractor with X and Y coordinates but it didnt seem to work. Do you know any method or transformers to set up the bounding box with the X and Y coordinates.

Hello @khairilariffin​, thanks for the update! So if you used the BoundsExtractor, you should have some new attributes such as: _xmin, _xmax, etc? In my example, they are point features, so I was able to use a VertexCreator to create the point geometry, and then a BoundingBoxAccumulator afterwards:

vertex_bboxYou can do a similar thing or try to build the polygon yourself with VertexCreators/Counter/LineBuilder/etc.


Thanks so much for the advice. Using BoundsExtractor and 4 Creators I was able to create coordinates points to give to the BoundingBoxAccumulator so it can create boundary based on the points.

 

image.png


kailinatsafe
Safer
Forum|alt.badge.img+23
  • Safer
  • 720 replies
  • May 9, 2023

Thanks so much for the advice. Using BoundsExtractor and 4 Creators I was able to create coordinates points to give to the BoundingBoxAccumulator so it can create boundary based on the points.

 

image.png

Hello @khairilariffin​, awesome!! So glad you got it working! If you wanted to reduce the number of transformers being used, you could also try creating the polygon in a single Creator (this would elimate the need for the BoundingBoxAccumulator as well):

 

imageThis would require you knowing the coordinates ahead of time though! Until next time, Kailin.