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 = . Afterwards, a BoundingBoxAccumulator can be used to generate a bounding box. The original dataset is clipped with the new bounding box:
Otherwise, 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 = . Afterwards, a BoundingBoxAccumulator can be used to generate a bounding box. The original dataset is clipped with the new bounding box:
Otherwise, 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.
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:
You 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.
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.
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):
This would require you knowing the coordinates ahead of time though! Until next time, Kailin.