Select to view content in your preferred language

Creating unique logical IDS

1724
3
07-10-2012 05:59 AM
LaurenYee
Regular Contributor
Hi there,

I've been tasked with creating unique IDs for a street light layer for a municipality, the client wants the unique IDs to be logical and sequential.
I've found scripts on how to make IDs with python based on FIDs, but this won't work in my case.
For example, I'd like to have sequential IDs for street lights that are on the same street (close to eachother) rather than having streetlight #1 be in the East corner of the map and streetlight # 2 being at an opposite corner.

So far I've created X and Y fields, but it still isn't AS logical as I'd like.

Does anyone know of a script I can use in Field Calculator that would work for something like this, or does more geoprocessing have to be done?

Thanks
Tags (2)
0 Kudos
3 Replies
curtvprice
MVP Alum
I've been tasked with creating unique IDs for a street light layer for a municipality, the client wants the unique IDs to be logical and sequential.


"Smart" unique unique feature ids are generally frowned upon in a database design. They seem like a good idea at the time, but the more used a database is, the more pain they can create. Imagine you have the streetlight sequential going down the street and then a streetlight is added  in between 003 and 004 -- there you are, your nice setup is immediately broken. It's far better to have unique IDs and have other fields carry that kind of information like labels that sequence the lights going down the street.

This is your client, though!

There are many ways to approach this issue of sorting them going down the street. For example, you may be able to order ids along a set of streets going in the same direction by doing a NEAR to a point at one end and sorting by distance. You also may want to look into dynamic segmentation to address the points to locations along routes.
0 Kudos
LaurenYee
Regular Contributor
"Smart" unique unique feature ids are generally frowned upon in a database design. They seem like a good idea at the time, but the more used a database is, the more pain they can create. Imagine you have the streetlight sequential going down the street and then a streetlight is added  in between 003 and 004 -- there you are, your nice setup is immediately broken. It's far better to have unique IDs and have other fields carry that kind of information like labels that sequence the lights going down the street.



Yeah, the idea for adding new streetlights would be to then start attaching letters to end of the number, which is simple enough I suppose.
The only reason they want unique IDs is to organize and keep track of fixes, it won't be related to any other databases.

I already have address fields established to the poles, but this is what the client wants. I'm surprised ESRI hasn't made this process easier?
0 Kudos
curtvprice
MVP Alum
it won't be related to any other databases.


That's what they always say. :cool:
0 Kudos