Questions tagged [map-algebra]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
59 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 ...
0
votes
1answer
35 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 ...
1
vote
0answers
23 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. ...
1
vote
1answer
30 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%") ...
1
vote
3answers
56 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, ...
0
votes
1answer
40 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: ...
1
vote
0answers
42 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 ...
0
votes
0answers
47 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 ...
0
votes
0answers
20 views

Buggy intermediate datasets in map algebra

I created a for loop to perform a (simplified here) series of operations over tiles from a larger dataset. My initial code looked like this: ext_template = bingmean_odd totalextent = arcpy.Describe(...
0
votes
3answers
238 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 ...
0
votes
1answer
60 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 ...
1
vote
2answers
96 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 ...
0
votes
0answers
96 views

Saving rasters in Arcpy loop

I'm trying to do Map Algebra on a bunch of rasters by iterating through a for loop and saving them in an empty geodatabase. However, they aren't saving properly. Only the last raster is created and it ...
2
votes
0answers
73 views

Map Algebra loop only creating one raster

I'm trying to transform a bunch of rasters in arcpy according to specific functions to create suitability rasters. This portion of the code is supposed to find all the rasters with interpolated ...
1
vote
1answer
130 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 ...
2
votes
2answers
105 views

Applying Map Algebra to List of Rasters and Saving New File in New Directory?

I am trying to multiply each raster by coefficient using Map Algebra in Python. I receive the following error for the code below: calcRaster.save(calcRasterName) AttributeError: 'unicode' object ...
1
vote
1answer
114 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: ...
1
vote
0answers
87 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 ...
1
vote
1answer
196 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 ...
1
vote
1answer
842 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
1answer
80 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 ...
2
votes
2answers
1k 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 ...
2
votes
2answers
3k 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 ...
1
vote
2answers
72 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 ...
4
votes
1answer
192 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 ...
1
vote
0answers
407 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, ...
1
vote
1answer
115 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 ...
1
vote
2answers
48 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 ...
4
votes
1answer
113 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....
1
vote
0answers
83 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
votes
1answer
119 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
votes
2answers
203 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 ...
-1
votes
1answer
219 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
1answer
66 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 ...
2
votes
1answer
544 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 ...
0
votes
1answer
58 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 ...
1
vote
1answer
320 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 ...
1
vote
2answers
169 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 (...
0
votes
2answers
200 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 ...
2
votes
1answer
559 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 ...
1
vote
1answer
380 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: ...
2
votes
1answer
159 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 ...
1
vote
1answer
121 views

Map Algebra syntax

I'm trying to create a new raster from an existing slope raster where slopes are between 5 and 20 degrees. However, I'm receiving the error "ValueError: The truth value of a raster is ambiguous. ...
3
votes
2answers
343 views

PostGIS raster MapAlgebra callback optimization

I'm trying to speed up an ST_MapAlgebra callback function that essentially takes a raster with four bands, checks each band for values less than a given number, and where the check is true, return the ...
1
vote
1answer
458 views

Changing raster value based on point feature

I am working on some landslide modeling. Within ArcMap I have a raster layer, representing the area of the county I am working in, and a point layer that shows landslide locations. I reclassified ...
1
vote
1answer
420 views

Con statement not working in Raster Calculator of ArcGIS for Desktop?

I'm trying to combine two rasters in 10.3 using a con statement with the raster calculator in map algebra. (ie - con (raster 1 ==1, raster 1, raster 2)) where raster 1 is a smaller extent and does ...
2
votes
1answer
53 views

How to weigh the size of a spatial event with respect to the number of its hotspots?

This is probably a map algebra problem. I have a 2D map with values ranging 0.0 to 1.0 spread all over it. The algorithm that produces them is an application of the fractional Brownian motion. The map ...
-1
votes
1answer
809 views

Adding Rasters with multiple Field Values using Map Algebra in ArcGIS for Desktop? [duplicate]

Embarrassed that I haven't looked at this for some time (can't quite get the syntax down). (ArcGIS 10.2, Win7x64). Within Map Algebra (Raster Calculator) Trying to add the cell values of 3 rasters, ...
0
votes
1answer
747 views

Calculating the difference between two grids in percent with QGIS

I'm using the QGIS GDAL Raster Calculator to get the difference in percent between two grids. Grid A contains an integer, and grid B contains an integer which may be the same as or larger than the ...
1
vote
2answers
363 views

Alternative to nested Con statements in python

I have a nested con statement that I'd like to put into a script, as it's hard to follow in its current form. The raster it produces is incorrect, so it'd be easier to debug in a script. The ...