Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [map-algebra]

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

1
vote
3answers
53 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
90 views

ExecuteError: ERROR 000539: Error 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: ...
0
votes
1answer
33 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
39 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
43 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
18 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(...
13
votes
1answer
419 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
68 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
81 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
182 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
53 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
2k 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
72 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
62 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
71 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
324 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
71 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
199 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
511 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
178 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
73 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
700 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
75 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
506 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
186 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
168 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
385 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
109 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 ...
5
votes
2answers
970 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
97 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
114 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
81 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
839 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, ...
3
votes
2answers
183 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
373 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
471 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
347 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
583 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
290 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 ...
0
votes
2answers
172 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
541 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 ...
5
votes
2answers
661 views

Changing raster calculation values - shorten this script?

i'm doing something quite straightforward regarding raster algebra but am struggling either to find the correct function or make a function work correctly; Basically I have 2 rasters, representing ...
1
vote
2answers
2k views

QGIS from console: raster algebra

I'm newbie to programming in pyqgis. I need to perform a simple "GeoTiff * A" type of calculation(where A is a constant), but I am struggling to do so. I tried processing.runalg('saga:...