2

I am performing a union on a polygon feature class with multiple overlapping polygons. Each of the records in the resulting feature class can be thought of as "unique area" polygons made up of the various combinations of other polygons.

In my results I want each "unique area" record to contain the names of all the polygons that make it up, and I want those names listed alphabetically.

For example: enter image description here Ideal Resulting Table:

enter image description here

So far I have been able to do the union and then do a spatial join back to the original feature class and in the field map of the Spatial Join tool make the merge rule "Join" for attribute I want to concatenate (and indicate a delimiter). This gives me results like the following:

enter image description here

I can use .split(",") to divide this into separate fields. My question is: how can I sort that Polys field so that those polygons are in alphabetical order?

2

Based on where you are, use the field calculator. Select Python as the parser and then in the formula block, put:

','.join([Polys].split(',').sort())

Note that if you are using a personal or file geodatabase, you would need to put !Polys!.

However, there are simpler alternatives if you wish to do the whole thing from the beginning again.

  • Thank you, I will try this. I would be interested in the simpler alternatives. I attempted to ask about them a while back in this question and did not get much response: gis.stackexchange.com/questions/107129/… – MMB Jun 24 '15 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.