<?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: preserving original raster values when combining in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75497#M1045</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In v9.3 or v10? BTW: The new v10 Map Algebra and I don't get along...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If was doing this process in v93 Python it would look something like this (code not verified):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#assumes that the extent of littleRaster fits entirely within extent bigRaster 
bigRaster = r"C:\big"
littleRaster = r"C:\little"
gp.extent = bigRaster
#Note: no need to set the snap raster if we are just using the extent of bigRaster
somaExp = "con(isnull(" + littleRaster + "), -9999, " + littleRaster + ")" #recode NoData to -9999, otherwise keep the original values
littleRasterNew = r"C:\little_new"
gp.SingleOutputMapAlgebra_sa(somaExp, littleRasterNew)
comboRaster = r"C:\combo"
somaExp = "combine(" + bigRaster + "," + littleRasterNew + ")"
gp.SingleOutputMapAlgebra_sa(somaExp, comboRaster)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:55:33 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2021-12-10T22:55:33Z</dc:date>
    <item>
      <title>preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75491#M1039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I see that when combining raster layers the output layer produces new values for the cells but is there any way of 'carrying over' the values from the original layers? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have two raster layers that I would like to combine and be able to see the original values of both. Basically I would like an equivalent of the 'union' tool for rasters - does this exist?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Claire&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 14:13:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75491#M1039</guid>
      <dc:creator>ClaireBrittain</dc:creator>
      <dc:date>2011-07-21T14:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75492#M1040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You hit it on the head: The Combine tool: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z0000007r000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z0000007r000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that this tool will "integerize" any inputs that are floating point, so if you need to preserve precision in the floating point data, do someting like int(MyFloatGrid * 1000) first and then in the output combine tool just divide the field by 1000 to get your original float value back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, note that the tool performs MUCH faster if all the input rasters and the output raster are all in GRID format (as opposed to all inputs and outputs datasets being FGDB fomat).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 16:17:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75492#M1040</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-07-21T16:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75493#M1041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your response. The output of combine does preserve the initial values of the rasters combined which is great but only produces output for where the 2 rasters overlap. I would like the output to include the whole of both rasters or at least the extent of the larger raster. Is there a way you know to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Claire&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 16:27:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75493#M1041</guid>
      <dc:creator>ClaireBrittain</dc:creator>
      <dc:date>2011-07-21T16:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75494#M1042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Right.... Combine works like intersect - and you want a union.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The way I do this is to expand the extent of the original input rasters - that is make new rasters - where the null area outside the original extent gets reclassed to some recognizable value like -9999. That way you are still doing what basically amounts to an intersect, but have simply normalized the extents of the input rasters. I generally use the Analysis Extent &amp;amp; SnapRaster Environment settings in conjunction with the Con() tool to do that. Once the extents are all the same, then you shouldn't have any problems.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 16:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75494#M1042</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-07-21T16:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75495#M1043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's for a different purpose, but this Python code: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/8579-Adding-Together-Rasters?p=26307&amp;amp;viewfull=1#post26307"&gt;http://forums.arcgis.com/threads/8579-Adding-Together-Rasters?p=26307&amp;amp;viewfull=1#post26307&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has a part of it that does the extent normalization/con() routine that I am describing above. Take a look at the section of code that has the comment "#Process: Now build some new grids that have the max extent"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 16:50:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75495#M1043</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-07-21T16:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75496#M1044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand your reasoning but am having a little trouble with implementing it. One of my rasters is smaller so essentially i want to create a new raster expanding the original small raster to the extent of the larger raster (after which I can use combine). I am trying to use the raster calculator using the con function to specify where the smaller raster has a value 1 is True and should be coded 9999 and where it is false it should be coded -9999. Within the calculator I set the raster geoprocessing environments - snap and analysis extent to the larger raster but when the calculator has run this the output is still the extent of the smaller raster file (with the new True/False codings). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Claire&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 18:00:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75496#M1044</guid>
      <dc:creator>ClaireBrittain</dc:creator>
      <dc:date>2011-07-21T18:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75497#M1045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In v9.3 or v10? BTW: The new v10 Map Algebra and I don't get along...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If was doing this process in v93 Python it would look something like this (code not verified):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#assumes that the extent of littleRaster fits entirely within extent bigRaster 
bigRaster = r"C:\big"
littleRaster = r"C:\little"
gp.extent = bigRaster
#Note: no need to set the snap raster if we are just using the extent of bigRaster
somaExp = "con(isnull(" + littleRaster + "), -9999, " + littleRaster + ")" #recode NoData to -9999, otherwise keep the original values
littleRasterNew = r"C:\little_new"
gp.SingleOutputMapAlgebra_sa(somaExp, littleRasterNew)
comboRaster = r"C:\combo"
somaExp = "combine(" + bigRaster + "," + littleRasterNew + ")"
gp.SingleOutputMapAlgebra_sa(somaExp, comboRaster)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:55:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75497#M1045</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-10T22:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75498#M1046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The two fundamental concepts are that you will need the spatial extent to expand so you will need to change the environment setting for the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000009000000.htm"&gt;Output Extent&lt;/A&gt;&lt;SPAN&gt; to match the larger raster or the 'Union of Inputs' from the Environment Settings.&amp;nbsp; Also you will have to alter the Null/NoData values to a value so that when you combine them, then you can see. Please see the &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/33347-Raster-Extents-Calculator-Problems?p=112410#post112410"&gt;forum post&lt;/A&gt;&lt;SPAN&gt; here for more specific description.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once you have modified the data and the extent of the output you should be able to achieve the desired results.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 12:17:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75498#M1046</guid>
      <dc:creator>JeffreySwain</dc:creator>
      <dc:date>2011-07-22T12:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: preserving original raster values when combining</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75499#M1047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great, thanks to you both. I got there eventually. I kept thinking that when I copied the smaller raster and changed the extent to the larger raster's that it wasn't working but I just couldn't see that it had worked until I then used the calculator to set the null values to zero. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After I had done that I could see the small raster had increased in extent just as it was supposed to and I was able to use the combine tool exactly how I wanted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Claire&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 13:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/preserving-original-raster-values-when-combining/m-p/75499#M1047</guid>
      <dc:creator>ClaireBrittain</dc:creator>
      <dc:date>2011-07-22T13:25:49Z</dc:date>
    </item>
  </channel>
</rss>

