Stack Exchange Network

Stack Exchange network consists of 174 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 [conditional]

Conditional, also known as Con, is a raster processing tool or expression that evaluates an if/else condition on each cell.

2
votes
4answers
55 views

More Efficient Conditional Statements - ArcGIS Field Calculator

I am new to Python and have successfully created the following statement that writes a change period value (01 or 02) based on the municipality and date fields. I am wondering if anyone could point ...
0
votes
1answer
33 views

Using Con tool with iterator in ArcGIS ModelBuilder?

I have been using ArcGIS Modelbuilder on 16 years of MODIS LST 8 day data, ie. quite a few files. I want to use the QC pixel data at error <=1, 2, and 3K to overlay on the base LST data so I can ...
1
vote
2answers
49 views

Usage of ELSE Conditional Statement in QGIS Field Calculator

I have an issue about how to change some data in a field not affecting unrelated data. I want to replace '(space)' between words in label_geo_ field data by this '_' sign when (if) this sign appears ...
1
vote
1answer
20 views

Changing values of slope along polyline to 0 using ArcGIS Spatial Analyst?

In ArcGIS 10.1 (advanced license), I have a slope raster of a given area and a polyline. I want to set the slope values along the polyline to 0. I'm thinking of this process - extract the cells ...
0
votes
0answers
23 views

Resampling a weighted overlay map arcpy?

I have a RASTER a (weighted overlay map): name = Chile_15 VALUE = [1, 2, 3, 4] # It has 4 diferents type of pixels Spatial Reference = WSG 1984 geopgraphic projection (D_WGS_1984) (...
2
votes
3answers
86 views

Problem with “if” conditional statement

I have mentioned my QGIS script below. In that script, I have used "if condition". When I open QGIS and run the script first time, after selecting the "Coordinate_System_SLD_99", it works accurately. ...
2
votes
0answers
28 views

QGIS Conditional statements in field calculator [duplicate]

I have attempted to write an expression for hours now by looking through these forums. I want to write if this column equals Blank, than this column equals blank. Ex) If defect_typ = A_FC ...
2
votes
0answers
38 views

How to set diagram color based on conditional expression?

I'm trying to create a map with pizza diagram, and I'm using the following expression: CASE WHEN pH >= 6 AND pH <= 9 THEN Color_rgb (0,166,226) WHEN pH <= 6 AND pH >=9 THEN ...
2
votes
1answer
47 views

Update existing field using CASE -statement

When I run this statement in qgis fieldcalc it returns correct reults only from the first line ('Skog') and the rest gets NULL-values. Any ideas what might be wrong here? Is it not pocssible to run ...
0
votes
1answer
34 views

Using ArcGIS conditional raster calculator?

I have a raster called "aspect" and I want to add 360 to every cells which have a current value lower than 100. How can I do this using raster calculator?
0
votes
2answers
89 views

Passing conditional statements into arcpy.da.UpdateCursor

How do you pass conditional statements from a list into a data access module update cursor? I am using ArcGIS v10.3.1. a = r"...\Default.gdb\New_Shapefile" ConList = ["r[1] >= 1"] with arcpy.da....
3
votes
1answer
64 views

Conditional Statement (CASE-WHEN) in QGIS for slope aspect

After processing a DEM with a mask to get the aspect values of some polygons I would like to create a new field classifying those values as N, NE, E, SE, S, SW, W, NW. I've written this but I can't ...
1
vote
2answers
93 views

Conditional statement in field calculator using Python parser ArcGIS

I have looked at many threads on here asking about coding nested if-then or conditional statements in field calculator in ArcGIS. This seems to be a common problem for beginner programmers. I've ...
1
vote
0answers
41 views

Reclass If/then logic [closed]

Have a binary raster. I would like to remove any 'islands' that are fully surrounded by one of the classes while leaving the 'islands' that are fully surrounded by the other. If 1 is enveloped by 0, ...
1
vote
0answers
51 views

Conditional field calculator in QGIS [duplicate]

I'm trying to code a conditional sentence in QGIS to calculate a vector field. I have 5 variables. I'd like to calculate the simple average if all variables are >= 3. If all variables are not >=3, ...
2
votes
1answer
262 views

Splitting text attribute using conditional function QGIS 2.18.13

