<?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 Re: Getting Data Driven Pages to scale raster symbology from each page's current exte in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741149#M7985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure what you mean by "rasters do not scale to the current display extent".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the rasters are symbolized with a raster classified renderer you may be able to call .Refresh() to get what you want.&amp;nbsp; Take a look at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/#/RasterClassifiedSymbology/00s30000005p000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/#/RasterClassifiedSymbology/00s30000005p000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Feb 2013 15:21:59 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2013-02-06T15:21:59Z</dc:date>
    <item>
      <title>Getting Data Driven Pages to scale raster symbology from each page's current extent</title>
      <link>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741148#M7984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm generating a country-wide atlas at the (U.S. equivalent) county level.&amp;nbsp; I'm auto-clipping the raster coverages to each county-equivalent.&amp;nbsp; All is fine and good, &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;except &lt;/SPAN&gt;&lt;SPAN&gt;that the rasters do not scale to the current display extent unless I go to layer propertieson each individual layer.&amp;nbsp; That's not a practical solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, is there a python script that will both recalculate the stretch for every data page and then export each page as an appropriately named PDF file?&amp;nbsp; Or is there an ESRI patch that will address this refresh issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 14:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741148#M7984</guid>
      <dc:creator>JeffOlsenholler</dc:creator>
      <dc:date>2013-02-05T14:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data Driven Pages to scale raster symbology from each page's current exte</title>
      <link>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741149#M7985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure what you mean by "rasters do not scale to the current display extent".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the rasters are symbolized with a raster classified renderer you may be able to call .Refresh() to get what you want.&amp;nbsp; Take a look at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/#/RasterClassifiedSymbology/00s30000005p000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/#/RasterClassifiedSymbology/00s30000005p000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 15:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741149#M7985</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2013-02-06T15:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data Driven Pages to scale raster symbology from each page's current exte</title>
      <link>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741150#M7986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What I mean by "rasters do not scale to the current display extent" is that as each new page is generated with, say a DEM, the scale does not change according to the &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;current &lt;/SPAN&gt;&lt;SPAN&gt;display extent, but remains what is was on page 1.&amp;nbsp; In the case of the DEM, I'd like to have each data driven page recalculate the layer properties to rescale the DEM according to the current extent - see attached image.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 16:41:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741150#M7986</guid>
      <dc:creator>JeffOlsenholler</dc:creator>
      <dc:date>2013-02-07T16:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data Driven Pages to scale raster symbology from each page's current exte</title>
      <link>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741151#M7987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately arcpy.mapping can't work with the stretched renderer.&amp;nbsp; Rather than the raster being a permanent layer in the MXD, what if you tried adding and deleting it with each page?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is a sample snippet of code from the arcpy.mapping DDP Class help topic that I modified to add/remove your raster between DDP pages.&amp;nbsp; It just requires that you save your raster out as a layer file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Project\ParcelAtlas.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] rasLyrFile = arcpy.mapping.Layer(r"C:\Project\Data\Basemap.lyr") for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1): &amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.AddLayer(df, rasLyrFile, "BOTTOM")&amp;nbsp;&amp;nbsp; #You can use InsertLayer for more precise placement&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.exportToPDF(r"C:\Project\Output\Page" + str(pageNum) + ".pdf", "CURRENT") &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.RemoveLayer(df, rasLyrFile) del mxd&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 13:53:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741151#M7987</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2013-02-08T13:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Data Driven Pages to scale raster symbology from each page's current exte</title>
      <link>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741152#M7988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Unfortunately arcpy.mapping can't work with the stretched renderer.&amp;nbsp; Rather than the raster being a permanent layer in the MXD, what if you tried adding and deleting it with each page?&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Below is a sample snippet of code from the arcpy.mapping DDP Class help topic that I modified to add/remove your raster between DDP pages.&amp;nbsp; It just requires that you save your raster out as a layer file.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Project\ParcelAtlas.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
rasLyrFile = arcpy.mapping.Layer(&lt;STRONG&gt;r"C:\Project\Data\Basemap.lyr")&lt;/STRONG&gt;
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.AddLayer(df, rasLyrFile, "BOTTOM")&amp;nbsp;&amp;nbsp; #You can use InsertLayer for more precise placement&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.exportToPDF(r"C:\Project\Output\Page" + str(pageNum) + ".pdf", "CURRENT")
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.RemoveLayer(df, rasLyrFile)
del mxd&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Jeff&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying this code now in the python module of my DDP project. I replaced the layer and mxd location lines, and also the export location. However when I run it it says:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Runtime error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 3, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IndexError: list index out of range&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:32:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/getting-data-driven-pages-to-scale-raster/m-p/741152#M7988</guid>
      <dc:creator>TheoFaull</dc:creator>
      <dc:date>2021-12-12T07:32:49Z</dc:date>
    </item>
  </channel>
</rss>

