I have a road allowance that I have divided into multiple sections. I need to number these polygons from one end of the road, to the other, in sequence. When I use the counter and group by road_id, it seems to move from top to bottom in numbering, so if a road curves or is circular, the polygons get numbered out of sequence through the curved area. Is there a way to keep these polygons numbered in sequence even through a highway ramp or a curved street? Any suggestions as to how I can assign numbers to these polygons and keep them in order from start of road to end of road?
There are points that I need to know if the driver has driven by, so I am selecting the roads that the points are on, buffering them by 500m, dissolving by the id of the point and then using the BoundsSplitter custom transformer to divide up the roads into segments. The breadcrumbs that are dropped are sporadic so I need to use these sequenced polygons to see if a driver has passed the point and in which direction.
At first I had the purple roads example (attached). My coworker has helped with some of the logic, so that the counter occurs after the BoundsSplitter so the sequence is less sporadic. But, as in the attached example (green roads attached), a circular road will number based on the bounds that were dividing the polygons.
Workspace clipping attached.
@aliciadmallette
1
The offending circular arranged objects can be ordened by (for instance) extracting centerpoint of the aggregate of the objects.
Merge unconditionally to the centers of the objects.
Create line and use azimuth calculator.
Or if you have base math you can calculate angel without creating line.
Order objects by angle and then use a counter.
2
Other method is dissolve the objects and create boundingbox. Coerce to line.
With centerpoints of objects find nearest candidate on BB line (use half diameter of bb). Add vertex. Intersect.
Create topology off (cut) border.
Vertices are now ordered.
The picture is done with the second method.
Both will of course fail if you "circularily" arranged objects have severe switchbacks, snakes a lot to and fro etc.
On your example it works.