<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Labeling Symbols vs Symbology - Scripting in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/labeling-symbols-vs-symbology-scripting/m-p/136762#M1570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are in the process of automating the output of our map pages.&amp;nbsp; Several questions and issues have come up along the way that we are hoping to find some answers to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We are currently using Labeling to create our annotation and symbols on our map page. (see attached example) The shown labeling was set up manually, and saved as layer files for the respective labeling.&amp;nbsp; Is there a script that would automate that process and have the labels look exactly as they are shown? Below is an example of the script being used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Setup database to work with&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = "Database Connections/gis_inquire.sde/AS.Parcels"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Create Feature Layer - all areas&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;base_layer = arcpy.MakeFeatureLayer_management("ASSESSORS.ParcelsWO") &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# From Feature Layer, select by criteria&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parcel_selection = arcpy.SelectLayerByAttribute_management(base_layer,"NEW_SELECTION","BOOK_PAGE LIKE '12345%'")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Save parcels feature layer to disk as a .lyr file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SaveToLayerFile_management(parcels_layer, "F:/Documents/Project Docs/GIS/ParcelLayer.lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Read existing mxd file (template)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("F:/Documents/Project Docs/GIS/MAP_TEMPLATE.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Get access to template's only data frame&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Read feature layers from disk&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parcellayer = arcpy.mapping.Layer(r"F:/Documents/Project Docs/GIS/ParcelLayer.lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Add my feature layers to existing template&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.AddLayer(df, parcellayer, "BOTTOM")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# apply known layer attributes to new layer (APN Markers and 1PT parcel border)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# ExportStyleLayer.lyr created from ArcMap existing map using "Save as Layer File..." - hoping to get font styles from here&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;updateLayer = arcpy.mapping.ListLayers(mxd, parcellayer.name, df)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sourceLayer = arcpy.mapping.Layer(r"F:/Documents/Project Docs/GIS/ExportStyleLayer.lyr") # a layer that represents look/labels etc that we want. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.UpdateLayer(df, updateLayer, sourceLayer, False) # OnlySymbology=False (want all attributes of the known layer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# change datasource?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#updateLayer.replaceDataSource(?, ?, ?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The process of using the symbology vs labeling was brought up, is there a preferred/better way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any insight or help is always appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2012 19:14:10 GMT</pubDate>
    <dc:creator>GavinMayeda</dc:creator>
    <dc:date>2012-09-19T19:14:10Z</dc:date>
    <item>
      <title>Labeling Symbols vs Symbology - Scripting</title>
      <link>https://community.esri.com/t5/mapping-questions/labeling-symbols-vs-symbology-scripting/m-p/136762#M1570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are in the process of automating the output of our map pages.&amp;nbsp; Several questions and issues have come up along the way that we are hoping to find some answers to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We are currently using Labeling to create our annotation and symbols on our map page. (see attached example) The shown labeling was set up manually, and saved as layer files for the respective labeling.&amp;nbsp; Is there a script that would automate that process and have the labels look exactly as they are shown? Below is an example of the script being used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Setup database to work with&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = "Database Connections/gis_inquire.sde/AS.Parcels"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Create Feature Layer - all areas&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;base_layer = arcpy.MakeFeatureLayer_management("ASSESSORS.ParcelsWO") &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# From Feature Layer, select by criteria&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parcel_selection = arcpy.SelectLayerByAttribute_management(base_layer,"NEW_SELECTION","BOOK_PAGE LIKE '12345%'")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Save parcels feature layer to disk as a .lyr file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SaveToLayerFile_management(parcels_layer, "F:/Documents/Project Docs/GIS/ParcelLayer.lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Read existing mxd file (template)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("F:/Documents/Project Docs/GIS/MAP_TEMPLATE.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Get access to template's only data frame&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Read feature layers from disk&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;parcellayer = arcpy.mapping.Layer(r"F:/Documents/Project Docs/GIS/ParcelLayer.lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Add my feature layers to existing template&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.AddLayer(df, parcellayer, "BOTTOM")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# apply known layer attributes to new layer (APN Markers and 1PT parcel border)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# ExportStyleLayer.lyr created from ArcMap existing map using "Save as Layer File..." - hoping to get font styles from here&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;updateLayer = arcpy.mapping.ListLayers(mxd, parcellayer.name, df)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sourceLayer = arcpy.mapping.Layer(r"F:/Documents/Project Docs/GIS/ExportStyleLayer.lyr") # a layer that represents look/labels etc that we want. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.UpdateLayer(df, updateLayer, sourceLayer, False) # OnlySymbology=False (want all attributes of the known layer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# change datasource?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#updateLayer.replaceDataSource(?, ?, ?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The process of using the symbology vs labeling was brought up, is there a preferred/better way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any insight or help is always appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2012 19:14:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/labeling-symbols-vs-symbology-scripting/m-p/136762#M1570</guid>
      <dc:creator>GavinMayeda</dc:creator>
      <dc:date>2012-09-19T19:14:10Z</dc:date>
    </item>
  </channel>
</rss>

