- a polygon shapefile/feature class (FC) containing municipal districts
- a point shapefile/FC containing locations of, lets say, trees.
My goal is to append an unique value (1, 2, 3, ...) to the point shapefile/FC which is:
- sorted from north to south (or vice versa)
- and sorted/grouped by the municipal districts (the priority of sorting lies on the municipal districts)
I managed to solve 1. by generating y-coordinates for each point and than running this script which calculates and sorts unique values by means of the the y-coordinate column:
However, I do not know how to solve 2. Finally my map should look like this (the numbers in red are the ones I'd like to calculate instead):