Solved

Assign ID in order

  • 6 August 2015
  • 2 replies
  • 6 views

Badge

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
icon

Best answer by pratap 6 August 2015, 13:29

View original

2 replies

Badge +2
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
Badge
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.

Reply