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

"no data" result from raster calculator

Am trying to implement the following line in QGIS raster calculator: ("L@1" < 0) * ((1 - 16 * 200 / "L@1")^0.25) + ("L@1" >= 0) * 1 Basically, when L is less than ...
2
votes
1answer
28 views

Bold (or other style) part of a feature label in QGIS

I'm working on a map in QGIS (3.16.11-Hannover) and have a feature label that's generated from three attributes as follows: "Site name" || ', ' || "When" || '\n' || "...
0
votes
1answer
47 views

Why does list.remove() not remove all items that meet the condition?

I have a bunch of feature classes in a geodatabase, and some of them are empty. I want to generate a list of all feature class names, and then remove the names of any feature classes that are empty. ...
2
votes
1answer
41 views

QGIS - auto fill values in one column which share the same value in a different column

There are three columns in the attribute table. part, forest with both unique IDs and factor with three possible values (yes, no, check). One forest contains many different part. If the factor is ...
2
votes
1answer
75 views

Why does nothing happen with CASE statement in QGIS?

In QGIS, Field Calculator, I am trying to fill out an existing field (target) based on values on another existing field (source), both in the same shapefile. For each value x in the source, field set ...
1
vote
2answers
36 views

Wrong Boolean result when checking the type of geometry in Google Earth Engine

I would like to set a condition based on the type of selected geometry. However, applying the following code seems to give wrong results. var geometryCollection = /* color: #008000 */ee.Geometry({ ...
5
votes
1answer
90 views

Applying conditional label opacity in QGIS

I'm working with QGIS 3.16 Hannover. I've got one layer with all Spanish provinces (provincias) and, on top of it, several layers with the regions (AND, ARA, AST...). Each province pertains to one ...
2
votes
2answers
49 views

Using Conditional Statement - SLD GeoServer - based on scale

Is there any way to use the conditional statement in SLD based on scale to set parameter for example: for scale between 25001 and 50 000 set size 15 for scale between 5001 and 25 000 set size 28 for ...
1
vote
1answer
73 views

GeoServer CSS style with condition

I have street numbers with a specific field. I would like to show points with different colours based on this field and, on the same scale, display text of the street number itself, based on another ...
2
votes
1answer
108 views

Rule-based symbol for point within polygon in QGIS

I would like to use a set of rules to draw features from a point_layer that are within a polygon_layer. Points that answer true to ("VAL_PROTECTION_EP3" = '1' AND "TYPE" = 1) ...
2
votes
1answer
98 views

Conditional branch algorithm in QGIS modeler link to a certain layer and certain columm

I´ve got a modeler, which has limitation for the input. I want to build a conditional branch which stops the algorithm when the limit is overstepped. "example" - colum with numbers from ...
1
vote
2answers
22 views

How to NOT do a reduceRegion from empty image collections?

I am collecting the Kelvin temperature of a field from Landsat imagery for October for a period of 20 years. Due to clouds, there are some images that are being removed by my pruning, leading to ...
0
votes
0answers
49 views

How to efficiently filter and select attributes based on conditional formatting?

I am wishing to filter my attribute table to display only certain values that meet certain criteria based on multiple column values. For example, I want to show all locations on my map that are Lost ...
3
votes
1answer
134 views

Using Conditional Statement in QGIS for polygon categorization

I am trying to use Conditional Statements to assign distinguished colors to 10 different polygons within my shapefile. I want to have control over selection of the color for each polygon. Therefore I :...
6
votes
2answers
192 views

How to group polygons based on spatial proximity and field value?

I have a shapefile consisting of the day of the year on which the temperature in a lake exceeds 15 degrees Celsius. I can see clear patterns in this (here seen as a raster): I want to group the ...
1
vote
1answer
73 views

How to conditionally dissolve a vectorized layer?

I have a raster layer with the day of the year on which we observe temperature above 15 degrees. There are large differences (image below): I have vectorized this layer based on the Band including ...
0
votes
1answer
33 views

Using conditional statements on raster not working in R

I'm trying to do this thing where I'm classifying climate and R just seems to not like it when I do if/and functions I don't even know someone please help me So I created a new raster entitled "...
0
votes
2answers
74 views

Conditional labeling in ArcMap using Python Parser

I am using ArcMap 10.8. I have 2 attributes: Toponym and Type. Toponym gives the name Type indicates if it is a city, town, church, etc. In English, I would like if Type = town, then capitalize ...
2
votes
1answer
122 views

Subtracting two raster layers based on condition in QGIS

I have 3 raster layers in QGIS. I want to subtract two from each other based on a condition in a third layer. 'Layer1': has no data in some parts and I used Close gaps to generate 'Layer1_fill'. What ...
0
votes
0answers
44 views

Using Arcade conditional IIF Statement in ArcGIS Field Maps

I am building a form in ArcGIS Field Maps and if one field is answered NO, I want the next 8 fields to not even show up. I think I need them in a group and to use an IIF statement: IIf($feature["...
0
votes
1answer
73 views

How to average data from Sentinel-5p collection ignoring zero?

I am working with CH4 product Sentinel-5p provided by ESA Copernicus. Remote User Support provided a script to extract averaged CH4 anomalies for a certain period for the Earth Engine. However, I ...
1
vote
1answer
27 views

Raster product in PyQGIS does not produce correct results

I'm trying to mask (set with no data values) pixels in a raster not fulfilling a condition based on another raster. It runs well but it produces huge numbers that are not the values in the raster that ...
1
vote
1answer
77 views

Conditional Raster Calculation in Python QGIS [duplicate]

I would like to perform this raster calculation where when ras@1 >0 gives me 1 as pixel value of the output raster, while when ras@1 <0 the values are given by the other formula ras@1/(1-2.71828^...
3
votes
1answer
127 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
149 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
44 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 ...
0
votes
1answer
160 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
32 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
48 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
145 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
66 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
120 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
394 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
150 views

Property Is not like. GeoServer

Which function/condition should I use to get the opposite of "PropertyIsLike" in GeoServer?
2
votes
1answer
158 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
123 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
57 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
1k 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
82 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
526 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
260 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
164 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
81 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
189 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
26 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
619 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
200 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
112 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
569 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
91 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 ...