<?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 Selective Labeling in Data-Driven pages based on data frame extension in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18604#M233</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been working with Data Driven pages that show an overview map for the selected index layer feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, under the index feature layer I need to show the boundaries of municipalities (polygons) as well as a point feature indicating their urban area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to label both feature classes and that's where the challenge arises:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1 - When the point feature is labelled, the polygon feature should not get its label;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2 - If the point feature is not within the data frame extension (thus not labelled), the polygon feature gets its label;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3 - Each polygon feature has a corresponding point feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm attaching an image to make it clearer. I need to automate the process, as I'm using Data Driven pages.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it do-able with scripting? Is there any easier way for doing that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]30007[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Dec 2013 11:40:02 GMT</pubDate>
    <dc:creator>MateusRomanholi</dc:creator>
    <dc:date>2013-12-19T11:40:02Z</dc:date>
    <item>
      <title>Selective Labeling in Data-Driven pages based on data frame extension</title>
      <link>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18604#M233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been working with Data Driven pages that show an overview map for the selected index layer feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, under the index feature layer I need to show the boundaries of municipalities (polygons) as well as a point feature indicating their urban area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to label both feature classes and that's where the challenge arises:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1 - When the point feature is labelled, the polygon feature should not get its label;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2 - If the point feature is not within the data frame extension (thus not labelled), the polygon feature gets its label;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3 - Each polygon feature has a corresponding point feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm attaching an image to make it clearer. I need to automate the process, as I'm using Data Driven pages.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it do-able with scripting? Is there any easier way for doing that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]30007[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 11:40:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18604#M233</guid>
      <dc:creator>MateusRomanholi</dc:creator>
      <dc:date>2013-12-19T11:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Selective Labeling in Data-Driven pages based on data frame extension</title>
      <link>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18605#M234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could add attributes to the index features and use that to drive which layer to label. I.e. add a yes/no "LabelPoints" field and then add something like the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# untested, ~psuedo code
rows = arcpy.SearchCursor(indexGridLayer, "{0} = '{1}'".format(arcpy.addFieldDelimeters(indexGridLayer,"PageName"), currentPageName)
for row in rows:
&amp;nbsp; if row.getValue("LabelPoints") == "yes":
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointsLayer.showLabels = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygonsLayer.showLabels = False
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointsLayer.showLabels = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygonsLayer.showLabels = True
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This does add a little maintenance to the process, as you need to review that the attribute is correct periodically, but if things don't change much, that's probably not a big deal. With that added maintenance, I'm not sure if this is the &lt;/SPAN&gt;&lt;STRONG style="font-style: italic;"&gt;best&lt;/STRONG&gt;&lt;SPAN&gt; solution but it is &lt;/SPAN&gt;&lt;STRONG style="font-style: italic;"&gt;a&lt;/STRONG&gt;&lt;SPAN&gt; solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:44:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18605#M234</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2021-12-10T20:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Selective Labeling in Data-Driven pages based on data frame extension</title>
      <link>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18606#M235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You could add attributes to the index features and use that to drive which layer to label. I.e. add a yes/no "LabelPoints" field and then add something like the following:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# untested, ~psuedo code
rows = arcpy.SearchCursor(indexGridLayer, "{0} = '{1}'".format(arcpy.addFieldDelimeters(indexGridLayer,"PageName"), currentPageName)
for row in rows:
&amp;nbsp; if row.getValue("LabelPoints") == "yes":
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointsLayer.showLabels = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygonsLayer.showLabels = False
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointsLayer.showLabels = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygonsLayer.showLabels = True
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;This does add a little maintenance to the process, as you need to review that the attribute is correct periodically, but if things don't change much, that's probably not a big deal. With that added maintenance, I'm not sure if this is the &lt;STRONG style="font-style: italic;"&gt;best&lt;/STRONG&gt; solution but it is &lt;STRONG style="font-style: italic;"&gt;a&lt;/STRONG&gt; solution.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, msayler, I really thank you for your answer!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know almost nothing about coding, so I apologize if the following questions seem too dumb:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Does this code you provided allow some point and some polygon features to be labelled at the same time (at the same page)? I need both features to be labelled, the preference being for point features over polygon features when features that have the same attributes (one being point and the other being polygon) occur within the data frame.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Where in ArcMap should I insert the code, so it executes every time I change data-driven pages?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:44:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18606#M235</guid>
      <dc:creator>MateusRomanholi</dc:creator>
      <dc:date>2021-12-10T20:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Selective Labeling in Data-Driven pages based on data frame extension</title>
      <link>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18607#M236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello, msayler, I really thank you for your answer!&lt;BR /&gt;&lt;BR /&gt;I know almost nothing about coding, so I apologize if the following questions seem too dumb:&lt;BR /&gt;&lt;BR /&gt;- Does this code you provided allow some point and some polygon features to be labelled at the same time (at the same page)? I need both features to be labelled, the preference being for point features over polygon features when features that have the same attributes (one being point and the other being polygon) occur within the data frame.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you refering to label weighting? i.e. if the two labels are in conflict, show the one for the point? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;- Where in ArcMap should I insert the code, so it executes every time I change data-driven pages?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That example is just a snippet of pseudo code. It would have to be either set up as part of a script tool that generates the maps outside of an ArcMap session (i.e. exports to a pdf mapbook), OR if you want to work in a live session, you'd probably want custom add-in tools (or copy and paste into the python window, but that's not as user-friendly). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Either way, you're looking at investing some time in learning python or finding someone who can build it for you (unfortunately, I just don't have the time to put the whole thing together). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you do a lot of this sort of custom mapbook work and if you can make the time, I would highly recommend learning python. Even just a foundation in the basics can be pretty liberating.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 16:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18607#M236</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2014-01-09T16:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Selective Labeling in Data-Driven pages based on data frame extension</title>
      <link>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18608#M237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;mslayer, I followed your advice and started learning Python this week!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Today I was able to come up with a script that does exactly what I want!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, the workflow I created is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Loop through each Data Driven Page&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Create a temporary polygon from the data frame extension&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Select the point features that intersect that polygon&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Run a cursor through the selected point features and store their attribute values in a list&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. Set an SQL Query in the label class of the polygon features so as not to label the values stored in the list&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6. Print the map to PDF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Despite all the time I spent debugging, it was really good to see everything work in the end! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 20:27:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18608#M237</guid>
      <dc:creator>MateusRomanholi</dc:creator>
      <dc:date>2014-01-16T20:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Selective Labeling in Data-Driven pages based on data frame extension</title>
      <link>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18609#M238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Congratulations! Whole new world now, isn't it? &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 14:52:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18609#M238</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2014-01-24T14:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Selective Labeling in Data-Driven pages based on data frame extension</title>
      <link>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18610#M239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Congratulations! Whole new world now, isn't it? &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sure! Liberating indeed! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Feb 2014 19:46:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/selective-labeling-in-data-driven-pages-based-on/m-p/18610#M239</guid>
      <dc:creator>MateusRomanholi</dc:creator>
      <dc:date>2014-02-01T19:46:29Z</dc:date>
    </item>
  </channel>
</rss>

