Skip to main content

Questions tagged [if-else]

An if-else statement is a programming conditional statement that runs a different set of statements depending on whether an expression is true or false.

0 votes
1 answer
38 views

Adding pixel-level classification to ee.ImageCollection

I am working with ee.ImageCollection('LANDSAT/LE09/C02/T1_L2') data pulled from earthengine-api in Python. I have previously defined a function to mask cloud, shadow, water, and snow. based on the ...
richard.turner's user avatar
0 votes
3 answers
45 views

ArcGIS Arcade code not giving desired outcome

I have the following code below. I'm trying to search for a text inside a string from a date field and populate it with the associated month with ArcGIS Arcade. So far I just keep getting the default ...
user avatar
0 votes
1 answer
58 views

Field Calculator If Statement

I am new to python and was trying to populate a decade field based on an if else statement on another field that contains parcel years. The code block is below: def ifBlock(Parcel_Year_Built, ...
Androoo's user avatar
1 vote
2 answers
155 views

Use Trigger field with a calculation attribute rule to deleniate between auto calculated data and manually entered data

I have a calculation attribute rule in Arcade that is meant to have the following fields work in conjunction with each other: Name: eight digit unique ID AMPageName: 5 digit page name that consists ...
JBizz49's user avatar
  • 17
0 votes
0 answers
40 views

Get a list of fields from a list of shapefiles [duplicate]

I am trying to get a list of fields from every shapefile in a list I have created that's stored in a variable. My prof says I should be able to call that variable in my if/else statement within my for ...
hanbone's user avatar
  • 33
1 vote
1 answer
208 views

Using NDVI thresholds as a condition for successive elaborations in Google Earth Engine

From Sentinel-1 and Sentinel-2 it was created an image collection of 255 images, each with 5 bands: ndvi, VV_corr (VV corrected for the incidence angle), VV_diff (VV_corr difference between two ...
benedetta's user avatar
  • 138
0 votes
0 answers
51 views

Using if/else statement with unplaced labels in ArcGIS Pro

I am using ArcGIS Pro 3.0.1. I am planning on using maplex engine for labeling of tens of thousands of polygons. I would like to keep from transferring to annotation until absolutely necessary. I have ...
Simela's user avatar
  • 21
0 votes
1 answer
201 views

PyQGIS - If else statement

I want to run the calculation based on what the user chooses from the drop-down menu. For Example, if the user chooses the second option, then the calculation will be using the second formula. I can ...
Siti's user avatar
  • 37
1 vote
1 answer
543 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
0 answers
158 views

If/else custom script inside QGIS Modeler

I wanted to make a small if/else custom script inside the QGIS Modeler. I want the "Centroids" algorithm to be applied when the "L" field (created earlier in the "trees" ...
KyBik RyBik's user avatar
0 votes
1 answer
221 views

Using if/else statement in Google Earth Engine JavaScript API

I am studying because I want to publish my results through Google Earth Engine. Regarding the usage of if / else and ee.Algorithms.If(), I don't understand why both true case and false case work. As ...
YUHWAN SEO's user avatar
1 vote
1 answer
180 views

If/else statement in Google Earth Engine doesn't give output desired

I am trying to make a correction for the NDVI index calculated from Sentinel-2 using GEE. I found out that for pixels with NDVI meaning in the range (0.5, 0.6) it should be subtracted 0.122..., and ...
Evgenii Shibkov's user avatar
0 votes
1 answer
226 views

When to Update Row within an Update Cursor that uses multiple if statements for different fields?

I have a model that requires a stupid number of conditional statements. The older version was utilizing feature layers, select by attributes, and Calculate fields many, many times. I rewrote it to ...
JackOfTales's user avatar
-2 votes
1 answer
750 views

Writing IF THEN string calculation in ArcGIS Pro [closed]

I am attempting to calculate a text field in my attribute table based on a number code given in a different column For example, any number under the "LU_1" column that is '510' will be ...
Olivia W's user avatar
2 votes
1 answer
240 views

Calculate geometry in IF/ELSE statement using ArcGIS.Pro field calculator

I'm using If/else statement to calculate geometry (field "LENGTH") for features meeting special criteria (the value in "TYPE" field does not equal AB201, AB202, AB203, AB204, AB205,...
Vadim's user avatar
  • 115

15 30 50 per page
1
2 3 4 5 6