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
0 votes
0 answers
53 views

Deleting specific pixels in ArcGIS Pro?

I am trying to delete pixels in ArcGIS Pro, but could not get how to achieve it. In the screenshot shared below: The white pixels encircled in orange markers are the ones I want to delete. I did try ...
user avatar
0 votes
0 answers
142 views

Using Raster Calculator Con(isnull) with ArcMap

I am using ArcMap 10.4.1 and the Raster Calculator to subtract polygons of clouds, land etc from my DEM. I use the statement: con(isnull, Cloud, DEM) and set the processing extent to environments of ...
user avatar
4 votes
1 answer
387 views

Conditions in QGIS Raster Calculator to replace value

How can I write something like the sentence below in QGIS Raster Calculator? Con(condition, true, false) or, more precisely Con(raster1 == x, raster1, raster2)
user avatar
  • 41
1 vote
1 answer
281 views

arcgisscripting.ExecuteError: ERROR 010416: Error in setting raster table filter for raster. Failed to execute (Con)

I am having trouble figuring out which Con() statement is the correct one, or if my renaming is incorrect. Full code below # Name: Ortho4Calculator.py # Description: Performs map algebra on individual ...
user avatar
0 votes
1 answer
49 views

Filling no data in raster using focal statistics in batch in ArcMap

I know how to use the below python script to fill no data in a single raster using focal statistics, but I have a series of rasters, I do not want to run the script one by one. Can any people tell me ...
user avatar
0 votes
0 answers
18 views

How to create two layers with different criteria from a raster layer

I have one raster layer I also turned into a slope layer. I need to create two rasters with different criteria ( first one needs specific slope and elevation, second needs just elevation) what tool ...
user avatar
1 vote
1 answer
55 views

ArcPy syntax for nested Con statement

I am trying to convert a process usually used in ArcGIS Tools to arcpy in a Jupyter notebook. I have a very long Con statement that basically takes all the values of 10 rasters and adds them together....
user avatar
1 vote
1 answer
55 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 ...
user avatar
0 votes
1 answer
45 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 ...
user avatar
0 votes
0 answers
23 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" ...
user avatar
-1 votes
1 answer
55 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?...
user avatar
1 vote
0 answers
57 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 ...
user avatar
0 votes
2 answers
439 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"...
user avatar
  • 13
2 votes
1 answer
3k 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 ...
user avatar
  • 323
0 votes
1 answer
41 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 ...
user avatar
1 vote
0 answers
106 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 ...
user avatar
  • 11
2 votes
2 answers
213 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 ...
user avatar
0 votes
0 answers
43 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 ...
user avatar
1 vote
1 answer
96 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 ...
user avatar
  • 37
1 vote
1 answer
285 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 ...
user avatar
  • 37
1 vote
2 answers
235 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", ...
user avatar
0 votes
1 answer
51 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 ...
user avatar
2 votes
1 answer
210 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 ...
user avatar
  • 21
0 votes
0 answers
37 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 ...
user avatar
0 votes
1 answer
33 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 ...
user avatar
  • 249
3 votes
2 answers
4k 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 "...
user avatar
1 vote
1 answer
284 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 ...
user avatar
  • 145
1 vote
1 answer
107 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 ...
user avatar
  • 11
1 vote
1 answer
80 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....
user avatar
2 votes
0 answers
58 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. ...
user avatar
  • 433
1 vote
0 answers
42 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) ...
user avatar
  • 19
1 vote
0 answers
222 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" ...
user avatar
  • 780
1 vote
1 answer
2k 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 ...
user avatar
  • 853
2 votes
1 answer
559 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....
user avatar
  • 371
2 votes
0 answers
27 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 ...
user avatar
  • 81
0 votes
1 answer
581 views

Con tool not working In ArcGIS Desktop 10.5?

I have a raster dataset [Flow Accumulation Raster]. Which is located in gdb. I need to perform Con Tool operation with this raster dataset. The Con Tool operation runs successfully with this dataset ...
user avatar
  • 133
1 vote
1 answer
297 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 ...
user avatar
  • 83
1 vote
0 answers
188 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("...
user avatar
  • 101
0 votes
1 answer
508 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 ...
user avatar
0 votes
2 answers
514 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 ...
user avatar
  • 735
1 vote
2 answers
315 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 ...
user avatar
  • 735
1 vote
2 answers
94 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 ...
user avatar
  • 566
1 vote
1 answer
333 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?
user avatar
1 vote
1 answer
477 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 ...
user avatar
  • 15
1 vote
1 answer
58 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) ...
user avatar
1 vote
1 answer
195 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])
user avatar
  • 11
2 votes
1 answer
1k 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 ...
user avatar
  • 3,266
1 vote
1 answer
78 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 ...
user avatar
  • 45
1 vote
0 answers
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 ...
user avatar
1 vote
1 answer
569 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: ...
user avatar
  • 149