Transformer to split a polygon by line


There seems to be a notable hole in the geometry handling of FME.

There's no easy way to split a polygon by a line. This is something even kindergarten kids can do ("if you cut the pie here, how many pieces do you have?"), but FME can't.

So can we please have a transformer that splits a polygon by a line. If you search these boards you'll see it's a commonly requested question (how to).

FME can, just not in one transformer :-)


What do you mean by "line" ? Did you gave a try on the Chopper (by 2 vertex) ?


@Jonathan I just created a custom transformer with the name PolygonCutter. You can find on the FME HUB. Just click here


fyi PR#62406

 

 


Also, FME doesn't draw all over the walls with crayons - this functionality must be added immediately.

Anyway, I'm not clear from your description why you can't use a LineOnAreaOverlayer?


OK, just saw your other post. I'm pretty sure the LineOnAreaOverlayer used to handle this.

 

 

My point about crayons stands...

 


It would make sense that LineOnAreaOverlayer would do this, and that is where we'd put this functionality. It is true that we are a bit lacking in this area. I'm impressed with the # of votes this already achieved in such a short time. Vote early and vote often! :-)


I put all the line and polygon features into a TopologyBuilder, then used the AreaBuilder to build the 'cut' polygons. I had to use a Snapper on the lines prior to the TopologyBuilder. I only had one polygon to cut, so perhaps this doesn't work in more complex cases.


Hi Lars,

 

Thanks for helping with that. But there's a few flaws in your transformer still. First one I spotted is that you're losing your _temp_id attribute along the way (check Intersector and AreaBuilder) and even if you retain it there, you'll have to assign it to all the new parts...


Hi All, any news on this basic but new to be made functionality within FME, from the Safe side?

Cheers,

Hans


I just tested the transformer. Works great for the geometry, but it does something strange with the merged attributes. It seems to merge values from random other objects.