Skip to main content

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
21 views

Marking the location of known raster values within certain polygons

I have a raster dataset of elevation values, and a feature dataset of polygons that delineate certain objects within the raster dataset. I've used Zonal Statistics to create tables of min, max, ...
M.S.'s user avatar
  • 1
0 votes
0 answers
109 views

ArcGIS Pro: Raster Con fails with Error 010423: random temp file does not have valid statistics as required by the operation

What am I trying to do: I am attempting to use the CON function in ArcPy to create a raster of all areas within my area of interest with an elevation between 1600 and 1650 meters above sea level based ...
Sir_Zorg's user avatar
2 votes
0 answers
139 views

Iterate over a list of raster with Arcpy and apply Con() to each raster

I would like to iterate a list of raster objects and apply Con() to each raster. The rasters are in a specific order in the list. That's important. All I want to do is to write the value of the ...
Gero's user avatar
  • 527
0 votes
0 answers
63 views

ArcGIS Pro RasterCalculator python code is very confusing and I have no reference because history "copy as python command" paste just does not work

The code that "copy as python command" copies: output_raster = arcpy.ia.RasterCalculator('Con(IsNull("OMUVBd_003_UVindex_Layer1"), FocalStatistics("OMUVBd_003_UVindex_Layer1&...
highschoolstudent's user avatar
0 votes
0 answers
664 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 ...
Yogesh Chavan's user avatar
0 votes
1 answer
2k 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 ...
Student's user avatar
4 votes
1 answer
2k 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)
nicoc's user avatar
  • 41
1 vote
1 answer
902 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 ...
vceliberti's user avatar
0 votes
1 answer
161 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 ...
Yiqian Zeng's user avatar
0 votes
0 answers
37 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 ...
Shyann Young's user avatar
1 vote
1 answer
122 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....
ChristineF's user avatar
1 vote
1 answer
99 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 ...
Jeff Price's user avatar
1 vote
1 answer
82 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 ...
Arthur_Morgan's user avatar
0 votes
0 answers
38 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" ...
Johnny Smith's user avatar
-1 votes
1 answer
148 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?...
WeiYuan Fu's user avatar
1 vote
0 answers
139 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 ...
Cascade Environmental's user avatar
0 votes
2 answers
1k 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"...
Jim-wy's user avatar
  • 13
3 votes
1 answer
10k 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 ...
Gab's user avatar
  • 413
0 votes
1 answer
48 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 ...
oleskj2's user avatar
1 vote
0 answers
188 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 ...
Ellie's user avatar
  • 11
2 votes
2 answers
307 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 ...
Stefano Menichetti's user avatar
0 votes
0 answers
49 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 ...
ffollett's user avatar
1 vote
1 answer
141 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 ...
seak23's user avatar
  • 191
2 votes
1 answer
756 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 ...
seak23's user avatar
  • 191
1 vote
2 answers
289 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", ...
Anna Riling's user avatar
0 votes
1 answer
56 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 ...
ChristineF's user avatar
2 votes
1 answer
288 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 ...
Greet's user avatar
  • 21
0 votes
0 answers
46 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 ...
Jianxing_Zhu's user avatar
0 votes
1 answer
41 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 ...
Martan's user avatar
  • 249
4 votes
3 answers
11k 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 "...
Jung  TaeJun's user avatar
1 vote
1 answer
465 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 ...
Elisa m's user avatar
  • 145
1 vote
1 answer
176 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 ...
Drew's user avatar
  • 11
1 vote
1 answer
106 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....
Somaye K.'s user avatar
2 votes
0 answers
71 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. ...
user95191's user avatar
  • 453
1 vote
0 answers
47 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) ...
sina's user avatar
  • 19
1 vote
0 answers
233 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" ...
tg110's user avatar
  • 840
1 vote
1 answer
3k 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 ...
the_chimp's user avatar
  • 883
2 votes
1 answer
812 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....
GeoF's user avatar
  • 391
2 votes
0 answers
35 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 ...
Natalie's user avatar
  • 81
0 votes
1 answer
701 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 ...
osman's user avatar
  • 193
2 votes
1 answer
418 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 ...
Andi90's user avatar
  • 103
1 vote
0 answers
197 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("...
chrkes's user avatar
  • 101
0 votes
1 answer
549 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 ...
Dbattagl's user avatar
0 votes
2 answers
609 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 ...
dsbisht's user avatar
  • 695
1 vote
2 answers
385 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 ...
dsbisht's user avatar
  • 695
1 vote
2 answers
110 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 ...
Rex's user avatar
  • 596
1 vote
1 answer
412 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?
vesimies.h's user avatar
1 vote
1 answer
519 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 ...
Lists's user avatar
  • 15
1 vote
1 answer
71 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) ...
bobby12345's user avatar
1 vote
1 answer
199 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])
Ihab's user avatar
  • 11