<?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: Invert Raster in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114080#M1590</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No problem.&amp;nbsp; Glad to be able to help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Aug 2011 12:51:16 GMT</pubDate>
    <dc:creator>TimothyHales</dc:creator>
    <dc:date>2011-08-02T12:51:16Z</dc:date>
    <item>
      <title>Invert Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114076#M1586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible to invert a raster in ArcView + spatial analyst?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can manually invert the raster using the following expression "(("Fac" - Z_Max) * -1) + Z_min" where z_max/min are manually looked up and replaced using the legend eg. (("Fac" - 1000) * -1) + 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;however i've got lots of these to run in batch so i don't want to have to manually look up the values each time. i need to run the cost distance tool on these files so they can't have negative numbers my only option at the moment is to use generic min/max numbers then reclass any negative numbers to 0 which isn't ideal&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this seems like a pretty straight forward task i'm sure there must be a better way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 10:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114076#M1586</guid>
      <dc:creator>jamiefinney</dc:creator>
      <dc:date>2011-08-01T10:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Invert Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114077#M1587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;or is there a way to follow the highest cost path rather than the least cost path?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 12:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114077#M1587</guid>
      <dc:creator>jamiefinney</dc:creator>
      <dc:date>2011-08-01T12:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invert Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114078#M1588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is something I threw together really quick.&amp;nbsp; It ran fine for me and properly inverted the values of the input raster.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
 
InputRaster = "&lt;A href="https://community.esri.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;\\c:\\temp\\Input.img&lt;/A&gt;"
OutputRaster = "&lt;A href="https://community.esri.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;\\c:\\temp\\Output.img&lt;/A&gt;"

RasterMax = arcpy.GetRasterProperties_management(InputRaster,"MAXIMUM")
OutputRasterMax = (RasterMax.getOutput(0))

RasterMin = arcpy.GetRasterProperties_management(InputRaster, "MINIMUM")
OutputRasterMin = (RasterMin.getOutput(0))

RasterInvert = ((Minus(InputRaster, float(OutputRasterMax))*(-1)+ float(OutputRasterMin)))
RasterInvert.save(OutputRaster)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:46:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114078#M1588</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2021-12-11T06:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Invert Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114079#M1589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thales007 thanks just the function i was looking for, knew there must be a way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2011 12:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114079#M1589</guid>
      <dc:creator>jamiefinney</dc:creator>
      <dc:date>2011-08-02T12:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Invert Raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114080#M1590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No problem.&amp;nbsp; Glad to be able to help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2011 12:51:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/invert-raster/m-p/114080#M1590</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2011-08-02T12:51:16Z</dc:date>
    </item>
  </channel>
</rss>