i want to split a text column with city names by selecting only the names like 'world (planet)' and not like 'world planet'. Tried before with left( "Name", strpos( "Name" ,' ')) update existing field ...
0
votes
1answer
59 views

Extra conditions in composer controlled by atlas

I want to create a map series controlled by atlas, but some of my features have very different scales. I want to insert a condition to never use a scale lower than X (for instance: 1:5000). Any idea? ...
1
vote
2answers
218 views

QGIS conditional labeling of towns

I'm trying to create a labeled heat-map of incidents. Currently, I can label every town in the state -- which clutters up my map -- or I can have no labels at all. My boss would like me to instead ...
1
vote
1answer
82 views

Multiple Conditionals String with ArcGIS Field Calculator?

I am trying to use Field Calculator to use a multiple conditional based on a string in another field of the same attribute table. I have written the code below, but without success. Pre-Logic Script ...
3
votes
1answer
474 views

Displacing colliding point symbols in QGIS

I have a layer that includes points for electric poles (Circles) and transformers (triangles). Transformers can be on poles or on their own. I would like to displace the transformers only if they are ...
1
vote
1answer
60 views

Change a script to run over subfolders

I posted How to save just some mxds through 'if' in python? yesterday, and now I want to do a change in the script. I changed the script, to run over sub-folders. It goes nice, but when it ...
1
vote
2answers
49 views

How to save just some mxds through 'if' in python?

I have a simple code, that changes a picture in the layout, based on the element name. It works fine, for all MXDs in the same folder of the script. The problem is, the script saves every single .mxd ...
1
vote
1answer
228 views

Get a specific value from a table with using a few conditions in Python

I have a table that each different values in the table is the result of a combination of different conditions. For example in the below image the condition is as follow: if coverType=fallow , ...
1
vote
0answers
22 views

Trying to loop through a directory and create a shapefile of a given threshold using arcpy. [closed]

Below is my code. I'm having issues with this will work sometimes then other times it will not work. # Import dependencies: import arcpy import glob, os arcpy.CheckOutExtension('Spatial') arcpy.env....
3
votes
2answers
1k views

Conditional statement in gdal calc

