Skip to main content
Solved

How can split polygon (rivers/roads) into branch?


Forum|alt.badge.img+1

How can split polygon into branch like this image?

Each branch showed by a number. 

imageAnd the split positions are yellow lines like this

imageEveryone has any ideas to solve this my issue, please show with me! Thank you so much!

Best answer by geomancer

Good idea! But the challenge is probably in creating the lines to use in the PolygonCutter.

I've experimented a bit with some simple data to set up a basic workflow. There's still work to be done though!

Split_Roads_Polygon

View original
Did this help you find an answer to your question?

12 replies

connecter
Forum|alt.badge.img+4
  • April 26, 2022

Hi @pqtkha​ ,

have you try the PolygonCutter transformer? My example:

imageResult:

image 


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • Best Answer
  • April 26, 2022

Good idea! But the challenge is probably in creating the lines to use in the PolygonCutter.

I've experimented a bit with some simple data to set up a basic workflow. There's still work to be done though!

Split_Roads_Polygon


Forum|alt.badge.img+1
  • Author
  • April 27, 2022
connecter wrote:

Hi @pqtkha​ ,

have you try the PolygonCutter transformer? My example:

imageResult:

image 

Thank for your recommend! I tried the PolygonCutter Transformer but before that I have to extract the line which use to split the polygon. I need all step are automate processing from the input data!


virtualcitymatt
Celebrity
Forum|alt.badge.img+34

Another option is to use the the VertexAngleCalculator. This will create points where a vertex between two lines is greater than a chosen amount. You can then use the NeighborFinder in Candidates only mode to find the closet point (within a given distance).

imageThe result will not be perfect because of having to pick an angle but could probably be improved on.

 

Here's an example: Input

imageOutput

image 


Forum|alt.badge.img+1
  • Author
  • April 27, 2022
geomancer wrote:

Good idea! But the challenge is probably in creating the lines to use in the PolygonCutter.

I've experimented a bit with some simple data to set up a basic workflow. There's still work to be done though!

Split_Roads_Polygon

Wow, That great! Your ideas to solve this issue is amazing. I tried your workflow with your demo data. It's really work. I also tried with the real data with bigger scale and I saw a new issue that is the time to process at step NeighborFinder so long. I think because the number of neighbors to find assigned to number vertices is so small for each time to find. I attach my small demo data in below, you can test with your workflow. In fact, my data will bigger than 4 - 5 time with this demo data.

imageI greatly appreciate your helping!


Forum|alt.badge.img+1
  • Author
  • April 27, 2022
virtualcitymatt wrote:

Another option is to use the the VertexAngleCalculator. This will create points where a vertex between two lines is greater than a chosen amount. You can then use the NeighborFinder in Candidates only mode to find the closet point (within a given distance).

imageThe result will not be perfect because of having to pick an angle but could probably be improved on.

 

Here's an example: Input

imageOutput

image 

Thanks for your suggestion on this issue. In your workflow from VertexCreator Tranformer to PolygonCutter that output of VertexCreator is points, but assigned to lines of PolygonCutter. Can you help me to clear more your idea! thank you so much!

I attach my demo data in below, you can use in workflow!


virtualcitymatt
Celebrity
Forum|alt.badge.img+34
pqtkha wrote:

Thanks for your suggestion on this issue. In your workflow from VertexCreator Tranformer to PolygonCutter that output of VertexCreator is points, but assigned to lines of PolygonCutter. Can you help me to clear more your idea! thank you so much!

I attach my demo data in below, you can use in workflow!

Yeah I tested the input and it seems the VertexAngleCalculator doesn't work so well with polygons with holes in them. Plus I also see that the input has some intersections where the angles are pretty shallow.

Here the VertexCreator is adding in an additional point to a point making a line.


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • April 28, 2022

I had not thought of the VertexAngleCalculator to identify possible locations of cutting lines. Good idea!

Other possibilities to get the angles at the vertices are the TopologyBuilder and the Intersector transformers.


Forum|alt.badge.img+1
  • Author
  • April 29, 2022
geomancer wrote:

I had not thought of the VertexAngleCalculator to identify possible locations of cutting lines. Good idea!

Other possibilities to get the angles at the vertices are the TopologyBuilder and the Intersector transformers.

I'm trying improve the workflow base on your ideas! If you have any new idea to solve this issue, please share with me! I really appreciate your help! Thank you so much!


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • May 3, 2022
geomancer wrote:

I had not thought of the VertexAngleCalculator to identify possible locations of cutting lines. Good idea!

Other possibilities to get the angles at the vertices are the TopologyBuilder and the Intersector transformers.

I've been looking at a couple of ideas for improvement as well. They all look great with simple data, but so far they don't work with real data.

One thing I found out was that the PolygonCutter is way too slow. The best solution I found for this was to use an Intersector and an AreaBuilder, and next remove the original holes.

Split_Roads_Polygon_Drop_Holes


jennychu
Contributor
Forum|alt.badge.img+4
  • Contributor
  • May 4, 2024
geomancer wrote:

Good idea! But the challenge is probably creating the lines to use in the PolygonCutter.

I've experimented with some simple data to set up a basic workflow. There's still work to be done though!

Split_Roads_Polygon

 

hey @geomancer, I think your answer is interesting and exactly what I need! However, I met some problems during the transformer setting. Could you share your workflow/workspace with me? Thank you very much!

 

best regards,

Jenny


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • February 19, 2025

Found it, see the attachment.


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