<?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 Expanding a raster extent with nodata values using arcpy? in ArcGIS Analyse Questions</title>
    <link>https://community.esri.com/t5/arcgis-analyse-questions/expanding-a-raster-extent-with-nodata-values-using/m-p/860522#M115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a simple way to expand the extent of an existing raster (using nodata values)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have explored the following:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/3810" target="_blank"&gt;Extending an existing raster extent.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/111951/increasing-raster-extent-by-filling-extent-with-no-data-using-arcgis-desktop-wit" title="https://gis.stackexchange.com/questions/111951/increasing-raster-extent-by-filling-extent-with-no-data-using-arcgis-desktop-wit" rel="nofollow noopener noreferrer" target="_blank"&gt;Increasing raster extent by filling extent with no data using ArcGIS Desktop without Spatial Analyst? - Geographic Infor…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I came across another posting (sorry, the link is not readily coming up) in which someone (Dan Patterson I think) recommended combining the starting (small) raster, and overlaying with another larger raster.&amp;nbsp; Makes sense, and I have run the following:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #8c8c8c;"&gt;# Expand the size of the data raster, using a NoData raster of the correct extent.&lt;/SPAN&gt;
emptyraster = Raster(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"examplerasterofdesiredsize"&lt;/SPAN&gt;) # Make a copy of a raster that is of the correct size
emptyraster = SetNull("examplerasterofdesiredsize",&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"examplerasterofdesiredsize"&lt;/SPAN&gt;,&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"VALUE = 0"&lt;/SPAN&gt;) &lt;SPAN style="color: #8c8c8c;"&gt;# The raster being used is already populated with the value 0, this is converted to NoData
&lt;/SPAN&gt;emptyraster.save(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"emptyraster"&lt;/SPAN&gt;) # save the no data raster

So far so good.

outputraster = Con(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"smallraster"&lt;/SPAN&gt;,&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"smallraster"&lt;/SPAN&gt;,&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"emptyraster"&lt;/SPAN&gt;) # Where there is a value for the small raster, use it, otherwise use the value from the larger raster
outputraster.save(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"outputraster"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Unfortunatly, the outputraster retains the same extent as the small raster.&amp;nbsp; There are ways to change this going through the GUI menus, but I would rather automate the process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should the Con function work?&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:40:15 GMT</pubDate>
    <dc:creator>RobertTrotter</dc:creator>
    <dc:date>2021-12-12T10:40:15Z</dc:date>
    <item>
      <title>Expanding a raster extent with nodata values using arcpy?</title>
      <link>https://community.esri.com/t5/arcgis-analyse-questions/expanding-a-raster-extent-with-nodata-values-using/m-p/860522#M115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a simple way to expand the extent of an existing raster (using nodata values)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have explored the following:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/3810" target="_blank"&gt;Extending an existing raster extent.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/111951/increasing-raster-extent-by-filling-extent-with-no-data-using-arcgis-desktop-wit" title="https://gis.stackexchange.com/questions/111951/increasing-raster-extent-by-filling-extent-with-no-data-using-arcgis-desktop-wit" rel="nofollow noopener noreferrer" target="_blank"&gt;Increasing raster extent by filling extent with no data using ArcGIS Desktop without Spatial Analyst? - Geographic Infor…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I came across another posting (sorry, the link is not readily coming up) in which someone (Dan Patterson I think) recommended combining the starting (small) raster, and overlaying with another larger raster.&amp;nbsp; Makes sense, and I have run the following:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #8c8c8c;"&gt;# Expand the size of the data raster, using a NoData raster of the correct extent.&lt;/SPAN&gt;
emptyraster = Raster(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"examplerasterofdesiredsize"&lt;/SPAN&gt;) # Make a copy of a raster that is of the correct size
emptyraster = SetNull("examplerasterofdesiredsize",&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"examplerasterofdesiredsize"&lt;/SPAN&gt;,&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"VALUE = 0"&lt;/SPAN&gt;) &lt;SPAN style="color: #8c8c8c;"&gt;# The raster being used is already populated with the value 0, this is converted to NoData
&lt;/SPAN&gt;emptyraster.save(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"emptyraster"&lt;/SPAN&gt;) # save the no data raster

So far so good.

outputraster = Con(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"smallraster"&lt;/SPAN&gt;,&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"smallraster"&lt;/SPAN&gt;,&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"emptyraster"&lt;/SPAN&gt;) # Where there is a value for the small raster, use it, otherwise use the value from the larger raster
outputraster.save(&lt;SPAN style="color: #008080; font-weight: bold;"&gt;"outputraster"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Unfortunatly, the outputraster retains the same extent as the small raster.&amp;nbsp; There are ways to change this going through the GUI menus, but I would rather automate the process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should the Con function work?&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:40:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-analyse-questions/expanding-a-raster-extent-with-nodata-values-using/m-p/860522#M115</guid>
      <dc:creator>RobertTrotter</dc:creator>
      <dc:date>2021-12-12T10:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding a raster extent with nodata values using arcpy?</title>
      <link>https://community.esri.com/t5/arcgis-analyse-questions/expanding-a-raster-extent-with-nodata-values-using/m-p/860523#M116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;geoprocessing extent can be set&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/environment-settings/output-extent.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/environment-settings/output-extent.htm"&gt;Extent (Environment setting)—Geoprocessing | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to derive it from an existing raster, derive it from its properties (extent of a raster is read-only) but set it using the environment settings as in the code example in the above link&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2020 02:39:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-analyse-questions/expanding-a-raster-extent-with-nodata-values-using/m-p/860523#M116</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-05-01T02:39:55Z</dc:date>
    </item>
  </channel>
</rss>

