How can calculate width of polygon in case rivers or roads?
I have a road data and I need to know how minimum width of each segment of roads. I tried with some steps such as below:
- First: from road polygon I generate centerline by CenterLineReplacer Transformer
- After that: I used Chopper Transformer to chopped the Centerline into segments with mode "by vertex".
- Next: I rotate all vertex with 90 degree and I extend line with a length (my problem is here). With road data which have more branch, and each branch have width difference, some case the range between minimum and maximum is so big (e.g. minimum is 0.5 met but maximum is 200 m). So when set the length parameter it not right for all branch.
- Next: I used Clipper to clip this line with polygon
- Finally: I calculated length of lines and this value mean are width of polygon.
That all I understood and tried to calculate width of polygon. Because the length which set in The extend line step is not really right for all branch so the result like this image bellow:
This case has many cross lines from other branch, so I don't have ideas to filter all cross lines.
If you have ideas to solve this issue, let's show me! Thank you so much!