# Questions tagged [raster-calculator]

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

1,241 questions
Filter by
Sorted by
Tagged with
1 vote
33 views

### Getting -inf values when calculating zonal statistics from raster layer in QGIS

I am trying to get some summary statistics from a raster layer (CRS EPSG:3035 - ETRS89-extended / LAEA Europe - Projected) of forest biomass for each polygon in a shapefile layer. I have used the ...
27 views

### Introducing formula in Raster Calculator of ArcGIS Pro

What is the correct way to introduce this formula in the raster calculator? It is the formula in order to calculate m-coefficient for L factor for RUSLE model. O = slope in degrees I tried multiple ...
34 views

### Spatial Join to calculate basic statistics For multiple locations

I am using QGIS and looking at multiple businesses (purple dots), and water levels (the grey behind them). I am trying to calculate the average water level within x feet of each business (purple dot)....
12 views

### Base on land cover data to get plant functional types(PFT) by using GEE, but get something wrong

By using .reduceresolution() and ee.Reducer.mean() to reduce resolution from 10m to 10000m.But the result looks like taking the most distributed elements in the area and assigning them to new pixels. ...
1 vote
43 views

### How do I use the Raster calculator to extract all cells that have one of a number of values?

I'm using QGIS3. I have a raster layer for Koppen Geiger climate which has one band with values ranging from 1, 30. I want to make a new raster with only cells which have a value of the climates I am ...
16 views

### Top of Atmosphere of Landsat 8 bands

