Generate ID based on road name

698
4
05-15-2017 11:35 AM
JasonGraham1
New Contributor

I'm very new to the world of GIS, so forgive me if this is easier than I'm making it out to be.  I would like to generate an ID attribute from road segment data.  The attributes for each road segment include the road name, so I will like to generate an ID with a prefix based on the name.  For example, if Main Street has 10 segments I would like the new IDs to read 01-001, 01-002, 01-003, etc. where the 01 prefix is based on the road name and the last 3 digits are the segment numbers.  If there are 50 different road names the prefixes would need to be 01 to 50.  Is this possible with my limited experience?

0 Kudos
4 Replies
DanPatterson_Retired
MVP Esteemed Contributor

can be done... but you need

  • a list or dictionary of roads that equate to sequential numbers (ie 01 is main street, 02 is first streed, 03 is dunno street, etc)
  • the number of segments per road.  If this isn't known, then the road has to be split into sections since you can't rely on vertices to indicate a section

once you can provide that something could be cobbled together script wise I am sure.

0 Kudos
JasonGraham1
New Contributor

Thank you, Dan.  I would have to create the dictionary for the prefixes.  The roads are already broken into segments in the data I'm dealing with, but I don't know how many segments for each road.  And there are about 3,000 segments in all.

The idea is to sort and group some additional data being gathered for each segment by the prefix (road).  It may be easier just to do this by the road name rather some elaborate ID.  The new data being generated will include some  information from the existing database such as the road name for each segment.

0 Kudos
BlakeTerhune
MVP Regular Contributor

You could dissolve the streets to get a list of unique names and number (enumerate) it to build a dictionary. Alternatively, if you're on an enterprise geodatabase, you could use SQL to get a distinct list of street names and include a row number.

0 Kudos
JoeBorgione
MVP Esteemed Contributor

How will this identifier be used?  What about concatenating the name and the address ranges (if you have them).  At least with such an approach mere mortals would at least have half a chance to know what the segment the ID refers to...

MAINST100200101199 for the 100 block of main st....

can't wait to retire....
0 Kudos