Skip to main content
Solved

Assign street codes - spatial order


lambertus
Enthusiast
Forum|alt.badge.img+12

I have a dataset with 3000 polygons represting streets. Each street is divided into subparts and need a unique code to be assgined. The first part refers to the streetname and is the same for each subpart, 2nd part is a unique counter.

Image below shows my current (top) and wanted situation (bottom part).

Any support is appreciated! 

 

Best answer by s.jager

Is that orange line that you show in your first screenshot a real geometry? If so, you could use the MeasureGenerator and the LineOnAreaOverlayer to get the Measures on to the polygons. Then that gives you at least the order for the polygons, on which you can sort them. And then giving them a sequential number is easy, that would be just a counter.

Not tested this approach, but I think using dynamic segmentation you can get what you are looking for. Alternatively you could try playing with the LeftRightSpatialCalculator, but I’m not sure that’ll give you what you want.

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

4 replies

hvukasinovic
Contributor
Forum|alt.badge.img+13

Potentially, you can use combination of SpatialSorter and Counter (groupBy: Street Name). However, this might not work exactly as you expect it. Specifically, consecutive numbers might not always be assigned to adjacent street parts.


lambertus
Enthusiast
Forum|alt.badge.img+12
  • Author
  • Enthusiast
  • July 24, 2024

@hvukasinovic thanks for your response! I tested the approach 5 min ago and the results are interesting but not good enough at the moment. The output of the SpatialSorter shows the 2nd street part as the 1st record in the table, thats not correct. It should be the first.

 

 


s.jager
Influencer
Forum|alt.badge.img+16
  • Influencer
  • Best Answer
  • July 25, 2024

Is that orange line that you show in your first screenshot a real geometry? If so, you could use the MeasureGenerator and the LineOnAreaOverlayer to get the Measures on to the polygons. Then that gives you at least the order for the polygons, on which you can sort them. And then giving them a sequential number is easy, that would be just a counter.

Not tested this approach, but I think using dynamic segmentation you can get what you are looking for. Alternatively you could try playing with the LeftRightSpatialCalculator, but I’m not sure that’ll give you what you want.


lambertus
Enthusiast
Forum|alt.badge.img+12
  • Author
  • Enthusiast
  • August 30, 2024

@s.jager thanks for your reply, sounds good! I will give it a try once I am back on the project. For now we used a Python solution to get the job done.


Reply


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