<?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 Round Raster decimal values in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/round-raster-decimal-values/m-p/359262#M20571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope someone can help me. I need to make round the decimal values from a raster, there are only two python functions to do it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-RoundUp(inRaster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-RoundDown(inRaster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I need a function that returns the floating point value x rounded to n digits after the decimal point. If n is omitted, it defaults to zero. The result is a floating point number. Values are rounded to the closest multiple of 10 to the power minus n; if two multiples are equally close, rounding is done away from 0 (so. for example, round(0.5) is 1.0 and round(-0.5) is -1.0).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Sep 2012 17:53:31 GMT</pubDate>
    <dc:creator>DavidMendoza</dc:creator>
    <dc:date>2012-09-04T17:53:31Z</dc:date>
    <item>
      <title>Round Raster decimal values</title>
      <link>https://community.esri.com/t5/data-management-questions/round-raster-decimal-values/m-p/359262#M20571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope someone can help me. I need to make round the decimal values from a raster, there are only two python functions to do it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-RoundUp(inRaster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-RoundDown(inRaster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I need a function that returns the floating point value x rounded to n digits after the decimal point. If n is omitted, it defaults to zero. The result is a floating point number. Values are rounded to the closest multiple of 10 to the power minus n; if two multiples are equally close, rounding is done away from 0 (so. for example, round(0.5) is 1.0 and round(-0.5) is -1.0).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2012 17:53:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/round-raster-decimal-values/m-p/359262#M20571</guid>
      <dc:creator>DavidMendoza</dc:creator>
      <dc:date>2012-09-04T17:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Round Raster decimal values</title>
      <link>https://community.esri.com/t5/data-management-questions/round-raster-decimal-values/m-p/359263#M20572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We gave a solution using a python script to make the Round. I apologize, but the solution is written in spanish:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suponiendo que tenemos un raster de temperaturas positivas y negativas con valores decimales. Se usa la herramienta de python: �??Python window�?�.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Se separan en dos rasters, uno con valores positivos y otro con los valores negativos, dando como resultado dos rasters: tmpPos y tmpNeg.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rasterPos=Con(Raster("tmp")&amp;gt;=0,1,0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rasterNeg=Con(Raster("tmp")&amp;gt;0,1,0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpPos=(Raster("tmp") * Raster("rasterPos"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpNeg=(Raster("tmp") * Raster("rasterNeg"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Para postivos y negativos, se separan en raters, uno de puros valores enteros y otro para decimales, quedando 4 nuevos rasters:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpPosInt=Int("tmpPos")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpPosDec=(Raster("tmpPos") - Raster("tmpPosInt"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpNegInt=Int("tmpNeg")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpNegDec=(Raster("tmpNeg") - Raster("tmpNegInt"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Se hace una reclasificación con la herramienta Reclass. Con esto se trabaja en los rasters de decimales:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;En el caso de los decimales positivos:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Si decimal es mayor igual a 0.5 entonces cambia a 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Si decimal es menor a 0.5 entonces cambia a 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Se genera el nuevo raster: decPosRecla&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;En el caso de los decimales negativos:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Si decimal es mayor igual a -0.5 entonces cambia a 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Si decimal es menor a 5 entonces cambia a 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Se genera el nuevo raster: decNegRecla&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Se hacen los rasters redondeados para los positivos y los negativos&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpRedPos=(Raster("tmpPosInt")+Raster("decPosRecla"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpRedNeg=(Raster("tmpNegInt") - Raster("decNegRecla"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Por último, se suman estos dos últimos rasters y da el raster redondeado de temperaturas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tmpRedondeado=(Raster("tmpRedNeg")+Raster("tmpRedPos"))&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2012 16:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/round-raster-decimal-values/m-p/359263#M20572</guid>
      <dc:creator>DavidMendoza</dc:creator>
      <dc:date>2012-09-13T16:22:04Z</dc:date>
    </item>
  </channel>
</rss>

