Questions tagged [conditional]
Conditional, also known as Con, is a raster processing tool or expression that evaluates an if/else condition on each cell.
134
questions
0
votes
1
answer
40
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
38
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
117
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
124
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
45
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
86
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
127
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
119
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 ...
0
votes
0
answers
61
views
Conditional in ModelBuilder, if not, skip process but continue with existing dataset
I'm struggling with an if-then-else statement in the ModelBuilder.
If a variable times != 1, multiply the input raster by this variable times. Else do not multiply, maintain the input raster.
Next, a ...
4
votes
1
answer
151
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
48
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
346
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
125
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
31
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 ...
2
votes
0
answers
168
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
596
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
234
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
44
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
611
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
65
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
258
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
198
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
155
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
184
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
403
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
531
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
328
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
491
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
218
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
140
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
1k
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
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 ...
1
vote
1
answer
264
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
299
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
598
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
715
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
266
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
41
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
238
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
415
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
299
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
74
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
1
answer
256
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
1
answer
131
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
0
answers
153
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
1
answer
342
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
1
answer
336
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
1
answer
300
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
1
answer
953
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 ...
2
votes
1
answer
538
views
Property Is not like. GeoServer
Which function/condition should I use to get the opposite of "PropertyIsLike" in GeoServer?