<?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: How to re-classify certain raster values based on another raster (land use classification)? in Esri Tutorials Questions</title>
    <link>https://community.esri.com/t5/esri-tutorials-questions/how-to-re-classify-certain-raster-values-based-on/m-p/278785#M97</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The land use tiff should be classified by coded values, e.g 1 = cropland, 2 = forest and therefore not interrogable by a text query such as 'if LU.tif == 'forest'... then..)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it should be pretty easy in raster calculator with a Con statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con(InRas1 condition and InRas2 condition, True, False)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my syntax might be a bit off, ive not tested it, if not try if "LU.tif" in (1,2) instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con( ("LU.tif" == 1 or "LU.tif" == 2 and "mndwi.tif" &amp;gt;= 0.4), "mndwi.tif", "LU.tif")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;my syntax might be a bit off, ive not tested it, if not try if "LU.tif" in (1,2) instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 Mar 2020 20:09:02 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2020-03-29T20:09:02Z</dc:date>
    <item>
      <title>How to re-classify certain raster values based on another raster (land use classification)?</title>
      <link>https://community.esri.com/t5/esri-tutorials-questions/how-to-re-classify-certain-raster-values-based-on/m-p/278784#M96</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am quite new to ArcGIS so this may be simple, but I just cannot find the right answer to this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two rasters (.tif) that I have derived from Sentinel images. One is a raster with land use classification derived from training sample data and Supervised Classification at 10 m resolution. It has 5 classes (buil-up/bare, forests, mining pits, croplands/grasslands, and cloud cover). I have also computed the MNDWI for each raster cell based on green and SWIR bands at 20 m resolution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have noticed that in the LU raster, it has wrongly classified water bodies as either cropland or forest. I want to correct this by assigning values in the LU layer that are cropland or forest as water bodies where the MNDWI is higher than 0.4. I have tried overlays, selection by attributes, and the raster calculator in various forms, but I keep getting error messages. The conditionals I use in the raster editor (e.g. something like:&amp;nbsp;water = ("LU.tif" == "cropland") &amp;amp; ("mndwi.tif" &amp;gt;= 0.4) do not compile. I feel like I am missing something very obvious.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to extract the water bodies using watbod = "mndwi.tif" &amp;gt;= 0.4, but now I cannot use it to extract the relevant cells in the cropland/forest LU layer - I can often compile, but then get a layer with results spanning 0 to 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this because of the differing resolutions? Where am I failing here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One additional note: I often also encounter the error notice: "The truth value of a raster is ambiguous. Invalid use of raster with Boolean operator or function." In this case, I had tried variations of watbod_new = "LU.tif" == "cropland" &amp;amp; "watbod" == 1, with watbod = 1 being the extracted waterbodies. Adding parentheses resulted in a raster with the value being 0 everywhere.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2020 13:52:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-tutorials-questions/how-to-re-classify-certain-raster-values-based-on/m-p/278784#M96</guid>
      <dc:creator>SabineHain</dc:creator>
      <dc:date>2020-03-29T13:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to re-classify certain raster values based on another raster (land use classification)?</title>
      <link>https://community.esri.com/t5/esri-tutorials-questions/how-to-re-classify-certain-raster-values-based-on/m-p/278785#M97</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The land use tiff should be classified by coded values, e.g 1 = cropland, 2 = forest and therefore not interrogable by a text query such as 'if LU.tif == 'forest'... then..)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it should be pretty easy in raster calculator with a Con statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con(InRas1 condition and InRas2 condition, True, False)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my syntax might be a bit off, ive not tested it, if not try if "LU.tif" in (1,2) instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con( ("LU.tif" == 1 or "LU.tif" == 2 and "mndwi.tif" &amp;gt;= 0.4), "mndwi.tif", "LU.tif")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;my syntax might be a bit off, ive not tested it, if not try if "LU.tif" in (1,2) instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2020 20:09:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-tutorials-questions/how-to-re-classify-certain-raster-values-based-on/m-p/278785#M97</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-03-29T20:09:02Z</dc:date>
    </item>
  </channel>
</rss>

