Taking into account the following assumptions:

we have 2 rasters (satellite images from different satellite platforms) of the same pixel size, same coordinate system, little bit misaligned, Snap to Raster environment variable is not defined

I apply a map algebra operation on them. Let's say I add them (arcpy.sa.Plus(raster1, raster2)).

The question is: based on what rule does the Raster Calculator algorithms choose which of the two input rasters the output raster will be aligned to.


Inputs: Raster1, Raster2

Map Algebra Operation: Raster1 + Raster2

Output: Result (aligned to Raster1)

Question: Why Result is aligned to Raster1 instead of Raster2, since I have not defined Snap to Raster environment variable?

The search I did in order to find an answer to that is based on ArcGIS online documentation, help tools inside ArcGIS desktop environment, gis.stackexchange, esri forum, as well as python files. In the latter case, I ended up dealing with built-in functions that are included in arcgisscripting.pyd where I don't have access.

  • What happens when you do Raster2 + Raster1? Other vector overlay tools honour the order, saying that resolution and tolerance of the output of Overlay operation gets the first inputted vector, say Union or Intersect tool. I am not surprised if the same logic is applied to raster analysis. – fatih_dur May 2 '18 at 2:11
  • Unfortunately it's not related to the order. Thanks :) – KonstaNtie May 4 '18 at 8:29

I don't think that the behaviour of tools is well documented when important environment variables are not populated. While not directly related to the Snap-Raster environment variable, the documentation for the Output Extent environment variable discusses the default behaviour as

"All tools have a default extent they calculate from their inputs. This default is rarely documented in the tool reference page but is usually obvious" (http://desktop.arcgis.com/en/arcmap/10.3/tools/environments/output-extent.htm).

It seems likely that the tool just populates the snap raster with the first input or some other default behaviour if the environment variable is not set. I would guess that this may not be consistent between tools so it is probably safer to populate the snap-raster enviornment variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.