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 [raster-calculator]

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

1
vote
2answers
300 views

Producing raster A + B where A and B intersect, and A where they do not, using QGIS?

I have a raster A (a heightmap created from a contour file). I also have created a vector layer with some polygons which I rasterized into raster B. Raster B is completely contained within the extents ...
3
votes
2answers
79 views

Computing NDVI in ArcMap from Landsat 8 “Analysis-Ready” Surface and TOA Reflectance Products

The internet is full of various contradictory advice on corrections one can make to get NDVI computed from Landsat 8 to fall between -1 and 1. This is for instructional purposes, so I hope to use ...
0
votes
0answers
14 views

Intersect multiple binary rasters based on certain criteria in ArcMap

I have multiple binary raster image (0.1). For example if I have n images, how can I extract the pixels that has the value of 1 and frequently occurred " the same pixels" in 70% of the n images (for ...
1
vote
1answer
52 views

Using ArcGIS Pro raster calculator to give cell value based on cells in its neighborhood?

I have a land cover dataset, I want to find forested cells that are adjacent (touch) agricultural cells. Is there a way I can achieve this with the ArcGIS Pro raster calculator?
0
votes
1answer
19 views

Extract one specific value by resampling via rastercalc

I am trying to extract specific areas from the following image: The grey areas are those of interest, they have a distinct RGB-value of 220-220-220. Thus, in my logic, the following code should ...
0
votes
1answer
12 views

GDAL Calc Set Specific Values to Another Number

I have a GeoTiff raster with a format of Float32 and values 0.00 to 5.00. I am attempting to change all raster cells with a value below 0.10 to 0.10, and leave all other cells in the raster dataset ...
0
votes
1answer
31 views

Max value for each cell

I am using ArcMap. I have 12 raster layers with coincident pixels, which have different values. I would like to, for each pixel location, pick the pixel from all 12 rasters which have the same value. ...
0
votes
2answers
35 views

Raster Symbology Calculate Area Acres

Using ArcMap, I am trying to classify/consolidate the symbology of these agriculture classes into 3 categories: Hay, Pasture/Grass, and Cropland. I also need to find the sum of acres of each of these ...
1
vote
1answer
25 views

PyQGIS problem with QgsRasterCalculator CRS definition

from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry import processing from osgeo import osr, gdal from gdalconst import * dataset1 = gdal.Open(input1, GA_Update) band1 = dataset1....
0
votes
1answer
132 views

How do I input this function to “Raster Calculator” in Model Builder , in ArcGIS 10.2? [closed]

The raster files that function refers are as follows: Precipitation (o “Raster” in figure 1): Variable CN_2S_7ma: Constant CN_8S_7ma: Constant The mathematical function that must be entered is as ...
3
votes
1answer
265 views

Selecting raster cells by multiband values in QGIS

I have a raster of roads saved from a WMS, this a multiband raster. Its red(main) an grey(back) roads. When using the raster calculator I can select most of the red road by using: Band@1 > 200 ...
3
votes
2answers
129 views

Raster Subtraction with QgsRasterCalculator in PyQGIS

I'm trying to do a simple subtraction of 2 raster layers using QgsRasterCalculator in PyQGIS. I've searched around and thought I nailed it but the code below didn't yield anything, but there wasn't ...
2
votes
1answer
209 views

Why QgsRasterCalculator result is incorrect in pyqgis?

I want to sum 4 raster layers by QgsRasterCalculator. Below code creates a raster layer as result, but pixel values in raster result is wrong. what is the error in this code? from qgis.core import * ...
1
vote
1answer
70 views

Why doesn't anything happen in using QgsRasterCalculator on a list?

I have a list of raster layers that I want to do a calculation on each layer with QgsRasterCalculator. My code is: lstLyr = self.readRasters() for layer in lstLyr: registry = ...
0
votes
1answer
29 views

Switching Mars DEM elevation values from negative to positive?

I'm using a DEM of Mars I got from UA's HiRISE website, and I want to convert it into an STL for 3D printing using the DEMto3D plugin. However, the raster values are all negative, so I thought I ...
0
votes
1answer
32 views

Divide all values in ASCII table (or raster file)

I have a pile of ASCII files representing 5min radar precipitation sums. The information is given in 1/10 mm which I need to convert into mm for further processing. Is there a way of doing this, ...
1
vote
1answer
48 views

Adding two rasters in modeller

I'm trying to build a process model which uses a series of raster operations - Rasterize, Proximity, Raster Calculator. However, I couldn't seem to add two consecutive raster calculator processes. ...
1
vote
2answers
55 views

QGIS - raster calculator syntax

I am having problems using the raster calculator. Some pixels of my GeoTIFF file have the value 255 on bands 1, 2 and 3. I want to replace this value with 0 on the three bands. I tried with this ...
2
votes
1answer
30 views

Sum multiple rasters using raster calculator, the result raster had a larger cell size?

I have 365 rasters (daily) and therefore I summed them to form an annual raster using raster calculator in Arcgis. The original cell size of daily raster is 5*3.75 (col 72, row 48), while the cell ...
2
votes
1answer
142 views

Which output data type to choose in QGIS SAGA Raster Calculator in Batch Mode?

I have 5 years of MODIS13Q1 NDVI .tiff images for time series analysis. I want to multiply all the images with the scale factor of 0.0001 before using them. In order to process all at once I try to ...
1
vote
2answers
267 views

Applying SetNull to multiple values at same time (array) gives Syntax error?

This is not working I've got this error: I've tried several combinations: SetNull("rocksoilver12"==10 OR "rocksoilver12"==14, "rocksoilver12") SetNull("rocksoilver12"==10 or "rocksoilver12"==14, "...
3
votes
4answers
1k views

Using QGIS Raster Calculator with two different rasters

I have several maps like this one: And with the proximity tool and a coastline shapefile I made this output, representing the distance to shoreline: Now, I want to combine both using the Raster ...
3
votes
1answer
176 views

If statement using QgsRasterCalculator?

In the sequence of my previous question (Can't use Raster Calculator with two different rasters), I am stuck again in my project. With my source rasters, I created 3 different outputs using the ...
0
votes
1answer
148 views

How calculate vegetation indexes with GDAL raster calculator

I want to calculate a few of vegetation indexes [ example: NDPI (red band-green band)/(red band + green band)] in a model with the GDAL raster calculator but I don't know how put the equation here:
2
votes
1answer
36 views

Replace the empty cells of one raster with the values of a second raster

I have 2 rasters with the same extent. In the first raster, there are a lot of empty cells that I want to replace by the values of the second raster. I have tried Raster calculation with the following ...
1
vote
1answer
46 views

QGIS 3.6.2 with GRASS - raster calculator - Raster1 + Raster2 returns missing pixels

I have 5 large point datasets (shapefiles) and I'm interested in getting a heatmap on the combination of all 5 point layers. I use the QGIS heatmap tool to create a heatmap on each layer. This is ...
0
votes
0answers
17 views

Losing raster quality when using raster calculator (ArcGIS Desktop 10.5.1)

I'm currently working with DEM rasters that I hillshaded. The data I received contain nodata borders, probably the footprint of the originial mosaic dataset. As I received them separately, I can't ...
0
votes
1answer
207 views

Curve Number equation in ArcGIS Raster Calculator?

I have a floating point raster of Curve Numbers (70-91) and I'm attempting to use the curve number equation to create a weight raster for flow accumulation, to determine runoff for a single rainfall ...
0
votes
2answers
19 views

Performing Raster Calculation?

This is my formal: ("Standort_ger_fre_mosaic" ^ 0.4) * ("Habitattradition_raster_rec.tif" ^ 0.3) * ("Vollständigkeit_rec.tif" ^ 0.1) * ("Vorkommen_ungestörter_Lebensräume_rec.tif" ^ 0.1) * ("...
2
votes
0answers
32 views

Writing Raster Calculator Expression?

I use ArcMap 10.3. How do I create an expression in RasterCalculator that allows me to sum up 4 rasters (every pixel has an associated value) and the result to be 0 if any of the 4 values is 0? For ...
0
votes
1answer
22 views

Creating new raster with minimum (or maximum) value betwen two rasters in ArcMap?

I am using ArcMap 10.3. I have two temperature rasters from two months. I need to create a new raster from these, but the new raster should have in each cell the maximun value betwen the initial ...
1
vote
1answer
83 views

Way to transpose raster values on the fly in QGIS

Say, I have a raster with some annual statistics data. Then Daily avg = Annual / 365 Weekly avg = Annual / 52 Monthly avg = Annual / 12 I know I can do this via Raster calculator in QGIS (v2.18.15)...
2
votes
1answer
30 views

Raster calculator - set default output path - QGIS 3.4.6

Raster calculator: How can I set the default output folder? By default it's set to "C:\Program Files\QGIS 3.4\bin" I'm using QGIS 3.4.6
2
votes
0answers
38 views

Confusing result of raster calculator in QGIS

I'm confused about the results that I get from the raster calculator in QGIS. I'm trying to delete the cells of a raster who are prone to flooding. However, a part of my raster is wrongly classified ...
1
vote
0answers
12 views

Discrepancy between raster calculator and geomorphic change detection elevation change results

I am using two rasters to determine the elevation change in a stream channel. When I used the Geomorphic Change Detection Software add-in (version 7.4.1), I got a high elevation change of 8.8 ft and ...
0
votes
0answers
35 views

From raster to polyline in QGIS

I'm trying to extrat ridges from ALOS images on qgis. I would like to have polylines so I can use the plugin AutomaTracks from Sebastien Peillet. I did inversed the MNT using raster calculator then ...
5
votes
1answer
2k views

Calculating Topographic Exposure with ArcGIS Raster Calculator?

I need you help trying to calculate Topographic Exposure (TOPEX) on a DEM in ArcGIS. I am trying to figure out wind exposure on a DEM with 25m cells. There is a great blog post where someone explains ...
2
votes
1answer
39 views

Counting .tif value in polygon in QGIS

I am trying to count raster values (from a .tif file) in polygons. In previous posts that people suggested using the 'zonal statistics' plugin in QGIS. However, I couldn't find it in my plugin manager ...
1
vote
1answer
1k views

Raster Calculation in Qgis using Python Script

I want to do raster calculation over raster layer for which i am using python script as: from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry bohLayer = qgis.utils.iface....
-1
votes
1answer
252 views

Resolving formula error in raster calculator of ArcGIS Desktop?

I have a problem with a formula to calculate the susceptibility to landslide that gives me errors when computing with "raster calculator" in arcgis 10.1. The formula is exact but errors in the ...
1
vote
1answer
39 views

Ordered weighted averaging error QGIS

I am trying to use Ordered weighted averaging to sum up values across different raster overlays in QGIS 3.4.4, but I get this error: Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.4/...
1
vote
1answer
122 views

Calculate percentile value of raster

I want to set null all raster values that fall below the 75th percentile value. E.g. If you classify the raster by quantile method into 4 classes I want to be left with the top 25% percentile. For the ...
0
votes
1answer
30 views

ESRI Raster Calculator error “Con()”

I"m trying to nest expressions in this raster calculator conditional statement, but I get an error. This statement works, so I tried to follow it as a template: Con (IsNull("ras1"),"ras2","ras3") ...
5
votes
1answer
1k views

Rescaling NDVI values 0-255 to [-1;1] using ArcGIS Raster Calculator?

How do I rescale NDVI values that are 0-255 to -1;1? I'm trying to do it in ArcGIS Desktop.
1
vote
1answer
43 views

Solving ERROR 000732: Input Raster: Dataset Con( does not exist or is not supported in for loop? [duplicate]

I'm trying to reclassify rasters based on standard deviation. I created this code, but I think I'm wrong using "Con". I would like to assign value 1 to rasters >= to threshold and rasters <= to ...
0
votes
1answer
60 views

ArcMap Raster Calculator with Python code

I'm trying use raster calculator that can export a raster to do different average values for for multiple layers. For example, I want to do averages for only the values and layers that are greater ...
1
vote
1answer
59 views

Getting QGIS Model Processing Raster Calculator Error?

I am using "raster calculator" tool of the saga in my model. The tool correctly executes raster operation like "a * 2" in value formula option but the same expression is not executed pre-calculated ...
2
votes
1answer
54 views

Getting rid of cells of 0 values in raster using QGIS?

I have a DEM like below image. The black area shows 0-values. I want to remove cells of 0-values in the raster.   In raster calculator, I wrote con("demclip_re@1">0,"demclip_re@1") but it gives "...
1
vote
0answers
135 views

QGIS RASTER CALCULATOR - Getting the Minimum and Maximum Values of a Raster Layer

I try to work with the minimum and maximum values of a raster layer in the raster calculator in QGIS 3.6. I try to do the following formular: ( @RasterCellValue - @RasterMinValue ) / ( @...