Questions tagged [con]

Con is a tool from the ArcGIS Spatial Analyst Toolbox. Con allows you to control the output value for each cell based on whether the cell value is evaluated as true or false in a specified conditional statement.

Filter by
Sorted by
Tagged with
1
vote
1answer
23 views

Constraining raster calculator results

This is in ArcGIS Pro. I will be performing a raster calculation to determine how much a given raster might change over time by multiplying the current raster by the percent projected change and then ...
0
votes
1answer
19 views

Intersecting multiple classified rasters

I have 3 raster files: A transform aspect (TRASP) layer (classified into 2 strata-(0-0.5, 0.5-1)) A canopy cover layer (classified into quantiles-5 breaks) A canopy height layer(classified into ...
0
votes
0answers
15 views

Constructing CON statement in Raster Calculator of ArcGIS Spatial Analyst

I have this expression that works in the QGIS Raster Calculator but not ArcGIS Raster Calculator. How can I reconstruct it? It is a binary raster that I am working with. ("Outputs\Model Fin" ...
0
votes
1answer
25 views

How to write Con expression in Raster Calculator

I want to calculate S factor for USLE model when I tried to run my expression, I met a problem. Con("Slope_Fill_sl" <=5 ,10.8*Sin("Slope_Fill_sl" +0.03 ) Can anyone tell me which part I did wrong?...
1
vote
0answers
33 views

Using Con Statement in Raster Calculator

I am using ArcGIS Desktop version 10.7.0.10450 I have previously used Con statements in the Raster Calculator that now do not seem to work. I did hundreds of these with raster data about five years ...
0
votes
2answers
31 views

Using max cell value as input in Raster Calculator of ArcGIS Pro

I am using ArcGIS Pro 2.4. In the following equation, can "X" be replaced with the maximum cell value of another raster? Alternately, replacing "X" with a field from a table would work. Con("udlen"...
2
votes
1answer
166 views

ArcGIS Raster Calculator Con() set 0 values to null

In some vides appear a process separated and I would like to do this two steps in one step: set all values greater or equal to a number to 0: Con("MyRaster" >= 2800, 0 , 1) the result is called ...
0
votes
1answer
33 views

Failing to use the correct Con expression in raster calculator in ArcMap

So, I am trying to use the Con statement in ArcMap to add a certain value to a raster dataset (raster2) if the data is the same as an other dataset (raster1), if not I should just stay the same. I ...
1
vote
0answers
44 views

Combining 2 rasters using Con and IsNull in Python

I am trying to write a Python script that converts most NoData pixels to 0 in a raster (Raster1 below), except for pixels that overlap with a pixel value of 1 within another raster (Raster2, which has ...
1
vote
1answer
72 views

Replace value in raster by another raster by ifelse (con) statement in QGIS

Previously I spent a lot of time to see answer on similar question but neither work with my problem. I have QGIS 3.4 and a DEM where I've to substitute more accurate height in cells that are ...
0
votes
0answers
40 views

ERROR 000732 using Con in loop?

I've got this process I'm trying to automate that essentially iterates across a set of rasters, runs a con statement on them to put values from a separate raster wherever the first raster has certain ...
1
vote
1answer
52 views

Looping through two raster folders to perform raster calculation gives ERROR 000732?

Last week I asked Looping through two raster folders to perform raster calculation? about a script to loop through two geodatabases and perform a raster calculation by matching the two rasters up ...
1
vote
1answer
94 views

Looping through two raster folders to perform raster calculation?

I have two geodatabases with rasters containing information about "treecover" and "loss". The file names are slightly different but can be matched based on the last 8 characters (the coordinates of ...
0
votes
2answers
120 views

Shift in raster in python 3.6

I have a python script for a color anomaly detection study. I am attempting to create two rasters each with three classes: one raster representing a "target" and the other representing "background", ...
0
votes
1answer
43 views

Getting Con statement in ArcPy to work?

I have a script in Python that includes a series of Spatial Analyst tools. I need to reclassify a raster and have tried using Remap which fails and have also tried a Con statement. The Con statement ...
2
votes
1answer
72 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 ...
0
votes
0answers
31 views

Changing particular value of raster dataset to zero using ArcPy?

I try to change a particular value of raster dataset to zero using python script. When I deal with one raster, it works. Python scripts as follow: import arcpy from arcpy import env from arcpy.sa ...
0
votes
1answer
28 views

Testing for Pixel Agreement in ArcMap [closed]

Say I have 2 rasters with same spatial extent and same resolution and same number of classes: Raster 1: Ground Truth. Raster 2: Result of some algorithm. I want to see what % of pixels have same ...
2
votes
1answer
843 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
1answer
118 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 ...
1
vote
1answer
42 views

How can I set multiple values to null in one raster and replace all other values with another raster?

I am working with Landsat8 cloud data (BQA.tiff). I would like to set all medium and high confidence cloud/cloud shadow values (values listed below) to null and replace all other values in this image ...
1
vote
1answer
53 views

Coding Python about raster calculation for create a toolbox

I want to create a tool box in ArcMap. I wrote this code: # Import system modules import arcpy, os,sys from arcpy import env from arcpy.sa import * # Set input raster InputRaster=arcpy....
2
votes
0answers
43 views

Preventing ArcGIS Desktop from creating 64-bit rasters?

I've run into this issue recently wherein I run the Con tool on a 32-bit raster (TIFF format) to change some absurdly high/low values to 0 and I get a 64-bit raster (TIFF format) out the other side. ...
1
vote
0answers
37 views

Writing conditional statement with CON? [closed]

How can I write the following conditional statement with CON? I want to run all the conditions(simultaneously). IF rasterA>0 & rasterB>0 Then (rasterA+rasterB)-(rasterA*rasterB) ...
1
vote
0answers
181 views

Reclassification and Con(0 not working arcpy [closed]

I have a raster that has three pixel values=0,1,2. I want all pixels of value 2 to be 1. The raster is in tif format, 32 bit signed type. Below is my arcpy script- inRaster1="path address/input.tif" ...
1
vote
1answer
762 views

Building multiple CON statements with OR/AND in ArcGIS Raster Calculator?

I have two raster "T" and "N" which have values ranging from 0 to 1000. This is the logic that I want to query and create the new raster: This is how I tried to query in a syntax-correct way in the ...
2
votes
1answer
246 views

Iterating rasters from two different folders using ArcPy?

I have created a simple script like that, which is working fine import arcpy from arcpy.sa import * arcpy.CheckOutExtension("spatial") arcpy.env.workspace = r'C:/2017/wgs84/project' direction = arcpy....
1
vote
0answers
20 views

Adding small-extent rasters to DEM

My goal: create viewsheds for observers which also incorporate the heights of buildings which could block observer view. This is using archaeological data, and is representing time change -- so I need ...
-2
votes
1answer
401 views

Con tool not working In ArcGIS Desktop 10.5?

I have a raster dataset [Flow Accumulation Raster]. Which is located in a gdb. I need to perform Con Tool operation with this raster dataset. The Con Tool operation run successfully in ArcGIS 10.1,10....
1
vote
1answer
233 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
184 views

Conditional in Raster Calculator

I am trying to perform a classification in Arcmap's raster calculator, but it seems that the use of multiple conditional is confusing me. What am I doing wrong in the following con-statement?: Con("...
0
votes
1answer
440 views

Using CON tool of ArcGIS Spatial Analyst?

I am doing a GIS project analyzing rooftops. I need to isolate North, Northwest, and Northeast facing rooftops. I've had success using the CON tool for other raster layers, but whenever I try to use ...
0
votes
2answers
341 views

How to apply if-else condition on two different rasters to produce another rasters?

I want to create a new raster image which meet certain criteria from two underlying images. I created a dummy raster with each pixel having value = 1. Raster values are to be set to 0 if underlying ...
1
vote
2answers
194 views

Calling variable filename within Con function in ArcPY?

I want to replace the even pixel values of a raster from 1 and rest with 0. Since, I have 100+ raster files therefore, I am calling filenames in loop. I copied the python snippet after applying con ...
1
vote
2answers
83 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
1answer
297 views

Putting multiple condition with more raster to Con tool in ArcGIS Raster Calculator?

I have three rasters and need to make a condition including all of them. The condition should look like Ras1>(Ras2*85 + (Ras3/4)), Ras1 if true, 0 if false. Can anybody here help me to do this?
1
vote
1answer
376 views

Using Arcmap 10.2.2, Con tool and Reclassify not working correctly

So I'm coding in arcpy and trying to process all rasters in a geodatabase and output to a new geodatabase. The steps go Minus(constant - raster), 1 divided by output, times 100. Then Reclassify ...
1
vote
1answer
50 views

Continuously changing values in the same band of a multiband raster

I am having issues with continuously changing the values of pixels within a single band of a multiband raster using python 2.7. Essentially, what I am trying to do is continuously change (increment) ...
1
vote
1answer
179 views

Combining between CON and Focal function in ArcGIS raster calculator?

How do you write this code in the raster calculator for ArcGIS 10.2? CON(FOCALMIN([Burning], WEDGE, 4, 285, 345 ) == -1 , -1, [Burning])
2
votes
1answer
688 views

Con expression in two rasters ArcGIS, raster calculator

I would like to write a condition in ArcGIS 10.1 in Raster calculator. I have 2 overlapping rasters (Ras1.img, Ras2.img) with different attributes in attribute table: Ras1.img: Class - results of ...
1
vote
1answer
65 views

Constructing a Con expression

I have 2 rasters, one representing land-cover and 1 representing trails and roads. I want to use the con function in ArcMap so that my new raster will contain both but the unclassified or wrongly ...
1
vote
0answers
58 views

Using 'Con' to Create Raster Containing Values in Another Raster

I have 2 rasters that I want to combine into 1 raster, so that the 1 raster has values of each of the input rasters. I think that I want to use a 'Con' statement to do this. However, I'm having ...
1
vote
1answer
445 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: ...
5
votes
1answer
207 views

Nested Con statement arcpy

I am trying to combine three conditions into one con statement line: ndvi_adjusted = Raster(ndvi_raw) * 0.004 - 0.08 con1 = Con(Raster(ndvi_adjusted) >= 0, ndvi_adjusted) con2 = Con(IsNull(con1), ...
1
vote
0answers
83 views

Getting values lower than specified using Con, Raster Calculator?

Expression used in raster calculator (ArcGIS 10.2.2 for Desktop): Con(("%NDVI.tif%"> (-0.05)) & ("%Height_2015.tif%" >= 16), "%Height_2015.tif%", 0) I want an output raster containing ...
1
vote
1answer
178 views

Iterate variables in Con statement in Raster Calculator- model builder

I have this formula which works fine in raster calculator on its own. Here is a simplified version of it: Con((("Trial_analysis\winter_pm" == 2)) & ("Wind_directions\winter_pm_WD" <=b) & (...
0
votes
2answers
354 views

Combining non-overlapping binary rasters with ArcGIS Raster Calculator?

The issues I keep seeing depend on unique combinations of values. I have three rocktype raster layers for area and they are edge-to-edge (they do not overlap). They each have "VALUE" fields and "...
1
vote
1answer
311 views

Conditional statement in raster calculator - ArcMap

I'm Just wondering how to incorporate a conditional statement basically to say: if value in raster >= 128, then put in new raster, otherwise make the values null. Basically the purpose of this is ...
1
vote
0answers
209 views

Con statement outputs using arcpy.sa.Con doesn't ignore NoData

In ArcGIS 10.2, using the Con tool, I ran a conditional statement to return RasterA where RasterB value >0. That worked fine. Transferring the code into python, the statement reads something like: ...
2
votes
2answers
82 views

I have slope raster and that is categorized with slope in percentage(%) but my script not successful

I have slope raster and that is categorized with slope in percentage(%) my condition is if slope <= 1 then m = 0.2 1 < slope <= 3 then m = ...