The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
117 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
1answer
66 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
36 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
26 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
57 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
49 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(...
14
votes
1answer
438 views

PostGIS raster summation (map algebra)

I have a table of polygons representing travel time isochrones on particular days. For each origin point, there are five isochrone geometries (stored in separate rows). For each origin point, I want ...
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 ...
1
vote
2answers
101 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
3answers
253 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
63 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 ...
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 ...
5
votes
1answer
1k views

How to do loops on raster cells with python console in QGIS?

I'm new here and beginner with python. I'm looking for a solution to my problem for some hours but now you are my last chance... I'm using the python (2.7.5) console in QGIS (2.4.0). Is there a ...
0
votes
0answers
99 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
150 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
330 views

Map algebra from files in multiple directories

I'm a rookie in python programming. I want to do map algebra for multiple rasters but these rasters are in different folders. Here's the code ive created so far: #Importing modules import arcpy from ...
2
votes
2answers
114 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
votes
1answer
225 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 ...
3
votes
1answer
525 views

How to speed up raster/map algebra in PostGIS?

I am testing map algebra with PostGIS (2.1 with PostgreSQL 9.3) on two images, and found it to be rather slow. For example, dividing two images of 7200 * 3600 pixels took 110 ~ 120s on a desktop with ...
1
vote
1answer
199 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
0answers
88 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
869 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
81 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 ...
1
vote
1answer
521 views

ArcGIS Raster Calculator won't work in main model

I've created a sub-model in ArcGIS, which stretches my raster data to new values. The strange thing is, that the model works, if I run it itself - as soon as I implement it in the main model, I get ...
4
votes
1answer
199 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
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 (...
1
vote
0answers
409 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
117 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
49 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 ...
5
votes
2answers
981 views

Compressing map algebra outputs from ArcPy?

When creating a raster map algebra output, is it possible to set its compression? I'm creating a model which generates many hundreds of rasters, and currently each is being stored without any ...
4
votes
1answer
120 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....
28
votes
8answers
3k views

What raster-based GIS systems really work?

Raster GISes like GRASS, ArcGIS/Spatial Analyst, and Idrisi can perform a rich set of data processing and analytical procedures loosely known as "map algebra." In today's computing environment it is ...
2
votes
1answer
121 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 ...
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
888 views

Plotting Vector Arrows from U and V Component with ArcGIS for Desktop?

I have two raster layers representing the U and V components of a vector wind. I could generate the magnitude raster by applying Square root in Map Algebra in ArcGIS. I also generated a raster layer ...
6
votes
2answers
4k views

For Loop - Map Algebra (ArcGIS) using Python

ORIGINAL QUESTION Im relatively new to python and these fourms but Im am having trouble utilizing for-loops for spatial analyses within ArcGIS. It does not appear to recognize the variable, ...
2
votes
2answers
205 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 ...
2
votes
0answers
384 views

Arcpy script for summing pixel values in loop can't handle large number of rasters

I want to sum the pixel values of large numbers of rasters of different extents (ArcMap v10.2). 16GB RAM. I have the following code (with help from this site) which solves the different extent ...
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
565 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 ...
1
vote
1answer
385 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: ...
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 ...
2
votes
1answer
594 views

Efficiently check for equal adjacent values in raster calculator

I have a raster consisting of integer values in each cell. I want to check every adjacent cell in a 3x3 grid to see if any one of the adjacent cells has a value EQUAL to the center cell, and if so, ...
1
vote
1answer
328 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 ...