I maintain addressing data for our county and we have to maintain the data in two standards. The 'new' NENA 911 standard, and the old legacy standard that works with our 911 CAD system. The fundamental difference between the two is that the new standard fully spells everything out and is in proper case whereas the old CAD standard uses abbreviations and is in all caps. So for instance:
Road = RD
Street = St
Alley = ALLEY
Bend = BEND
I would like to set it up so that when I populate the 'New' standard's field, it automatically translates that to the correct value for the old standard. The challenge with this is that there are over 100 possible values, and thus more than 100 translations that would need to occur. I was considering two ways. The first was an attribute rule with a very long if/else statement that translated everything. I haven't tried this yet mostly because of the tediousness of writing it as well as concerns about the performance impact of such a long attribute calculation. The second was with conditional values. I've actually been testing this but I keep getting an error.
I have a field group set up that contains both fields. I have Bend and BEND paired, but for some reason, when I actually edit the field to assign the "Bend" domain, I get an error message on the attribute window saying:
This doesn't make sense, however, because as you can see, it IS a member of that domain.
Probably something that I'm not understanding but I have yet to get it to work correctly.
All that being said, I'm hoping someone here can tell me the easiest way to accomplish this.
I do this in a python script I run on a monthly update of data that I am harvesting from three different sources, unsure if you can implement this approach either as a attribute rule or with conditional processing but you could certainly turn it into a script to run on demand. In the update cursor the 'in_fc' argument is a reference to a feature class that is defined in a line prior to the code I'm sharing here.
def ModAddr(field):
dct = {" Northeast": " NE", " Northwest": " NW"," Southeast": " SE", " Southwest": " SW",", Albuquerque, NM": "", " BL ": " BLVD ",
" Avenue ": " AV "," Boulevard ": " BLVD ", " BY ": " BYPASS ", " CI ": " CIR "," Circle ": " CIR ", " Court ": " CT ",
" Drive ": " DR ", " Freeway ": " FRWY ", " FY ": " FRWY "," Lane ": " LA ", " LP ": " LOOP ", " PY ": " PKWY ",
" Place ": " PL "," Road ": " RD ", " Street ": " ST ", " TL ": " TRL ", " Way ": " WY ", " AVE ": " AV ", " EX ": " EXT "}
for find_txt, replace_txt in dct.items():
if find_txt in field:
field = field.replace(find_txt, replace_txt)
else:
field = field
return field
with arcpy.da.UpdateCursor(in_fc,"Address") as cursor:
for addr in cursor:
addr[0] = ModAddr(addr[0])
cursor.updateRow(addr)
In your snapshot, it does not appear as if you have "Bend" and "BEND" paired, you have "BND" as the domain with "BEND" as the description. Think you want to pick "BND" to avoid that error.
R_