Skip to main content
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.

  • February 16, 2021
  • 6 replies
  • 50 views

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

nielsgerrits
VIP
Forum|alt.badge.img+54

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


DanAtSafe
Safer
Forum|alt.badge.img+18
  • Safer
  • February 16, 2021

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


Forum|alt.badge.img+2
  • February 16, 2021

@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.


lars_de_vries
Forum|alt.badge.img+10
markatsafe wrote:

@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.


lars_de_vries
Forum|alt.badge.img+10

@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.


maayke
Contributor
Forum|alt.badge.img+6
  • Contributor
  • March 5, 2021

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

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