I have this statement working in arcpy but I want this to implement in gdal, especially with gdal_calc, if possible. Rastercalc = Con(((C-B) > 2) & (B > 100), A, Con(((A-D)>15) & ((A-...
1
vote
1answer
44 views

How to modify values in a raster that are smaller OR larger than two thresholds

In ArcGIS 10.1 (advanced license), I have a raster dataset representing the wind speed (in knots). I want to be able to set the wind speed value to a specific value (say, for the sake of argument, a ...
1
vote
0answers
83 views

Reclassification Issues - Conditional Statements to Change Raster Values

I am looking for help with the statement to put into Raster Calculator that would turn some incorrect raster values (discrete values from 1385-1399) into a "1" without changing the majority of raster ...
1
vote
1answer
170 views

Loop through list of raster and replace values with another raster if they meet a condition

I'm very new to python and arcpy. The task: I have a large series of rasters (r0, r1, r2, r3...) (tif; n=240) and corresponding quality rasters (qr0, qr1, qr2, qr3...) (tif) with values 0,1,2,3 (...
1
vote
2answers
219 views

Conditional Filling Polygons in QGIS?

Is it possible to conditionally fill in county polygon of a state based on a date field? Example: ABCD County has a plan that was approved by FEMA on 10/01/2015 and expires on 09/30/2020. For ABCD ...
2
votes
0answers
35 views

Replacing attributes of raster cells with other raster values?

I have two raster layers. The first is a terrestrial habitat raster that includes an open water value. The second is a lentic habitat raster. I would like to "burn in" the lentic habitat raster ...
1
vote
2answers
37 views

Conditional to update field not working properly - Arcpy

I am attempting to update a text field with a shortened version of what is currently there. Currently, there are values from 1 to 4 with a description of each. I would like to return only the value. ...
1
vote
1answer
86 views

UpdateCursor - how to pass over certain rows based on value using conditional statement

I have a script that is supposed to update several fields based on the values of several other associated fields. My script is almost working as it should. However, it is overwriting my "High" and "...
1
vote
1answer
60 views

Parsing error: in Conditional raster calculator?

I was trying to calculate Soil types based on the FAO's guidline using the Con tool in raster calculation with ArcGIS 10.3. from three layers (silt, clay & sand). But, I got an error saying: ...
0
votes
1answer
47 views

UpdateCursor not filling correctly with conditional statement

I am attempting to update a table so that a field, "ALLREADY", fills with "Y" or "N" depending upon if "dmready" equals "total_records" AND if "dm_stat" is equal to "Ready for DM". When I run my ...
2
votes
1answer
372 views

Conditional statement ENVI

I am trying to do conditional statement in ENVI to calculate multiband image: result = (b1)^2 - (b2)^2 if (b1 eq 0) or (b2 eq 0) result * 0 else result * (result gt 0.0) Is there a way to combine ...
0
votes
2answers
909 views

SetNull() failing with input raster in ArcPy?

In ArcGIS 10.3, I am trying to use SetNull to identify streams in a raster based on an existing flow accumulation raster. The process involves setting all raster cells with flow accumulation value of ...
2
votes
1answer
38 views

Graphing attributes if they fulfill a condition

I have a dataset with schools, school coordenates, if the school is private or public and a variable containing the decile of attainment of the school in a test. I am trying to map schools in a city ...
3
votes
2answers
52 views

Raster conditional tool unexpected results. What's wrong?

I have a DEM raster (High: 53441, Low: -3444, unit: cms) with negative values, and I want to make all values 100 or less to be 100. I've tried Raster Calculator, and also python. I've got the same ...
0
votes
0answers
136 views

Using Near Feature Tool with Conditions

I am using near feature tool in ArcGIS 10.1. However, I need to add another condition to it (not only the nearest). The feature (point) that i am looking for, is the nearest (point) and also doesnot ...
3
votes
2answers
227 views

Field Calculator - conditional function and string variable?

I know this question has been asked before in different fashions, but I can't seem to get my python script to work despite looking at all the relevant questions I could find. I am simply trying to ...
0
votes
1answer
729 views

compare three rasters and three conditions with overlay in r

I'm trying to run an overlay function with rasters where I want to meet all of 3 different conditions at each cell and produce a single raster as output. Running ifelse with the & operator ...
4
votes
2answers
90 views

Conditional Combine Rasters and Track which Raster pixel used

I have 6 rasters with pixel values ranging from 0 to 1. I want to extract the highest pixel values from each raster to create a new raster, but also have a way to show which raster the highest value ...
1
vote
1answer
373 views

Con statement not working in Raster Calculator of ArcGIS for Desktop?

I'm trying to combine two rasters in 10.3 using a con statement with the raster calculator in map algebra. (ie - con (raster 1 ==1, raster 1, raster 2)) where raster 1 is a smaller extent and does ...
2
votes
2answers
263 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
93 views

How to set identical EXCLUDE conditions for multiple layers all at once?

We do noxious weeds surveying, and have a geodatabase with separate point feature classes for each distinct species. In our Noxious Weed map, we have all of these species arranged into a single group ...
3
votes
2answers
1k views

Handling NULL values in labeling? [duplicate]

In QGIS (2.10.1 on a Mac), I am trying to make some multiline labels on a map I have with a bunch of trees in them. In the attribute table I have columns with the Latin scientific name, the English ...
1
vote
3answers
299 views

Making raster output based on comparison between 2 input rasters using ArcGIS for Desktop?

I have 2 input rasters of rainfall for summer/winter and I want to make a 3rd output based on which one has the max value for that cell. So if the max value at the cell is summer it will assign 1, or ...
1
vote
1answer
580 views

Group attribute tables values for use with conditionals - Python

I would like to group values in a field in an attribute table. The field contains duplicate values. These duplicate values should be grouped based on duplicate values, the field would look something ...
1
vote
1answer
143 views

Update record based on series of conditionals using Python

I have a feature class which I've been using a relate to compare duplicate field values and was thinking of a way to eliminate the manual process of checking these duplicate values and making a ...
4
votes
1answer
501 views

Conditional Spatial Join?

I need to join two layers (a fishnet grid and land cover). I'd like the join to occur only if the the land cover occupies 50% or more of each fishnet grid (See image below). Can anybody provide an ...