Questions tagged [conditional]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
32 views

Conditional statement in R based on multiple rasters

I have: raster_1: an integer raster with non-sequential values i (101, 130, 240, 323) i: a watershed discharging X of sediment in the environment raster_2: represents the water quality for each ...
3
votes
2answers
92 views

Conditional calculation using QGIS

I want to apply an algorithm to calculate the clorophyll-a concentration of a reservoir using Sentinel 2. To do this I need to create a mask using Sentinel's 2 band 11(infrared) to separate the water ...
1
vote
1answer
34 views

Condition statement not returning correct value [duplicate]

I may be missing something obvious here, but I cannot figure it out. In my attribute table under the area_ft_su column, I have a bunch of NULL entries. I want to change those NULL entries to zero ...
1
vote
1answer
48 views

Creating condition for mosaicing images in Google Earth Engine JavaScript API

I am trying to create a mosaic of a several classified images using as criteria that every pixel has to be the same class at least for three images. A similar process can be done using the .min() or ....
1
vote
1answer
25 views

Extracting pixels from a raster list according to a value range and position in R

I'm working on a script on R and I have a doubt. I have a directory with a raster dataset of NDSI MODIS files. I want to create a list(or stack) of rasters whose first pixel (x=1, y=1) value is ...
0
votes
0answers
32 views

Condition with using geometry OLD and NEW

Is there a posibility to use a condition with OLD and NEW parameters? Using postgres 12, and pgAdmin Geometry in Qgis Trigger CREATE TRIGGER abc_trigger AFTER INSERT OR UPDATE OR DELETE ON "...
3
votes
1answer
91 views

Using ELSEIF in QGIS Field Calculator

I found a similar question, but the answer solve the problem indirectly. So, here I reshape the question. Say, in the following situation, how am I going to use "ELSE IF" statement? CASE ...
0
votes
1answer
35 views

How to set all raster pixels within a shapefile to null?

I'm working with ArcGIS Pro 2.4.0. I have a raster dataset consisting of several plots of crops. Within each plot, there is a small ground target that has differing reflective values than the ...
1
vote
1answer
50 views

Conditional Reclassification using Raster Calculator

There are several questions about conditional reclassification on the Stack Exchange, but I haven't been able to find exactly what I need... In my workspace, I have a list of raster layers (8 bit ...
2
votes
1answer
183 views

Conditional formatting with color and icon for table in print layout

I used the conditional formatting option in the attribute table (figure 01) in QGIS 3.12. I created a layout with the map and the attributes table (figure 02). With the option “apply layer ...
1
vote
1answer
62 views

Property Is not like. GeoServer

Which function/condition should I use to get the opposite of "PropertyIsLike" in GeoServer?
2
votes
1answer
102 views

Conditional formatting QGIS Legend

I use QGIS to create surface plots for measurements made in the field. I use the contour plugin. I usually create ~50 contours in order to make a smooth surface. When I use print composer, I generally ...
3
votes
2answers
104 views

Conditional statements in Field Calculator QGIS

Is it possible to modify the following syntax somehow that it would be applicable in Field Calculator in QGIS? The input layer is point layer and I would like to do following calculations which I can'...
1
vote
1answer
36 views

Conditional statement using Long and Text fields with Python Parser of Calculate Field in ArcGIS Pro

I have 3 fields: "ISL_Numero" - Long (values are '1', '2', '3', '4' etc.) "Subtipo_IS" - Text (values are 'A', 'B', 'C' etc.) "Ambiente_C" - Text (values I want to ...
5
votes
1answer
472 views

Conditional calculation using raster calculator in QGIS

I have two rasters with the same extent, resolution, and projection, let's say raster A & B. What I want to do is something like this: IF A = 3 OR A = 11 THEN A+B ELSE B How can I do such a ...
1
vote
2answers
64 views

Writing if/then Statements for Python Parser of ArcGIS Field Calculator

For some reason I cannot get this code to work in the Field Calculator of ArcGIS Desktop 10.6.1. I'm trying to use the Python parser to populate the field "SHAP_CLAS" with multiple conditional ...
1
vote
1answer
238 views

Iterate through raster in R and apply conditional statements

I have a raster data set in R with numeric values ranging from 0 to 61.5, including some random NAs throughout. I would provide a reproducible data set, but I don't know how to create a raster with ...
5
votes
1answer
158 views

Clustering only if name attribute is same using QGIS?

I have a point layer on a world map with several attributes. Each point marks the position of a berth at a terminal in a port in a certain country. When I zoom out, it's getting too crowed so I ...
3
votes
1answer
94 views

Clustering geometry points, return a point's label if the point does not belong to a cluster?

I am clustering geometry points using the k-mean algorithm. The result is a list of clusters. Some clusters contain multiple points. Others only contain a single point. On the client side, we would ...
2
votes
1answer
74 views

PostGIS query from three tables

I am new in PostGIS and want to learn. I faced the query where I have to find one point in two different layers or table. I created a query like this but it is not giving the desired result: SELECT b....
2
votes
1answer
120 views

Conditional statement in PyQGIS field calculator

I am trying to perform a if/elif/else routine in the field calculator environment from PyQGIS (i.e. coding in Python). My code is the following, however I keep getting indentation errors. The field ...
2
votes
0answers
24 views

Conditional Expanding in ArcGIS Desktop?

I would like to reclassify a LC map given some conditional rules (raster with 8 classes total). Using the illustration, I would like to expand the green pixels (two distinct classes) on the white ...
3
votes
1answer
452 views

earthEngine expression and ternary operator: why does evaluate false value when always true?

Why does EE `.expression('A?B:C') take into account C if A is always true? I am using conditional operations with the image.expression('condition ? true_action : false_action) as documented here. My ...
1
vote
2answers
177 views

How to create a single raster based on the values of three rasters (Conditional)?

I have three rasters of soil granulometric fractions (clay, sand and silt), all in %. I want to make a single raster of the soil texture classes. For that, I need to make some conditionals (i. e.: ...
2
votes
1answer
104 views

Simplifying variable (if condition) with field calculator in QGIS

I want to simplify the variable ("SIOSE_CODE") which has values like this: A(90MTRfr_05PST_05SDN) A(65PST_35MTRfr) A(70FDCfr_10PST_10MTRfr_05MTR_05SDN) The first number (here 90 resp. 65, resp. 70) ...
0
votes
1answer
394 views

Including conditional operation depending on number of images?

I want to do certain operations depending on the number of images in a filtered collection. I am working within a loop, so I need the condition to jump to the next step in the loop given a condition. ...
2
votes
4answers
88 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
156 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
173 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
26 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 ...
2
votes
3answers
105 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
66 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
89 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
149 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
554 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
206 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
355 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
309 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
50 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
66 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
366 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 ...
1
vote
1answer
127 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? ...
3
votes
2answers
539 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
234 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
1k 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
80 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
986 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
26 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
2k 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-...