Skip to main content
Question

Replacing a line in an existing polygon

  • August 18, 2020
  • 3 replies
  • 18 views

melanied
Contributor
Forum|alt.badge.img

Hello,

 

I have two shapefiles :

  • an existing polygon shapefile
  • a newer file containing a line (more precise) that covers part of the existing polygon file

My goal is to obtain a polygon in which the more recent line is replaced in the initial polygon. I have identified the indexes of the points that need to be deleted in the initial file but I don't know how to add between these two indexes the points of the more recent line.

I thought of making a loop in a customTransformer but it seems quite complex...

 

Do you have any suggestions ?

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.

3 replies

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • August 18, 2020

A couple of different options.

 

Use the Snipper to remove the boundary between identified indexes. Use an AreaBuilder to rebuild the polygon with the remaining boundary and newer line.

 

Use the PolygonCutter custom transformer.

 

Use the AnchoredSnapper in SegmentSnappingMode with the line as the anchor. You may need to densify the polygon first.

 

Use a pythonCaller to manipulate the polygon boundary curve.


Forum|alt.badge.img+2
  • 1891 replies
  • August 18, 2020

@melanied Do you have a small example dataset you could share with the community?


melanied
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • 6 replies
  • August 20, 2020

A couple of different options.

 

Use the Snipper to remove the boundary between identified indexes. Use an AreaBuilder to rebuild the polygon with the remaining boundary and newer line.

 

Use the PolygonCutter custom transformer.

 

Use the AnchoredSnapper in SegmentSnappingMode with the line as the anchor. You may need to densify the polygon first.

 

Use a pythonCaller to manipulate the polygon boundary curve.

Thank you for your answer : Snipper and AreaBuilder seem a good solution. I succeed in replacing a line in a polygon with these transformers. The reality is that for each polygon I have generally more than one line to replace, I have to iterate and it's not easy to update the initial indexes. If you have any suggestion for this part, I am listening !