Questions tagged [raster-calculator]

A tool in some GIS software programs for performing algebraic operations on rasters.

Filter by
Sorted by
Tagged with
29 votes
3 answers
73k views

Cropping raster layer using QGIS?

How do I crop a raster layer in QGIS? I want to make contours from a section of a layer, and including the whole layer will create far more data than I need and slow down the rendering. I have ...
Graham vdR's user avatar
19 votes
1 answer
2k views

Calculating Focal Statistics for Special Neighborhood?

I'm looking to calculate focal statistics for each cell of a raster, within a neighborhood of a specified criteria. Background - I have three binary rasters, each representing a single vegetation ...
CSB's user avatar
  • 1,274
15 votes
2 answers
30k views

Writing Conditional Statements in QGIS raster calculator

What is the equivalent statement of the following expression in the QGIS raster calculator? Con(((Abs("DEM" - "FSMin") > 120) | (Abs("DEM" - "FSMax") > 120)), 1, 0) I have no problem ...
user32882's user avatar
  • 3,514
15 votes
1 answer
6k views

Working with NaN/null and different extents in QGIS Raster calculator?

When it comes to NULL value and different extents of rasters I find it extremely cumbersome to use QGIS raster calculator. As far as I am aware there is no way to operate with NaN/Null value. So no ...
Miro's user avatar
  • 9,714
11 votes
2 answers
7k views

How to calculate the number of cells with a given value?

I have a raster file where all cells have values between -3 and 7, no data value is -9999. How can I calculate the number of cells with a specific value, e.g. 6? Can I use the calculator?
Astrid's user avatar
  • 111
11 votes
2 answers
23k views

How to calculate the difference between two rasters in QGIS?

I have two similar rasters of the Mount Vesuvius and surroundings: one spans 20 kilometers, and the other one 50 kilometers. The two rasters are overlapping: What I would like to do is to create a ...
marco's user avatar
  • 1,137
11 votes
1 answer
1k views

Cube root on ArcGIS raster calculator?

How I could extract a cube root of the multiplication of 3 rasters in raster calculator? Eg: cuberoot (ras1 * ras2 * ras3)
Paulo André Tavares's user avatar
11 votes
1 answer
3k views

Using variable in graphical modeler for raster calculation? (QGIS 3.8)

I am trying to create a flow in the graphical modeler using a variable in a raster calculation. Is there a way to use a variable directly in the raster calculator (SAGA or GDAL)? I know there was a ...
Deepmir's user avatar
  • 145
11 votes
1 answer
1k views

r.mapcalc does not give output in QGIS

For a while now I have been trying to use r.mapcalc from the QGIS Processing Toolbox. However, the algorithm does not give me any output. I have tried several raster layers and different expressions, ...
narra89's user avatar
  • 465
10 votes
4 answers
12k views

Rounding pixel values of raster in QGIS

I have a raster with float number values for example: 2.544459104537964 and I want to round these up to integers. I have seen other posts on ArcGIS like this one but when I use Raster Calculator in ...
Stelios M's user avatar
  • 695
10 votes
1 answer
15k views

Conditional calculation in QGIS Raster Calculator

Is it possible in QGIS either directly or via plugins to do a raster calculation including an if statement? e.g., if raster1 > 0.3, then raster 1 * raster 2, else raster1 x raster3... something ...
Kyle's user avatar
  • 437
10 votes
1 answer
2k views

Calculating distance from points to different class in raster using ArcGIS Spatial Analyst?

I am looking for some advice on how to calculate the distance from a point to a different class of a raster. Specifically, I have observations (points) of animal use overlaid on land cover data. ...
James's user avatar
  • 155
9 votes
1 answer
5k views

Evaluating raster calculator expressions from console

How can I execute from the console an expression that should be used with the raster calculator? I'm searching for something like this: qgis.someRasterCalcClass.evaluate("boh@1 + boh@2", "outputfile....
diegogb's user avatar
  • 623
9 votes
2 answers
9k views

Specifying field in attribute table with raster calculator using ArcMap

How can I specify the attribute field to use in the raster calculator of ArcMap 10.2? In 9.x, I used the dot notation. i.e. To use the "New_Value" field, I could do the following: [MyRaster]....
derelict's user avatar
  • 1,405
9 votes
2 answers
905 views

Rules of Nodata value?

