auto-increment x,y fields with alphanumeric ID

4168
11
11-16-2015 01:56 PM
ErinRichmond
New Contributor II

I have a shapfile that contains a grid of points and I want to assign each point a unique alphanumeric ID so that latitude is the "alpha" part of the ID and longitude is the "numeric" part of the ID. Can anyone remind me how to do this using the field ArcGIS field calculator? Thanks!

Tags (2)
0 Kudos
11 Replies
FreddieGibson
Regular Contributor II

Could you provide an example of what the resulting lat/long would look like?

0 Kudos
ErinRichmond
New Contributor II

I have a 'YID' and 'XID' column in my attribute table. I want those columns to contain the values: AA, AB, AC, etc... and 01-99, respectively. I will then concatenate the YID and XID columns for the unique alpha-numeric ID (ex: AA01). Does that make sense? Thanks for the help!

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

This is confusing,  if you plan to concatenate, longitude and latitude together, you will have to put the results in a text (string) field

0 Kudos
ErinRichmond
New Contributor II

I all ready have lat/long coordinates calculated and want to keep them as they are in separate fields (no concatenating). I need to then calculate 2 new fields (YID, XID) that just contain the alpha and numeric values that I will then concatenate for the alphanumeric value.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

So how do you assign AA,AB etc and 00, 01 etc? is it based upon a lexicographic sort of the coordinates? is it based on its location in a fishnet? Create Fishnet—Help | ArcGIS for Desktop

ErinRichmond
New Contributor II

That's what I'm trying to figure out, how to assign the alphanumeric values...

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Xander Bakker​ provided some code for labelling the results of a fishnet (previous link)

Re: Create fishnet with row iterator - why does extent not update?

which you could use in a spatial join to get the labels over to the points.

Alternately, I gave an example of how to produce a lexicographic sort of points based on X,Y coordinates which you could then label using a scheme of some sort... NumPy Snippets # 5... Sorting and ranking... arcpy and numpy play nice...

There are obviously other solutions, which could be improved upon, if your intent for providing the labelling were elaborated on.

LukeSturtevant
Occasional Contributor III

As Dan asked, we really need to know if you are trying to assign unique id's based on groups. Say if you have 2 polygons in a fishnet and each have a group of points inside each polygon. Would you want the IDs to be something like this:

fishnet polygon 1 point id increment:  AA01, AA02... etc.

fishnet polygon 2 point id increment: AB01, AB02...etc

Or are you just looking to assign a unique id for every individual point?

0 Kudos
LukeSturtevant
Occasional Contributor III

Could you maybe give us a quick screen grab of an excel sheet that has all the fields you have fully populated as you would like to see them? Maybe a completed example like that will give a better idea of what you are shooting for here.

0 Kudos