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
2answers
66 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
36 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
40 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
28 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
25 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
84 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 "...
0
votes
0answers
20 views

Con statement with multiple AND fails

I have a conditional statement that runs through multiple rasters. It produces the correct output in Raster Calculator but not when I run the code. I don't get any errors, it just creates blank ...
1
vote
1answer
59 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
29 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
43 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
41 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
32 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
145 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
313 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
113 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
18 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
227 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
195 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
168 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
308 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
250 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
125 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
70 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
245 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
299 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
47 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
98 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
505 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
57 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
54 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
371 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
179 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
78 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
149 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
286 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
283 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
191 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
79 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 = ...
2
votes
2answers
446 views

Using Con in Raster Calculator of ArcGIS for Desktop? [closed]

I have two images, "dvel.img" and "evi.img", and i want to extract water related pixels. The condition is: (("dvel.img" <= 0.05) & ("evi.img" <= 0.3)) I want to get an output by putting ...
0
votes
1answer
80 views

Arcmap ModelBuilder - If statement

I'm using the ModelBuilder inside ArcMap to execute a set of raster calculations. I need to execute a different calculations based on the pixel value (If the pixel value is less then 0 - execute ...
3
votes
1answer
420 views

Using con statement in raster calculator to include raster as condition in existing raster?

I'm doing an assignment where we have to use a Weighted overlay to generate a raster of suitable places to plant crops. I've put all the factors in the weighted overlay and generated my output but now ...
1
vote
1answer
2k views

Syntax error: keyword can't be an expression with the function “Con”?

From How can I reclassify an integer raster to a float raster?, I would like to reclassify an integer raster "cpraster3.tif" to a float raster. For example, I would like to reclassify "Value" = 1 into ...