What are the arithmetic rules that govern Nodata values? Regardless of how these null values are defined? I am using ArcMap Raster Calculator. I am thinking specifically of operations like 1*Nodata (...
user32882's user avatar
  • 3,514
9 votes
2 answers
6k views

Using individual bands from multi-band image in ArcGIS raster calculator?

I'm trying to use individual bands from a multi-band TM image (IMG file) within the raster calculator in ArcGIS 10 (SP2/3). I can add individual bands to my MXD, but raster calculator will only use ...
Jesse Cleary's user avatar
8 votes
2 answers
16k views

Normalize raster values to 0-255

I need to normalize the values attained from a band ratio to 0-255. I'm using QGIS. How do I do this? Any ideas?
vascobnunes's user avatar
  • 5,540
8 votes
3 answers
3k views

30,000 data points... can this be reasonably served using openlayers?

I'm trying to tackle a web GIS problem and need to figure out the best strategy. I have a map with 30,000 cells on it forming a grid for the province of Alberta. I have a list of data points for ...
Noah Purves-Smith's user avatar
8 votes
3 answers
3k views

How do I generate a random raster (or probabilistic cellular automaton) in QGIS?

I'm trying to create something like a cellular automaton land cover change model using QGIS, in which cells randomly change land cover based on probabilities determined from various input rasters. I'...
user1521655's user avatar
  • 1,319
8 votes
3 answers
7k views

Why does every raster calcuation I try return with NAN values?

I am trying to work with DEM rasters from the USGS using the raster calculator. I have tried to change the units from meters to feet using an expression such as: "ned10m45111h8@1" * 3.28 However ...
Hayden's user avatar
  • 91
8 votes
1 answer
5k views

Making new raster using con() script and ArcPy

I'm new to Python and have been trying to code a raster calculator style script. Basically, I want to convert a raster that has values 0 to -10,000 into a raster that is populated by 1s between ...
user12433's user avatar
8 votes
1 answer
1k views

Changing class of one pixel in classified image

I have a classified image (I did it in ERDAS) with six categories. There are some misclassified pixels (especially high-density urban category). Is there any way that I can choose one pixel and then ...
Zeinab's user avatar
  • 137
7 votes
3 answers
15k views

How to standardize raster output from 0 to 100 using raster algebra?

I am working on generating an integrated moisture index based on the following equation: IMI = (hill shade * 0.5) + (curvature * 0.15) + (flow accumulation * 0.35) Iverson et al. 1997 Another ...
Aaron's user avatar
  • 51.6k
7 votes
3 answers
6k views

Rounding raster values in QGIS raster calculator?

Is it possible to round raster value in QGIS to a given number of digits? I have raster data with temperatures as values but the authors have made the values Celsius * 10. That is, a temperature of 2....
user80287's user avatar
  • 111
7 votes
1 answer
909 views

Calculating urban areas that need pharmacies using QGIS?

I'm very new in QGIS. The task is to calculate the urban areas that has lack of pharmacies. I have buildings points with apartments count and existing pharmacies points. Then I made two raster ...
Egor Ivanov's user avatar
7 votes
1 answer
6k views

How to exclude outliers from raster using ArcGIS for Desktop?

I calculated terrain curvature from a DEM. The DEM I use is interpolated from point elevation data. Generally, the DEM seems to be good, but some artifacts from interpolation exist. Those artifacts ...
donodarazao's user avatar
7 votes
1 answer
264 views

Raster calculator reclass 0 as 0 QGIS

I want to process a raster with values 0-16. I want to set all values between 1 and 15 as 1, a value of 16 as 0 and cells with a value of 0 as 0. How do I maintain a cell value of 0? I have tried ...
Christine 's user avatar
7 votes
1 answer
5k views

Summing pixel values from several raster layers with partial overlap in QGIS?

I have several presence maps (rasters values 1 and 0) from different species. They are all from South America, but they do not have the same extend (i.e., different sizes). So, I am trying to ...
Fran Astorga's user avatar
7 votes
2 answers
3k views

Cell Statistics calculation in QGIS

Cell Statistics in ArcGIS will calculate the mean (or statistic of choice) among multiple rasters on a cell-by-call basis. Can QGIS do this and, if so, how?
Tom C's user avatar
  • 99
7 votes
2 answers
3k views

gdal_calc - How to calculate where raster A is not equal to raster B?

I have two binary rasters with values NaN and 254. I want to generate a new raster that consists of the pixels that have value NaN in raster A and 254 in raster B and vice versa - those should be 1, ...
bellackn's user avatar
  • 241
7 votes
1 answer
8k views

SAGA tools in QGIS only allow save as .sdat file?

I'm just beginning to learn how to use SAGA 2.1.2 tools within QGIS 2.12.1 on a Windows 7 64 bit computer by working through exercises in Mastering QGIS by Menke et al. (https://www.packtpub.com/...
Terry Morse's user avatar
7 votes
1 answer
4k views

Change NODATA pixel value in raster to arbitrary value

I want to change the value in all pixels that are currently 0 to 800 in QGIS 2.6.1. 0 is listed as the no-data value in Properties > Transparency. I have unchecked the No Data Value box there. Then I ...
JFB's user avatar
  • 71
7 votes
1 answer
834 views

Calculate Volume over sloped ground in GRASS GIS

I am trying to do some volume calculations on a DEM with GRASS GIS. However, I believe r.volume measures everything from 0. The ground underneath the pile I'm measuring is sloped. I would ...
cndnflyr's user avatar
  • 3,372
7 votes
1 answer
2k views

How to calculate a standard deviation across multiple raster layers?

I have 15 raster layers. Each one shows accumulated precipitation (rainfalls) for the month of April for the same US state during a given year. So, I cover the period from 1997 to 2012. I would like ...
Bap's user avatar
  • 983
7 votes
1 answer
886 views

Multiple conditional statements for raster calculation in R

In the context of a RUSLE erosion modelling I would like to calculate the sum of precipitation at the entry date of phenological phases. Suppose I have 13 grids, one of which is the phenophase entry ...
nilsoleplambeck's user avatar
6 votes
2 answers
6k views

how to get max and min from a raster using arcpy?

I have a land surface temperature raster file and I want the max and min of it. minLSTresult = arcpy.GetRasterProperties_management(raster_result, "MINIMUM") minLST = minLSTresult.getOutput(0) ...
Yitongjj's user avatar
  • 125
6 votes
5 answers
22k views

Normalizing raster using raster calculator in ArcGIS 10.3.1? [duplicate]

I have been trying to 'range standardise' or normalise my raster values from 0-100 and I know how to do this mathematically: ("raster"-min("raster"))/(max("raster")-min("raster"))*100 and I have ...
tda's user avatar
  • 531
6 votes
1 answer
14k views

Removing pixel values below 0 in Digital Elevation Model in ArcGIS for Desktop?

I made a DEM layer from a .las file (LiDAR). How can I remove the black area which contains negative values? Is it possible to set these values equal zero or null?
user28541's user avatar
  • 201
6 votes
1 answer
3k views

Raster Calculator making incorrect calculations in ArcGIS Desktop?

I am trying to use raster calculator (ArcMap 10.2.2.3552) to apply a poisson generalized linear model to estimate species abundances based on elevation. The outputs don't make any sense to me, and I'm ...
Emily's user avatar
  • 63
6 votes
1 answer
2k views

Performing Raster Calculator functions using Python and open source modules?

I would like to perform mathematical functions similar to those you would use Raster Calculator for in ArcMap, however I'd like to do it in Python without using the ArcpPy module. I have the osgeo ...
Scott's user avatar
  • 177
6 votes
2 answers
2k views

QGIS calculate sum of values in more raster layers

I have cloud masks (rasters) of diferrent days (from sentinel 2a product) and I would like to calculate how many times was some area covered by clouds. My basic idea is put all layers on each other ...
zubro's user avatar
  • 381
6 votes
2 answers
1k views

How to update raster pixel values based on another raster with conditions in QGIS?

I have 2 land cover rasters. I want to update parts of the first raster with values from the second using QGIS. The workflow should be like this: 1. Select values equal to 30 and 34 in the first ...
kaycee's user avatar
  • 465
6 votes
2 answers
723 views

Adding all Binary Rasters in a Directory Using Raster Calculator in a Standalone Python Script

I have a directory with binary raster files (1 band only) which I need to add in a standalone python script. The problem is the rasters have different number of rows and columns and different ...
ELD's user avatar
  • 507
6 votes
3 answers
9k views

Changing raster cell values within polygon using QGIS GUI

How do I change the values of raster cells which are within a polygon, leaving all cell values outside the polygon unchanged? I would like to subtract 1.5m from each raster cell value within the ...
ffinnm's user avatar
  • 438
6 votes
2 answers
716 views

Automating creation of toe of slope from DEM using ArcMap

I was looking for an automated process to "identify" the toe of a slope from a DEM and ran across this Esri thread and technique: I am at Step 7 but have no idea how this is accomplished. I ...
user24614's user avatar
6 votes
3 answers
3k views

Adding two raster datasets that overlap while maintaining extent of larger raster dataset?

I am using ArcMAP 10.0 How do I add two raster datasets that overlap while maintaining the extent of the larger raster dataset. I have thought of adding zero values to the smaller raster to then be ...
Jordan's user avatar
  • 113
6 votes
2 answers
16k views

How to use OR in a CON statement, in the ArcGIS Raster Calculator?

I'm trying to compare two rasters, and create an output based on a formula like: if raster1 > 10 or raster2 < 20 then raster3 = 30 How can I specify the OR in the raster calculator's CON ...
Stephen Lead's user avatar
  • 21.1k
6 votes
2 answers
3k views

How to calculate a new raster based on nodata values from original raster, in QGIS?

I'm using the raster calculator from core in QGIS and I need to generate a new tif raster file (mask) from the nodata values of another tif raster file. I tried isnull(), but no luck. Any one can help?...
vascobnunes's user avatar
  • 5,540
6 votes
2 answers
4k views

Calculate multiple bands average raster in QGIS with high number of bands

I am a new user of raster layers in QGIS. I need to generate a new raster file with the average value for each pixel, from a raster file with 600 bands. The average has to be calculated from all the ...
Filippo's user avatar
  • 61
6 votes
1 answer
6k views

How to use maximum and minimum operator in raster calculator QGIS

I would like to normalize a raster, using the raster calculator in QGIS 3.x but I don't know how to use the maximum and minimum operator. I have tried the following sequence but it does not recognize ...
Alejandro Chamizo de Castro's user avatar

1
2 3 4 5
25