Create Unique ID's of a feature based on the area it is located.

1950
6
11-20-2014 01:58 PM
AlexanderPugliese
New Contributor III

Hey guys,

I am creating a map of several internet boxes in a city and I was hoping to give all of them a unique value so in the future technicians could refer to the boxes via a name or set of numbers.  There are also three different types of boxes that would need to be displayed.  There are about 4500 boxes in all.  Does anyone know of a way to create a unique identifier that can assign based on location?  For instance, all boxes within a given area would be given a name starting with A and another area would be given a name starting with B.  I understand you can run some selection related tools but I'm not sure how to give them names.

Thanks in advance!

~alex

0 Kudos
6 Replies
XanderBakker
Esri Esteemed Contributor

You can do a select by location and then use the Field Calculator:

ArcGIS Help (10.2, 10.2.1, and 10.2.2) .. to assign a code based on a combination of a character (say "A")  and a unique number (such as in the OBJECTID field).

"A_" + !OBJECTID! (python) or

"A_" & OBJECTID (VB fgdb)

0 Kudos
AlexanderPugliese
New Contributor III

Do you know of a way I could run this on a larger scale?  There is going to be about 180 polygons I would run this through so it would be nice to do it automatically.

I would also have to sort it by box type, which is a column in the attribute table.

0 Kudos
XanderBakker
Esri Esteemed Contributor

With some python code you code do this, but the easiest way is to intersect (analysis toolbox) the polygons with the points. This will yield a new point featureclass with the field of the polygons added to the output point featureclass.

What would be the influence of the box type on the output unique code?

0 Kudos
AlexanderPugliese
New Contributor III

I have a column that has three different possibilities, being the three different box types.  The intersect tool seems to work for now.  I will get back to you on that.

0 Kudos
curtvprice
MVP Esteemed Contributor

You may want to look at the Generate Fishnet tool, the boxes could then be coded using the row and column value, and your points placed in the boxes by overlay.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Curtis, Alexander indicated that he has 180 polygons which define the areas to be used for the naming. No need for the Fishnet tool. In case he wouldn't have these polygons, the Fishnet would be a good way to name (group) the boxes based on location.