Skip to main content

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 ?

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.


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


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 !


Reply