Converting full road names to abbreviation using ArcGIS field calculator?
Clash Royale CLAN TAG#URR8PPP
I have a data table with a column 'names' that have street names with street type (Road, Lane, Street etc.). I need to get the names in a format like in column 'new_names'using field calculator in ArcGIS.
How can I do this?
arcgis-desktop field-calculator python-parser address dictionary
add a comment |
I have a data table with a column 'names' that have street names with street type (Road, Lane, Street etc.). I need to get the names in a format like in column 'new_names'using field calculator in ArcGIS.
How can I do this?
arcgis-desktop field-calculator python-parser address dictionary
add a comment |
I have a data table with a column 'names' that have street names with street type (Road, Lane, Street etc.). I need to get the names in a format like in column 'new_names'using field calculator in ArcGIS.
How can I do this?
arcgis-desktop field-calculator python-parser address dictionary
I have a data table with a column 'names' that have street names with street type (Road, Lane, Street etc.). I need to get the names in a format like in column 'new_names'using field calculator in ArcGIS.
How can I do this?
arcgis-desktop field-calculator python-parser address dictionary
arcgis-desktop field-calculator python-parser address dictionary
edited Dec 17 at 13:14
Vince
14.4k32647
14.4k32647
asked Dec 17 at 7:46
Roman Perkhaliuk
807
807
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Use a dictionary and if/else with list comprehension to replace the words:
Pre-logic:
def replacename( names, new_names):
d = 'Lane':'Ln', 'Road':'Rd', 'Street':'St'
return ' '.join([d[word] if word in d else word for word in names.split()])
Call with:
replacename( !names!, !new_names!)
add a comment |
If you only want to use the abbreviations for labelling then you could investigate Using an abbreviation dictionary and the About abbreviating and truncating words page:
Abbreviation dictionaries allow the Maplex Label Engine to shorten
long labels to fit within small spaces. When you use an abbreviation
dictionary, the Maplex Label Engine first attempts to place the full
text of the label, then abbreviates any words found in the dictionary
for labels that could not be placed.
Abbreviation dictionaries are applied to individual label classes. The
abbreviation is applied to a freestanding word or groups of words, not
parts of words, with the exception of certain non-English words.
Individual words, such as Road and Street, can be abbreviated as Rd or
St, or longer strings, such as Post Office, can be abbreviated as PO.
Portions of words are not abbreviated. For example, if you have a
dictionary entry mapping Road as Rd, the label Roadrunner Road is
abbreviated as Roadrunner Rd, not Rdrunner Rd. Labels containing text
formatting tags are not abbreviated by the Maplex Label Engine.
Thank you for an answer. Maplex Label Engine - works badly when exporting in Illustrator (that's my stage two).
– Roman Perkhaliuk
Dec 17 at 8:23
add a comment |
Don't know a way to this through ArcMap whithout using python. But you can do it through excel. Use Table to Excel tool, then in excel use Find and Replace. And in arcmap join the excel back to the original table. If you don't have excel you can export the table to csv using Export Feature Attribute to ASCII tool, and then use OpenOffice.
There's already a python solution and the asker didin't preferred python solution (but the comment is deleted by now).
– RistoYlem
Dec 17 at 9:38
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f306219%2fconverting-full-road-names-to-abbreviation-using-arcgis-field-calculator%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use a dictionary and if/else with list comprehension to replace the words:
Pre-logic:
def replacename( names, new_names):
d = 'Lane':'Ln', 'Road':'Rd', 'Street':'St'
return ' '.join([d[word] if word in d else word for word in names.split()])
Call with:
replacename( !names!, !new_names!)
add a comment |
Use a dictionary and if/else with list comprehension to replace the words:
Pre-logic:
def replacename( names, new_names):
d = 'Lane':'Ln', 'Road':'Rd', 'Street':'St'
return ' '.join([d[word] if word in d else word for word in names.split()])
Call with:
replacename( !names!, !new_names!)
add a comment |
Use a dictionary and if/else with list comprehension to replace the words:
Pre-logic:
def replacename( names, new_names):
d = 'Lane':'Ln', 'Road':'Rd', 'Street':'St'
return ' '.join([d[word] if word in d else word for word in names.split()])
Call with:
replacename( !names!, !new_names!)
Use a dictionary and if/else with list comprehension to replace the words:
Pre-logic:
def replacename( names, new_names):
d = 'Lane':'Ln', 'Road':'Rd', 'Street':'St'
return ' '.join([d[word] if word in d else word for word in names.split()])
Call with:
replacename( !names!, !new_names!)
edited Dec 18 at 17:44
answered Dec 17 at 7:59
BERA
14.5k51940
14.5k51940
add a comment |
add a comment |
If you only want to use the abbreviations for labelling then you could investigate Using an abbreviation dictionary and the About abbreviating and truncating words page:
Abbreviation dictionaries allow the Maplex Label Engine to shorten
long labels to fit within small spaces. When you use an abbreviation
dictionary, the Maplex Label Engine first attempts to place the full
text of the label, then abbreviates any words found in the dictionary
for labels that could not be placed.
Abbreviation dictionaries are applied to individual label classes. The
abbreviation is applied to a freestanding word or groups of words, not
parts of words, with the exception of certain non-English words.
Individual words, such as Road and Street, can be abbreviated as Rd or
St, or longer strings, such as Post Office, can be abbreviated as PO.
Portions of words are not abbreviated. For example, if you have a
dictionary entry mapping Road as Rd, the label Roadrunner Road is
abbreviated as Roadrunner Rd, not Rdrunner Rd. Labels containing text
formatting tags are not abbreviated by the Maplex Label Engine.
Thank you for an answer. Maplex Label Engine - works badly when exporting in Illustrator (that's my stage two).
– Roman Perkhaliuk
Dec 17 at 8:23
add a comment |
If you only want to use the abbreviations for labelling then you could investigate Using an abbreviation dictionary and the About abbreviating and truncating words page:
Abbreviation dictionaries allow the Maplex Label Engine to shorten
long labels to fit within small spaces. When you use an abbreviation
dictionary, the Maplex Label Engine first attempts to place the full
text of the label, then abbreviates any words found in the dictionary
for labels that could not be placed.
Abbreviation dictionaries are applied to individual label classes. The
abbreviation is applied to a freestanding word or groups of words, not
parts of words, with the exception of certain non-English words.
Individual words, such as Road and Street, can be abbreviated as Rd or
St, or longer strings, such as Post Office, can be abbreviated as PO.
Portions of words are not abbreviated. For example, if you have a
dictionary entry mapping Road as Rd, the label Roadrunner Road is
abbreviated as Roadrunner Rd, not Rdrunner Rd. Labels containing text
formatting tags are not abbreviated by the Maplex Label Engine.
Thank you for an answer. Maplex Label Engine - works badly when exporting in Illustrator (that's my stage two).
– Roman Perkhaliuk
Dec 17 at 8:23
add a comment |
If you only want to use the abbreviations for labelling then you could investigate Using an abbreviation dictionary and the About abbreviating and truncating words page:
Abbreviation dictionaries allow the Maplex Label Engine to shorten
long labels to fit within small spaces. When you use an abbreviation
dictionary, the Maplex Label Engine first attempts to place the full
text of the label, then abbreviates any words found in the dictionary
for labels that could not be placed.
Abbreviation dictionaries are applied to individual label classes. The
abbreviation is applied to a freestanding word or groups of words, not
parts of words, with the exception of certain non-English words.
Individual words, such as Road and Street, can be abbreviated as Rd or
St, or longer strings, such as Post Office, can be abbreviated as PO.
Portions of words are not abbreviated. For example, if you have a
dictionary entry mapping Road as Rd, the label Roadrunner Road is
abbreviated as Roadrunner Rd, not Rdrunner Rd. Labels containing text
formatting tags are not abbreviated by the Maplex Label Engine.
If you only want to use the abbreviations for labelling then you could investigate Using an abbreviation dictionary and the About abbreviating and truncating words page:
Abbreviation dictionaries allow the Maplex Label Engine to shorten
long labels to fit within small spaces. When you use an abbreviation
dictionary, the Maplex Label Engine first attempts to place the full
text of the label, then abbreviates any words found in the dictionary
for labels that could not be placed.
Abbreviation dictionaries are applied to individual label classes. The
abbreviation is applied to a freestanding word or groups of words, not
parts of words, with the exception of certain non-English words.
Individual words, such as Road and Street, can be abbreviated as Rd or
St, or longer strings, such as Post Office, can be abbreviated as PO.
Portions of words are not abbreviated. For example, if you have a
dictionary entry mapping Road as Rd, the label Roadrunner Road is
abbreviated as Roadrunner Rd, not Rdrunner Rd. Labels containing text
formatting tags are not abbreviated by the Maplex Label Engine.
answered Dec 17 at 8:06
PolyGeo♦
53.2k1779238
53.2k1779238
Thank you for an answer. Maplex Label Engine - works badly when exporting in Illustrator (that's my stage two).
– Roman Perkhaliuk
Dec 17 at 8:23
add a comment |
Thank you for an answer. Maplex Label Engine - works badly when exporting in Illustrator (that's my stage two).
– Roman Perkhaliuk
Dec 17 at 8:23
Thank you for an answer. Maplex Label Engine - works badly when exporting in Illustrator (that's my stage two).
– Roman Perkhaliuk
Dec 17 at 8:23
Thank you for an answer. Maplex Label Engine - works badly when exporting in Illustrator (that's my stage two).
– Roman Perkhaliuk
Dec 17 at 8:23
add a comment |
Don't know a way to this through ArcMap whithout using python. But you can do it through excel. Use Table to Excel tool, then in excel use Find and Replace. And in arcmap join the excel back to the original table. If you don't have excel you can export the table to csv using Export Feature Attribute to ASCII tool, and then use OpenOffice.
There's already a python solution and the asker didin't preferred python solution (but the comment is deleted by now).
– RistoYlem
Dec 17 at 9:38
add a comment |
Don't know a way to this through ArcMap whithout using python. But you can do it through excel. Use Table to Excel tool, then in excel use Find and Replace. And in arcmap join the excel back to the original table. If you don't have excel you can export the table to csv using Export Feature Attribute to ASCII tool, and then use OpenOffice.
There's already a python solution and the asker didin't preferred python solution (but the comment is deleted by now).
– RistoYlem
Dec 17 at 9:38
add a comment |
Don't know a way to this through ArcMap whithout using python. But you can do it through excel. Use Table to Excel tool, then in excel use Find and Replace. And in arcmap join the excel back to the original table. If you don't have excel you can export the table to csv using Export Feature Attribute to ASCII tool, and then use OpenOffice.
Don't know a way to this through ArcMap whithout using python. But you can do it through excel. Use Table to Excel tool, then in excel use Find and Replace. And in arcmap join the excel back to the original table. If you don't have excel you can export the table to csv using Export Feature Attribute to ASCII tool, and then use OpenOffice.
answered Dec 17 at 8:10
RistoYlem
924
924
There's already a python solution and the asker didin't preferred python solution (but the comment is deleted by now).
– RistoYlem
Dec 17 at 9:38
add a comment |
There's already a python solution and the asker didin't preferred python solution (but the comment is deleted by now).
– RistoYlem
Dec 17 at 9:38
There's already a python solution and the asker didin't preferred python solution (but the comment is deleted by now).
– RistoYlem
Dec 17 at 9:38
There's already a python solution and the asker didin't preferred python solution (but the comment is deleted by now).
– RistoYlem
Dec 17 at 9:38
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f306219%2fconverting-full-road-names-to-abbreviation-using-arcgis-field-calculator%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown