<?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: Differences between results obtained with Raster Calculator and Map Algebra (VB) in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375192#M5285</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 12px; background-color: #f3f3f3;"&gt;I don't know how the environment settings could be fixed in VBA for Map Algebra.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe these settings are properties on your pEnv (&lt;SPAN style="font-family: 'Courier New'; font-size: 11px; background-color: #f3f3f3;"&gt;&lt;A href="http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriGeoAnalyst/IRasterAnalysisEnvironment.htm"&gt;IRasterAnalysisEnvironment&lt;/A&gt;&lt;/SPAN&gt;) object. I would query your pEnv object and see if the values are the same that were set in the Spatial Analyst toolbar options when you ran the Raster Calculator. it's true the Raster Calculator interface is different from the raster tools and this a major reason it went away at 10.x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you considered eschewing the the ArcObjects Ops and instantiate a geoprocessor object instead so you can use the single-output map algebra tool - this lets the GP do a lot of the work for you -- a lot less code! A side benefit of doing it that way is your code will be a lot more portable to 10.x.&amp;nbsp; Also, note that VBA is deprecated from 10.x on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Aug 2014 16:53:14 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2014-08-08T16:53:14Z</dc:date>
    <item>
      <title>Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375188#M5281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would want to work with Map Algebra launched in VB from ArcGis 9.3.&lt;/P&gt;&lt;P&gt;The results obtained, are a little bit different from those obtained with Raster Calculator.&lt;/P&gt;&lt;P&gt;Does someone know where could be the problem?&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Carles.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 14:05:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375188#M5281</guid>
      <dc:creator>CarlesMiquel</dc:creator>
      <dc:date>2014-08-07T14:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375189#M5282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Examples would be great...the syntax and the outputs would be useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 16:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375189#M5282</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-08-07T16:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375190#M5283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the same map algebra expression generates different results when called from different environments (for example, from running the 9x Raster Calculator tool, ModelBuilder, or using a geoprocessing tool), I believe a good place to start is to verify the environments used -- cell size, extent, coordinate system, etc. -- and make sure they are the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In 9.x this is particularly problematic as the the Raster Calculator (and VB/VBA calls to RasterOp objects) observe the ArcObjects settings (set in the Spatial Analyst toolbar Options), while the map algebra geoprocessing tools (SOMA, MOMA) use the (perhaps different) settings in the geoprocessing environment. In 10.x, all spatial analyst tools use the geoprocessing environment -- much less confusing that way!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 18:11:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375190#M5283</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-08-07T18:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375191#M5284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you to both, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sure you are right Curtis, but I don't know how the environment settings could be fixed in VBA for Map Algebra. As suggested by Dan, I attach the code used just in case it could help to bring more information.&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 8.0pt; font-family: 'Courier New';"&gt;Sub Map_algebra_calculation(calculation_text As String, Output_raster_name As String)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;strData = "C:\OUTPUT_PATH\"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxDoc = ThisDocument&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pRLayer As IRasterLayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer_AAA As ILayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pInRaster_AAA As IRaster&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer_BBB As ILayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pInRaster_BBB As IRaster&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer_CCC As ILayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pInRaster_CCC As IRaster&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer_DDD As ILayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pInRaster_DDD As IRaster&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer_EEE As ILayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pInRaster_EEE As IRaster&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp; ' Create a Spatial operator&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Dim pAlgbOp As IMapAlgebraOp&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pAlgbOp = New RasterMapAlgebraOp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pLayer_AAA = pMap.Layer(2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pRLayer = pLayer_AAA&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pInRaster_AAA = pRLayer.Raster&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pLayer_BBB = pMap.Layer(3)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pRLayer = pLayer_BBB&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pInRaster_BBB = pRLayer.Raster&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pLayer_CCC = pMap.Layer(4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pRLayer = pLayer_CCC&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pInRaster_CCC = pRLayer.Raster&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pLayer_DDD = pMap.Layer(5)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pRLayer = pLayer_DDD&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pInRaster_DDD = pRLayer.Raster&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pLayer_EEE = pMap.Layer(6)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pRLayer = pLayer_EEE&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Set pInRaster_EEE = pRLayer.Raster&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Bind a raster&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;Call pAlgbOp.BindRaster(pInRaster_AAA, "AAA")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.BindRaster(pInRaster_BBB, "BBB")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.BindRaster(pInRaster_CCC, "CCC")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.BindRaster(pInRaster_DDD, "DDD")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.BindRaster(pInRaster_EEE, "EEE")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set output workspace&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnv As IRasterAnalysisEnvironment&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnv = pAlgbOp&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pWS As IWorkspace&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pWSF As IWorkspaceFactory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pWSF = New RasterWorkspaceFactory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pWS = pWSF.OpenFromFile("C:\OUTPUT_PATH\TEMP", 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnv.OutWorkspace = pWS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Perform Spatial operation&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp; Dim pOutRaster As IRaster&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Defineix les variable de la iteracio de l'Excel llegit&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Dim Texte_calculadora_raster As String&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;'&amp;nbsp; Set Texte_calculadora_raster = calculation_text&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Dim Nom_fitxer_sortida As String&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp; '&amp;nbsp; Set Nom_fitxer_sortida = Output_raster_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'aquí comança el càlcul de la regressio multiple&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;Set pOutRaster = pAlgbOp.Execute(calculation_text) &lt;SPAN style="color: green;"&gt;'(Texte_calculadora_raster)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt; &lt;SPAN style="color: green;"&gt;' Unbind rasters&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.UnbindRaster("AAA")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.UnbindRaster("BBB")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.UnbindRaster("CCC")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.UnbindRaster("DDD")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pAlgbOp.UnbindRaster("EEE")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Add it into ArcMap&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pRLayer = New RasterLayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="FR" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;pRLayer.CreateFromRaster pOutRaster&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="FR" style="font-size: 8.0pt; font-family: 'Courier New'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Add its name (Output raster name)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="FR" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRLayer.Name = Output_raster_name &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;pMap.AddLayer pRLayer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call createFileFromRaster(pOutRaster, strData + pRLayer.Name)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-right: -51.8pt; margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 8.0pt; font-family: 'Courier New';"&gt;End Sub&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 12:09:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375191#M5284</guid>
      <dc:creator>CarlesMiquel</dc:creator>
      <dc:date>2014-08-08T12:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375192#M5285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 12px; background-color: #f3f3f3;"&gt;I don't know how the environment settings could be fixed in VBA for Map Algebra.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe these settings are properties on your pEnv (&lt;SPAN style="font-family: 'Courier New'; font-size: 11px; background-color: #f3f3f3;"&gt;&lt;A href="http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriGeoAnalyst/IRasterAnalysisEnvironment.htm"&gt;IRasterAnalysisEnvironment&lt;/A&gt;&lt;/SPAN&gt;) object. I would query your pEnv object and see if the values are the same that were set in the Spatial Analyst toolbar options when you ran the Raster Calculator. it's true the Raster Calculator interface is different from the raster tools and this a major reason it went away at 10.x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you considered eschewing the the ArcObjects Ops and instantiate a geoprocessor object instead so you can use the single-output map algebra tool - this lets the GP do a lot of the work for you -- a lot less code! A side benefit of doing it that way is your code will be a lot more portable to 10.x.&amp;nbsp; Also, note that VBA is deprecated from 10.x on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 16:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375192#M5285</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-08-08T16:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375193#M5286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;I am not&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;an expert in&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;programming&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;code and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;do not know how&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to set&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and write&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;this environment.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Could someone posting an example setting all the properties of an pEnv (&lt;SPAN style="font-family: 'Courier New'; font-size: 11px; background-color: #f3f3f3;"&gt;&lt;A class="jive-link-external-small" href="http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriGeoAnalyst/IRasterAnalysisEnvironment.htm" rel="nofollow" target="_blank"&gt;IRasterAnalysisEnvironment&lt;/A&gt;&lt;/SPAN&gt;) object?&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;Carles.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 09:17:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375193#M5286</guid>
      <dc:creator>CarlesMiquel</dc:creator>
      <dc:date>2015-01-30T09:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375194#M5287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not a developer either, but it seems pretty straight forward, along the&amp;nbsp; lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;cell_size = 30
