Question

I Would like to cut a complicated polygon (fme_aggregate geometry) in two pieces with a line, so that I have two features afterwards.

  • 16 February 2021
  • 6 replies
  • 1 view

Here you can see the complicated geometry, I want to cut it at the red arrow.Knip Polygon 

Based on this line, that intersects the geometry:

Knip Hier 

I tried this using a couple of methods, where the FME hub transformer PolygonCutter got the best result. However I did not get 2 features in the end, and the geometries where not exactly the same as the input. The only thing I want is just a simple cut on the place of the line, that splits the geometry in 2 pieces. So I can assing different values to both of them.


6 replies

Userlevel 6
Badge +32

No default functionality as far as I know. I would try to use a Clipper to do this.

Userlevel 1
Badge +11

Hi @tomhhnk​ Please upvote https://community.safe.com/s/idea/0874Q000000TkqQQAS if you haven't already.

Badge +2

@tomhhnk​ PolygonCutter should work for you. Perhaps @Lars de Vries​ who is the author could take a look and possibly upgrade the custom transformer to use tolerances etc. to give a slightly better result.

Badge +3

@tomhhnk​ PolygonCutter should work for you. Perhaps @Lars de Vries​ who is the author could take a look and possibly upgrade the custom transformer to use tolerances etc. to give a slightly better result.

I missed your remark. I'll had to look into the transformer anyhow, because of another remark. Currently really busy, but I'll try to look into it within a few weeks and reply when updated the transformer.

Badge +3

@tomhhnk​ Thinking about your last remark that the geometries where not the same as the input. Can that be explained that you got additional vertices at the location where the area was intersected?

Could you add a file to this thread that contains the two example geometries, that allows me to improve the PolygonCutter and reproducing your issue.

Badge +1

If you cannot wait for the PolygonCutter to be updated, I think there's two options you can try:

1. Using the LineOnLineOverlayer:

  • Turn the polygons in to lines using a GeometryCoercer.
  • Connect both the 'cut-lines' and the 'polygon-lines' to a LineOnLineOverlayer
  • Use an AreaBuilder on the Lines output port

2. Using the Clipper (suboptimal!):

  • Buffer the 'cut-lines' with a tiny amount (e.g. 0.001/1mm)
  • Use a Clipper with the Polygons as Clippee and the 'cut-lines' buffer as Clipper
  • Use a Deaggregator on the 'Outside' port of the Clipper
  • Note: there will be an undesired space of 2mm between your output features when using this approach

Reply