Skip to main content

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
1 answer
36 views

Mapping, Iteration and conditional selection on featureCollection in GEE

I want to make a function (possibly using Currying method) in GEE to do a modification of my featureCollection. In the code bellow I wrote a function_infunction to add a new property "label" ...
Sina NAKHOSTIN's user avatar
3 votes
1 answer
74 views

How to apply conditional formatting for independently text labels on a QGIS layout

From a layout in which I use two independent text labels, as you can see in the screenshot: This text labels use the following expressions that make a calculation on two different layers: [%...
Ingrid Ingravida's user avatar
2 votes
2 answers
177 views

Conditional labeling in QGIS

I'd like to create a rule-based label in QGIS and wrote the following expression, but somehow it doesn't work - could someone tell me what's wrong? if( "FLN" > 0, "FLN" || '\n' ...
KodakAsis's user avatar
-1 votes
1 answer
31 views

GEE: List operation and conditioning

I have a list of features containing two Polygons that belong to a MultiPolygon feature: var polygon_lst = ee.Feature(MP_feat).geometry().coordinates(); //MP_feat is a MultiPolygon I want to take ...
Sina NAKHOSTIN's user avatar
1 vote
2 answers
82 views

QGIS Expression CASE WHEN AND AND [closed]

I am failing at making a case with many (3) conditions. I have different contract cases (f.e. Nutzungsvertrag) and i want to create a virtual column where contracts of a certain type are summed up ...
Marek's user avatar
  • 537
1 vote
1 answer
101 views

QGIS conditional formatting in symbology

These data are colored per column in excel using path: Home (tab)--> Conditional Formatting (styles)--> Colour scales--> Blue-White-Red Colour Scale Each id represents a cluster on the ...
Annie S.'s user avatar
  • 197
5 votes
1 answer
294 views

Using Conditional branch algorithm in QGIS Graphical Modeller

I have a question regarding using the Conditional Branch algorithm in the Graphical Model Builder. I am building a rather complicated model with many branches but not every branch needs to be used ...
Andy Baader's user avatar
0 votes
1 answer
49 views

If B1>B2 then B1 else B2 condition

I'm trying to implement OC3 equation to the Landsat 8 dataset. In order to do so I need implement this equation : I need to choose the highest reflectance between B1&B2 at each timestep. I tried ...
Aurélien Lengrand's user avatar
0 votes
1 answer
212 views

QField conditional visibility in forms doesn't work in the mobile

I've been trying to make a field mapping project using QField. I've developed attribute forms with drag and drop designer. I have 5 tabs so far. 1.Meta data 2. Lithology 3. Structure 4. Notes 5. ...
Anon's user avatar
  • 1
1 vote
1 answer
65 views

Extract by Expression w/ two conditions stopping when first condition is met in QGIS

I have an output from ST-DBSCAN with the attribute "CLUSTER_SIZE". I'd like to extract only attributes belonging to clusters of size >= 10. If this condition cannot be met, then extract ...
Barbara Perez de Araújo's user avatar
4 votes
2 answers
239 views

Filling several columns based on conditions from column in QGIS

I've got two additional columns that need to be filled with attributes that are based on values created in the field. For example, if column "reproduction" = A2 then the value in the value ...
Eric Walter's user avatar
2 votes
2 answers
178 views

Multiply two rasters with condition

I have two rasters that I want to multiply in QGIS with raster calculator, but they both have also cells with 'no data'. If I multiply simply raster1 by raster2, the result of the multiplication ...
AUS85's user avatar
  • 446
2 votes
0 answers
53 views

Create variable containing the conditional mean of a group

I have a table with three columns, the first defining a group (Group), the second a characteristic (Species), and the third a numeric value (Height). I would like to obtain a fourth numeric column in ...
Marie_Madeleine's user avatar
0 votes
2 answers
108 views

Adding new fields with conditions and calculating the sum of lengths and numbers using PyQGIS

I am developing a new plugin using Python in QGIS. I want to get an output with the result of a specific attribute table from another layer already existing in my project => layer "SUPPORT&...
Fatine MOBARIK's user avatar
2 votes
1 answer
135 views

Adding new fields based on condition using PyQGIS

I want to add another condition in my code. This is my code: tablePT = QgsVectorLayer('None', 'table_PT', 'memory') tablePT.dataProvider().addAttributes( [QgsField("Type", QVariant....
Fatine MOBARIK's user avatar
0 votes
1 answer
188 views

Applying multiple conditional statements for new column with QGIS Field Calculator

I have an attribute table of a point layer where each point has a "StopID" (range 0-37115): My goal is to create a new column in the table for a subset of 188 points where that subset is ...
user avatar
4 votes
1 answer
256 views

Ignoring empty output in QGIS Graphical modeler

In QGIS 3.22.11 I have a model with around 15 output, and a majority of them are empty most of the time. Is there a way to prevent layers with no entities to show up in QGIS after the model? I tried ...
f.hin's user avatar
  • 41
0 votes
3 answers
55 views

Loop through raster names in two folders, perform Con (Spatial Analyst tool) if the dates match

I cannot perform the Con tool over all the raster images with same date in two folders. This is the script I have worked upon so far. import arcpy, os from arcpy.sa import * # Set the current ...
vasudha chaturvedi's user avatar
1 vote
1 answer
513 views

Conditional statements with formulas in Google Earth Engine

I would like to apply an expression to an image based on conditions. The part of my code that I need to do this in is where i need to calculate runoff Q2 based on values of AMC and S: var runoff_func =...
Rozy's user avatar
  • 37
1 vote
3 answers
164 views

Auto Incrementing ID based on repetitive sequential ID and conditional parameter (ID based on two fields - arcpy) - Update Cursor

I am currently trying to generate an ID based on two conditions but I am having troubles to achieve that since I am failing to make my script work. Below the explanation and my code, I apologies if ...
cerroGIS's user avatar
1 vote
0 answers
32 views

Neighboring zones using a condition (expression)

We have a census tract layer which contains the total number of dwellings 'V_tot'. We need to group the census zones that intersect each other where their sum is in the range of greater than 150 and ...
GIRMAR's user avatar
  • 11
3 votes
0 answers
237 views

Error while using "wbt_conditional_evaluation" in R from WhiteboxTools package "whitebox"

When I try to perform the conditional tools "wbt_conditional_evaluation" in R, I get this message error : Error running WhiteboxTools (conditional_evaluation) whitebox.exe_path: "C:/R/...
Francis Lessard's user avatar
0 votes
1 answer
884 views

Making relevant question required in Survey123

In my Survey I have several groups of questions where the answer is either satisfactory, unsatisfactory or not applicable. If the answer is unsatisfactory that prompts a four relevant questions. I ...
Mapsy Daisy's user avatar
2 votes
1 answer
302 views

Merging raster data with certain condition

I am doing a project and one demand is to create single raster by merging two rasters (Raster U and Raster R) into one (raster N) and only if conditions are met. The picture below shows those ...
Marko Boričević's user avatar
1 vote
0 answers
55 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 ...
Apeny's user avatar
  • 11
3 votes
1 answer
1k 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' || "...
TimM's user avatar
  • 33
0 votes
1 answer
79 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. ...
Sarah T's user avatar
2 votes
1 answer
345 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 ...
wbio's user avatar
  • 23
2 votes
1 answer
294 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 ...
Lucian's user avatar
  • 21
0 votes
2 answers
189 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({ ...
farhat's user avatar
  • 151
5 votes
1 answer
276 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 ...
jpinilla's user avatar
  • 3,230
2 votes
2 answers
546 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 ...
ncica's user avatar
  • 942
1 vote
1 answer
684 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 ...
Dario C's user avatar
  • 11
2 votes
1 answer
414 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) ...
CedricJ's user avatar
  • 41
3 votes
1 answer
621 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 ...
Rayk Henning's user avatar
1 vote
2 answers
297 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 ...
Sean Roulet's user avatar
  • 2,200
0 votes
0 answers
165 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 ...
Tuna-92's user avatar
  • 13
3 votes
1 answer
2k 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 :...
Sinooshka's user avatar
  • 391
6 votes
2 answers
1k 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 ...
Thomas's user avatar
  • 925
1 vote
1 answer
329 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 ...
Thomas's user avatar
  • 925
0 votes
1 answer
423 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 "...
cherrychips's user avatar
0 votes
2 answers
771 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 ...
Nautilaus's user avatar
2 votes
1 answer
930 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 ...
shiny's user avatar
  • 899
0 votes
1 answer
315 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 ...
Mikhail Svideniuk's user avatar
1 vote
1 answer
42 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 ...
user3265206's user avatar
1 vote
1 answer
273 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^...
Rapu93's user avatar
  • 175
3 votes
1 answer
471 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 ...
Jade's user avatar
  • 31
3 votes
2 answers
327 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 ...
kashi's user avatar
  • 33
1 vote
1 answer
88 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 ...
Binx's user avatar
  • 1,360
0 votes
1 answer
265 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 ....
Luis Lizcano's user avatar