# Questions tagged [map-algebra]

combining map data of similar dimension to produce new maps using algebraic operations

105 questions
Filter by
Sorted by
Tagged with
1 vote
46 views

### Moderate raster values based on another raster

I am trying to make a soil erosion risk model using raster overlay in ArcGIS Pro. I have calculated soil erosion risk in raster calculator by combining the following risk factor rasters: slope ...
• 43
1 vote
62 views

### Raster calculator multiple expressions

i have the following rasters: soilrisk, slope, rainfall How can I create an expression that meets the following conditions? (Soil risk = 1 and Slope > 7 and Rainfall < 800) OR (Soil risk = 1 and ...
• 43
1 vote
36 views

### Issues using random raster, possibly mismatched extent [closed]

I am very much a beginner in using ArcGIS Pro. I have two rasters, call them Col1.tif and Col2.tif. I want to create a new raster that randomly chooses either the value from Col1 or Col2 with 50% ...
• 111
1 vote
130 views

### Addition of two rasters in PostGIS

I have two rasters (prast and frast) in PostGIS each with 1 band and with the similar extent and pixel characteristics (They were originally different bands of the same raster before I did some ...
• 459
181 views

### Reclassifying DEM via Raster Calculator in ArcGIS Pro

I have a DEM which has min-max values of 85m to 121m. I need to reclassify it so that 85m-90m is 1, 91m-95m is 2, and so on. This is easy to do in the Reclassify tool but what's the expression if I ...
• 1,217
1 vote
678 views

### Calculating NDVI percentage change in QGIS

I am trying to show how NDVI changed between two periods using raster calculator in QGIS. I stumbled upon one example that was done in ArcGIS which i have no access to but would want to do the same in ...
• 39
147 views

### Multiplying rasters by rasters within PostGIS

I have a situation where I have to multiply sets of rasters by each other. Currently I have subfolders of rasters on my machine and am looping through them and multiplying them with rasterio. Is there ...
• 143
86 views

### Giving input of multiple rasters in Raster Calculator of ArcGIS Desktop

I want to add-up more than 100 raster datasets to derive the sum of all. Adding all these one by one in calculator using basic algebra expression is time consuming. Can anybody suggest me how can I ...
1 vote
62 views

### Using Map algebra to "burn" a river into a a landcover map using GRASS

I have a map of various polygons where each polygon represent the cost of passage for different vegetations (values range from 10-50). I have a separate map of a river, where the river currently has a ...
106 views

### Using map algebra get minumum and maximum value in ArcMap

I am looking for an easy solutions with Map Algebra for this one without Saving: # Import system modules import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env....
• 31
269 views

### Map algebra with loop and SetNull not working

I'm trying to run a loop through a number of rasters while using SetNull but keep receiving an error message. I have worked on these rasters individually using SetNull and it it works, but would need ...
• 31
1 vote
156 views

### Arcpy reclassify with function

I have two rasters, one with NDVI values, and one with greyscale values (=(red band + green band + blue band) / 3). The rasters have the same name. I need to reclassify them in arcpy with the ...
• 348
190 views

### ArcGIS Conditional operation in Raster Calculator

I have two raster datasets called "Raster1" and "Raster2". Raster1 is slightly larger than Raster2 in extent (in Top, Left, Right and Bottom). This means Raster2 is fully contained by Raster1. I ...
• 2,013
215 views

### Rescaling DEM for Blender

I'm working on getting some DEMs ready to bring into Blender to render hillshade. I've done this successfully before with low elevations, but on my current project mountaintops seem to get cut off. ...
• 101
1 vote
83 views

### What is this Map Algebra expression performing in ArcGIS ModelBuilder?

I was given a model my someone else, and am trying to decipher exactly what they are doing. There is a step in the model which has the following expression: SetNull("%Raster1%"<0,"%Raster 1%") ...
• 335
1 vote
142 views

### Showing two sets of points from two different fields in QGIS?

I made a union of two adjacent shp (points) files with the same theme (Geochemistry) so the resulting attribute table gave duplicated fields, for example: ID, As_ppm, Ag_ppm, Pb_ppm, ... , ID_2, ...
144 views

### Creating custom Operation for encapsulating some map algebra using GeoTools?

In GeoTools, I need to perform a one-to-one pixel computation between a bunch of GridCoverage2D. In short: some map algebra. As I understood I can do things like summing values of coverages using: ...
• 165
1 vote
62 views

### Using minus in water drainage model

I'm doing a lab and I'm trying to understand exactly why I'm using the tool "minus". I have a raster which I'm calling "heights". I also have two rasters with water surfaces and watercourse. I have ...
• 11
104 views

### Using tool "minus" in height model?

I'm doing a lab and I'm trying to understand exactly why I'm using the tool "minus". I have a raster which I'm calling "heights". I also have two rasters with water surfaces and watercourse. I have ...
• 11
2k views

### Working with 2 rasters, having different extents but same resolution, in ArcGIS raster calculator?

I am working with 2 rasters, having different extents but same coordinate system and resolution, in Arcgis 10.5. The larger raster has 0 and smaller raster has 1 values. I want to make a new raster ...
• 31
332 views

### Converting DEM units using Map Algebra and Python

I am trying to write a bit of code that combines a bunch of DEMs that match up perfectly and convert the elevation values of the pixel cells from meters to feet. This is all using Pyscripter and ...
• 335
1 vote
190 views

### Reclassify in python doesn't reclassify things

I'm trying to reclassify the pixel values of NLCD_2011 data to a binary representation of developed vs. undeveloped land. import arcpy arcpy.CheckOutExtension("Spatial") nlcd = ('file ...
1 vote
2k views

### Merging two rasters, obtain only highest values, overwrite raster in ArcGIS Desktop?

In order to run a hydrologigal analysis I'd like to to merge two raster datasets (DEM and buildings) to get as result one raster with only the highest values (elevations) of both. In other words: To ...
• 425
1 vote
1k views

### ExecuteError: ERROR 000539 while running expression rcexec()

from arcpy import * arcpy.CheckOutExtension('Spatial') arcpy.env.workspace=r'D:\work\USA' #pathway to all rasters in workspace directory rasters = arcpy.ListRasters('*.tif') # Local variables: ...
• 11
1 vote
124 views

### Iterate a multistep Map Algebra

I am trying to write my first ArcPy script to iterate a Band Math process with requires a few steps. The uniterated, working script for a single group of bands in one Landsat scene is: #import ...
• 11
381 views

### ArcGIS Raster Calculator Con-Statement

I am trying to manipulate bad pixel values in a raster by using the Con-Statement via ArcPy. Using the build-in Map Algebra function "Raster Calculator", the results are good. To transfer the work ...
• 103
1 vote
2k views

### Gdal_calc NDVI for many rasters

Can anybody help me to solve a problem with running gdal_calc for many rasters? I have several multispectral images and I need a batch to perform NDVI calculation. I started with gdal code for one ...
1 vote
222 views

### Get argmax of PostGIS raster bands

I have a four band raster, and I would like to generate a new raster that has the argmax of the bands for each pixel. For example, if band 3 holds the maximum value at that pixel, the new raster ...
• 1,542
3k views

### Calculate NDVI using ArcPy Spatial Analyst

My goal is to calculate NDVI using map algebra syntax. import arcpy from arcpy.sa import * red_band_raster = (r"C:\B3.tif") nir_band_raster = (r"C:\B4.tif") #Calculating NDVI float raster ...
• 3,533
5k views

### Adding two rasters using map algebra in ArcPy?

I want to simply add two rasters within a python script using map algebra, which from what I understand is the equivalent to adding two rasters in the raster calculator. If I do this using raster ...
• 192
1 vote
109 views

### Arcpy Map Algebra: Maximum Number of Nestings

When using Map Algebra you can nest multiple expressions as can be seen in the Esri example below. Is there a limit on how many long of a statement you can have OR a limit on how many Con statements ...
• 566
372 views

### Passing additional arguments to ST_MapAlgebra callback?

I've written a custom callback function for ST_MapAlgebra and I want to pass additional arguments to it. The function is pretty useless - it just generates a raster filled with normal random values ...
• 568
1 vote
580 views

### ArcGIS Raster Calculator Error 000539

I am getting the error-000539: Error running expression: rcexec(). I've seen that other people have this same issue but I am not sure how to fix mine. I just want to average the values of 10 rasters, ...
• 23
1 vote
203 views

### Error using random raster for raster calculations

I have created a random raster in ArcGIS Pro using the following Python command: arcpy.CreateRandomRaster_management(Path, "rnraster", "INTEGER", "", 10) Which works fine. Performing map algebra ...
• 225
1 vote
73 views

### How to set urban areas to NoData in a DTM?

In ArcGIS 10.1, I have a DTM and a polygon layer representing urban areas. For processing reasons, I want to exclude the urban areas from the DTM (i.e., setting urban areas to NoData). How can I ...
• 1,536
484 views

### Getting rid of small objects on raster in ArcMap?

What I want to do is to get rid of 'dark' objects which are on the green areas. My input looks like this: And I want my result to look like here: Raster value of green is 1, the rest has 0 value....
• 647
1 vote
90 views

### Writing Raster Calculator Map Algebra expression?

I have the following map algebra expression to be used in Raster Calculator. The "Output raster" should satisfy the following conditions: If (IsUseAWSSites == True): if (InputRaster exists): ...
• 2,013
224 views

### Checking if input raster exist or not in Raster Calculator?

I am with Raster Calculator in ModelBuilder on ArcGIS Desktop 10.2. In the Raster Calculator's Map Algebra expression window, I need to check if a Raster dataset has already existed or not. Can ...
• 2,013
349 views

### Looping Map Algebra using Python

I am new to Python and am having difficulties trying to loop multiple rasters into a conditional statement. I want to extract all land-uses that have the value 21 from a folder with three different ...
• 23
269 views

### Raster processing and query PostGIS [closed]

I have around 2000 raster file in TIFF format of 4.5Gb size. I want to store them in a PostGIS DB in order to do some mapalgebra operation between them and than query the results of the calculation ...
1 vote
69 views

### ArcPy map algebra equivalent for "any"?

I have binary (0-1) rasters. I'm trying to do an operation equivalent to: z = arcpy.sa.Con((Raster(a) | Raster(b) | Raster(c) | ... | Raster(y)) where the raster files a-y are dynamically generated ...
• 427
1k views

### PostGis's ST_MapAlgebra rasters do not have the same alignment

I'm having a problem with ST_MapAlgebra. An error stating The set of rasters provided (custom extent included, if appropriate) do not have the same alignment is shown. I've been trying to know where ...
• 21
84 views

### Execute Equation in Map Algebra

I am in the process of shifting my raster calculations over from manually entering them into Raster Calculator to executing them in a Python script. I am curious if I can execute equations such as the ...
• 165
1 vote
615 views

### Identifying row and column location of a raster image using ArcGIS 10.1

The solution already available online gives a python syntax error ERROR 000989 Python syntax error: Parsing error SyntaxError: invalid syntax (line 1) when I write \$\$rowmap + 1 in map ...
• 11
1 vote
199 views

### While loop in Map Algebra ArcPy, associate output raster name with input raster

I have an ArcMap document open with LandSat images from one day in different bands as rasters. They're named: LC80541162014003LGN00_B1.TIF LC80541162014003LGN00_B2.TIF and so on, B1 through to B9 (...
• 423
259 views

### Raster multiplication script not executing

I built this code to multiply rasters but it will not execute, it gives me the following error: ERROR 000732: Input Raster: Dataset in_raster1 does not exist or is not supported # Import arcpy module ...
• 43
643 views

### ArcGIS raster calculator: ERROR 000539: Error running expression: rcexec() <type 'exceptions.ImportError'>: No module named collections

My raster is in the GRID format, source type is continuous and pixel type is floating point (32bit). If i use the raster calculator ("dem" *1000 or "dem >= 2m" (to highlight certain heights) it ...
• 21
1 vote
615 views

### Raster result is different for arcpy.sa CON and arcpy.gp.Con_sa

I have to add two rasters, one bigger than the other, but before adding I have to set the value of NODATA of smaller raster to the value of bigger raster. So i used the following code to do it: ...
• 149
277 views

### Problem with algebra formulas for work with gdal_calc.py

I'm trying to update some values of a raster based on another raster. 1st raster (A): landuse data (values from 10 to 240) 2nd raster (B): mask data (only nodata values and a given value, for ...
• 465
1 vote