Skip to main content
Solved

Assign ID in order

  • August 6, 2015
  • 2 replies
  • 40 views

Forum|alt.badge.img

Hi All,

 

 

Hopefully this is a quick question. Basically I have a bunch of 8 polygons, with no attributes. Basically I want to add a ID to each of these, but taking into account their location to each other. I.e. ID 1 should be next to ID 2 etc, similar to the image I mocked up below.

 

 

The Counter just randomly assigns an ID, but not in order. Similar with the GOIDGenerator.

 

 

The only other thing I have that links the polygons is a line feature, also seen in the image, which either Crosses or Touches each polygon. This line is orientated running from North to South, however in other instances this could be any orientation, so I can't try and extract centre points etc from polygons.

 

 

 

 

 

I'm almost certain I don'e something like this before, but can't remember how, and it has me stumped!

 

 

Cheers,

 

Tony

Best answer by pratap

Just a trail,

 

1. By considering the start point of line (as reference) as candidate in NeighborFinder and base as centroid point of each polygons will give as the relative distance from the reference point.

 

2. Sort the distance and assign the ID in required format

 

 

Pratap
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

pratap
Contributor
Forum|alt.badge.img+12
  • Contributor
  • Best Answer
  • August 6, 2015
Just a trail,

 

1. By considering the start point of line (as reference) as candidate in NeighborFinder and base as centroid point of each polygons will give as the relative distance from the reference point.

 

2. Sort the distance and assign the ID in required format

 

 

Pratap

Forum|alt.badge.img
  • Author
  • August 6, 2015
Nice one, works out almost perfect! I had been playing around with the NeighborFinder, but was incorrectly using the start point as the Base and didn't spot what was wrong. Thanks Pratap.