Questions tagged [conditional]
Conditional, also known as Con, is a raster processing tool or expression that evaluates an if/else condition on each cell.
142
questions
1
vote
1
answer
34
views
How to make a conditional branch in QGIS Modeler based on the raster cell size
I want to make a conditional branch in QGIS modeler based on the cell size of the incoming raster. If the cell size is larger than 10m, I would like to resample the raster to 10m before exporting it.
...
0
votes
1
answer
58
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" ...
3
votes
1
answer
97
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:
[%...
2
votes
2
answers
195
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' ...
-1
votes
1
answer
35
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 ...
1
vote
2
answers
88
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 ...
1
vote
1
answer
121
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 ...
5
votes
1
answer
381
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 ...
0
votes
1
answer
50
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 ...
1
vote
1
answer
287
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. ...
1
vote
1
answer
75
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 ...
4
votes
2
answers
280
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 ...
2
votes
2
answers
203
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 ...
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 ...
0
votes
2
answers
112
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&...
2
votes
1
answer
142
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....
0
votes
1
answer
246
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 ...
4
votes
1
answer
302
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 ...
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 ...
1
vote
1
answer
573
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 =...
1
vote
3
answers
196
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 ...
1
vote
0
answers
34
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 ...
3
votes
0
answers
255
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/...
0
votes
1
answer
998
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 ...
2
votes
1
answer
312
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 ...
1
vote
0
answers
56
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 ...
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' || "...
0
votes
1
answer
94
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
1
answer
367
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
1
answer
325
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 ...
0
votes
2
answers
200
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
1
answer
303
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
2
answers
605
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
1
answer
733
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
1
answer
451
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)
...
3
votes
1
answer
658
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
2
answers
310
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
0
answers
174
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
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 :...
6
votes
2
answers
2k
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
1
answer
343
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
1
answer
457
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
2
answers
866
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
1
answer
995
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
1
answer
318
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
1
answer
43
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
1
answer
284
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
1
answer
482
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
2
answers
337
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
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 ...