Dim pRasEnv as IRasterAnalysisEnvironment
pRasEnv.SetCell(esriRasterEnvValue, cell_size)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still think going to geoprocessing is an easier path - and more forward-compatible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:21:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375194#M5287</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T17:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375195#M5288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Curtis,&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I will try your example. I tried geoprocessing with an adapted code in the base of this one, but the results are very different from the ones obtained with the raster calculator. I don't know where the problem is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have an idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Create the Geoprocessor object&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;gp = arcgisscripting.create()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; # Set local variables&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; InExpression = "focalsum(C:/data/flowdir, Circle, 3)"&lt;/P&gt;&lt;P&gt;&amp;nbsp; OutRaster = "C:/data/soma01"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; # Check out Spatial Analyst extension license&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; gp.CheckOutExtension("Spatial")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; # Process: MapAlgebraStatement&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; gp.SingleOutputMapAlgebra_sa(InExpression, OutRaster)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;except:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; # If an error occurred while running a tool, then print the messages.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; print gp.GetMessages()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Jan 2015 21:31:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375195#M5288</guid>
      <dc:creator>CarlesMiquel</dc:creator>
      <dc:date>2015-01-31T21:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375196#M5289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Curtis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An how could I define the other parametre from pEnv (Extent as interesection, etc...)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Jan 2015 22:03:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375196#M5289</guid>
      <dc:creator>CarlesMiquel</dc:creator>
      <dc:date>2015-01-31T22:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Differences between results obtained with Raster Calculator and Map Algebra (VB)</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375197#M5290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dim gp As Object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set gp = CreateObject("esriGeoprocessing.GPDispatch.1")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CheckOutExtension "spatial"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox "C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim StrDataComplerta As String&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StrDataComplerta = StrData + nom_raster_sortida&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.SingleOutputMapAlgebra_sa text_calcul, StrDataComplerta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Jan 2015 22:05:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/differences-between-results-obtained-with-raster/m-p/375197#M5290</guid>
      <dc:creator>CarlesMiquel</dc:creator>
      <dc:date>2015-01-31T22:05:32Z</dc:date>
    </item>
  </channel>
</rss>