I am trying to calculate the Top of Atmoshpere using the corresponding coefficients. The raster calculator in ArcGIS however is giving me incorrect results. The formula I am using is ((0.00002 * .tif ...
1 vote
27 views

### QGIS Graphical Modeler - Altitude offset / translation - Something wrong with my raster calculator (gdal) expression

I've recently started exploring QGIS' Graphical Modeler, and I want to build a model that will: Iterate over a vector layer's features Use these features as masks to extract from a raster Calculate ...
23 views

### How to remove values from raster band QGIS

I recently did a land use land cover analysis using the semi automatic classification plugin in QGIS. While I am satisfied with the produced raster there are a bunch of classes that are not relevant ...
49 views

### How to merge raster classes using the raster calculator?

I need to do an analysis on landscape change for which agriculture is involved. In my raster they are defined as six different classes which is not relevant for my research I was wondering if you can ...
23 views

### How to obtain a suitability map by combining an exclusion map and weighted overlay map

I currently have 2 map outputs (1) A classified map (weighted factors) (2) An exclusion map I intend to obtain a suitability map by combining the map 2 (the exclusion map) with map 1 (the weighted ...
35 views

### Raster calculator gives black map output when excluding values

I'm trying to generate an exclusion map from 7 layers of raster having values of zero and one. The zeroes represent the unsuitable area while the ones represent the suitable area. with this, I'm ...
18 views

### Add a value to a raster layer in ArcGIS

I have various different species distribution models, whose output shows expected presence or absence as species over an area. For each species, I have a metric of vulnerability to anthropogenic ...
27 views

### Raster calculator in QGIS returns 8.367e-11 instead of zero

I've a raster layer with nine classes, values 1 to 0.05. In the processing toolbox-raster analysis-raster calculator of QGIS, version 3.28.9, I've used the formula: 0.00872-(raster layer*0.00872) Now ...
25 views

### gdal VRT pixel function keeps rounding output to int

I created a VRT with pixel function in Python that computes a logarithm of the pixel value. When I convert it to TIFF with gdal_translate the generated TIFF only has rounded values and drops the ...
1 vote
26 views

### Raster calculator or translate with vrt output in PyQGIS

I have a 1 band, 8 Bit raster. I can map all pixel values apart from 0 to 1 with the raster calculator expression if ("rasterlayer@1"=0,0,1). However, it does not seem to work with vrt ...
11 views

### How to extract layers from two rasters based on a single parameter from each layer in QGIS

I am working in QGIS with two WMS raster layers describing my city. One layer has a city planning. Other layer has ownership information of each plot. I can see both layers combined with colours. When ...
45 views

### ImportError when importing QgsRasterCalculator in QGIS

I'm running QGIS 3.28.8 on Windows 10, Python 3.9.5. In the Python interpreter when I run from qgis.core import QgsRasterCalculator I receive the following error: ImportError: cannot import name '...
1 vote
45 views

### Calculating values from two rasters using QGIS Raster Calculator

In QGIS I'm trying to write an expression in the Raster Calculator, but I have failed so far. It should go like this: R1 and R1 are input rasters, RN is output raster. if R1=0, OR R2=0, then RN=0 if ...
55 views

### Sum of the Raster Cell Values Located in the Polygon

I have two layers: The first one is a raster containing values of built covered area for example it has 100x100 (10000 meter square) cells if the cell carries the value 1328 it means that in that ...
28 views

### Swap raster pixel values in with PyQGIS

I have a raster with one band and pixel values 0 and 1 (palletted symbology), which I simply want to swap. I have done it as follows in the GUI. How could I translate this to PyQGIS (and I guess there ...
1 vote
50 views

### ArcGIS Pro - Raster Calculator Percentiles - conditional

I want to 'cap' the values of a raster if it exceeds the percentile value. For example if the 95th percentile value of the raster was 10000, then anything at or above that value would be assigned a ...
78 views

### Calculating bamboo index

I am working on my project on bamboo distribution using RS. As per the literature, I found that bamboo indices is calculated as: BI = (NDVI-SI)/(NDVI+SI); Where NDVI is vegetation index and SI as soil ...
1 vote
42 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 ...
73 views

### Gaussian in QGIS: SAGA vs Native Tool

I have been using SAGA Gaussian Filter to apply a filter to a raster layer, but for reasons I would like to use native QGIS tools if there is an equivalent. There is a tool called Fuzzify raster (...
32 views

### Error using the raster calculator

I have been using the raster calculator today to filter the relevant classifications for my data. My analysis spans over several rasters containing data from different years. I have been using it ...
17 views

### Areas don't add up using Raster Calculator & and Tabulate Area

I'm using & (AND) in Raster Calculator for two rasters and then using Tabulate area to work out the area of each in a polygon layer. But the amount in the resulting table is more than the amount ...
83 views

### Calculate overall area of physically discrete raster areas in QGIS

I need to get the overall area of physically discrete areas of a raster layer up to a given cell count in QGIS. The following approach is what I've tried so far, but it seems a bit too complicated and ...
39 views

### Reset the NODATA to negative value error

I have a requirement for converting NODATA to value -3 with my floating point data. I have tried to reset NODATA by using Raster Calculator with the formula of Con(IsNull("tif"),-3,"tif&...
60 views

### How do I create a polygon layer of high slope (>58%) area from a DEM in ArcGIS Pro

I am hoping to get from a slope raster (calculated from a 10m resolution DEM) to a polygon of areas above a certain grade (58%). I am using ArcGIS Pro 3.1. I have used the Raster Calculator tool to ...
48 views

### Error while using Raster Calculator to calculate NDVI in QGIS

I exported 2 raster bands of Sentinel II (band 4 and band 8) to calculate NDVI (B8-B4)/(B8+B4), these 2 rasters are in EPSG:32630 - WGS 84 / UTM zone 30N. I'm currently using QGIS 3.26.1. When I try ...
116 views

### How to calculate the weighted average of a raster for the pixels touching a layer corresponding to a buffer (ArcGIS Pro)

I have a first raster layer which represents pixels of about 30m by 30m.My second layer corresponds to a circular buffer with a radius of 500m (I calculated the buffer from a point layer) I have a ...
73 views

### Two different "Raster Calculator" tools in QGIS give different results

I am working on QGIS 3.26.3-Buenos Aires on Windows 10 and just realised that it has two different raster calculators. I believe they are both from the standard version, no plug-in. They have ...
11 views

### Establish a least-cost path between a point and a line (coastline)

I have a basic level of knowledge of ArcGis Pro. I need to establish a "least cost path" between a point and a line, which, in this case, is the coastline. What is the procedure?
1 vote
23 views

### Summarize multiple raster layers in a multipolygon in QGIS

I want to calculate an ethnic fractionalization index for the second administrative division in the DRC based on the SIDE-Dataset which can be found here: https://icr.ethz.ch/data/side/. Each layer ...
1 vote
19 views

### ENDISI calculate

I'm new to ArcGIS. Can someone tell me why my ENDISI always equal to 1? My algorithms: ("band02.tif" - 16170.19 * (("band06.tif" / "band07.tif") + "mndwi.tif" ^ ...
24 views

### Use raster calculator for fuzzy triangular function to fuzzify maps

Does anyone have an idea how to use the raster calculator to fuzzify maps with respect to the fuzzy triangular function? I am using ArcGIS Pro. I am a little stuck after using Euclidean distance as I ...
22 views

### How to change the order or sequence of land types in ArcGIS

I am trying to use the raster calculator to compute the landuse land change and to that the raster sequence has the to be the same but what it looks like currently is the following: These maps are ...
52 views

### Raster Calculator in QGIS returns -3.4e10^38 when saved

I'm using the raster calculator with the following formula: "myraster"@1-100 Now if I choose the option save as tiff file the resulting raster consists of cells with value -3.4e10^38 (...
81 views

### Expand a given bathymetry / DEM through interpolation towards 0 depth at coastline polygon

I have a grid of a bathymetry of a fjord (grayscale in the image below). The grid doesn't reach all the way to the coastline (blue polygon) because it originates from sonar surveys where shallow ...
138 views

### How to calculate NDVI difference for two different time periods in QGIS

I have calculated the NDVI of an area of interest for 2015 (Landsat 8) and 2023 (Landsat 9) in QGIS. I want to detect NDVI change between the two rasters by subtracting NDVI values in Raster ...
21 views

### Apply list to every row of image - raster calculator

I have a SAR image. I have a list of noise levels from the metadata. The list applies in the range direction of the image (across the image - perpendicular to the satellites flight path). The list ...
1 vote
25 views

### Write LS equation with conditions

I have two raster layers flowacc and slope. I want to calculate this equation with conditions into the ArcGIS raster calculator: LS = power(flowacc * resolution/22.13),m)*(0.065+0.045*slope+0.0065*...
103 views

### Creating a new raster showing values based on how many rasters overlap

Intro to GIS student here. Hopefully I can articulate this issue clearly: Currently, I have six raster layers that I am trying to create a new layer out of. I think the best way to describe the new ...
82 views

### QGIS graphical modeler and raster calculator

I'm making a graphical modeler that creates me a kind of DSM, like that: I create a DEM for my extent (I have the DEM for my whole country). I have the Lidar for the height of the forest and I ...
1 vote
144 views

### Wrong height values during the subtraction of DSM-DTM in QGIS

I have a DSM and a DTM and want to create Normalized DSM by subtracting DTM from DSM. It is a simple calculation that I can do it in Raster Calculator with the DSM-DTM expression. However, the height ...
123 views

### Set raster values to a specific number

I have a raster dataset with pixel values ranging between 1 and 255. I would like to set 5-255 to 5 and leave pixels with 1,2,3,4 value in QGIS. I know I can use the raster calculator (raster >=5)* ...
82 views

### Sum two rasters to combine a building height raster and DTM

I'm trying to combine two rasters to create a more accurate DEM for some viewshed analysis I need to run- I've got a raster showing building heights and I've got a DTM raster (sourced from OS data). I ...
50 views

### QGIS3 - Maintain resolution of input rasters using raster calculator

In QGIS 3.28.4 after subtracting one raster layer from another using raster calculator, I notice that pixels in the results layer sometimes do not equal the difference between the input layers when ...