Questions tagged [boolean]

Boolean logic is the branch of algebra in which the values of the variables are the truth values true and false, usually denoted by 1 and 0 respectively. It is considered a complete system for logical operations. Many GIS software have Boolean operators available, particularly in the raster model.

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Boolean operator

What Boolean operator should I use to select a raster layer of land use and a raster layer of risk flood (medium and high risk together)? the raster layer has 4 classes: water, urban, agriculture, ...
1
vote
1answer
36 views

Boolean precondition in ModelBuilder not exporting to Python script

I don't know python so I often use ModelBuilder and export to python script. In this case, I have a model (that in itself is made of python scripts that have been exported from models) that works fine ...
0
votes
2answers
77 views

Trouble updating field calculatd by st_ functions

I had first run this code on several of my fields of my T1 table at the same time. UPDATE table_1 SET field_1 = liste.my_bool FROM( SELECT T1.id AS name, bool_or((ST_Contains(T2.geom, T1.geom)...
2
votes
1answer
95 views

Change boolean value in QGIS by CASE WHEN

I'm trying to change a field value by the next conditional SQL script from a PostGIS database in QGIS Field Calculator: case when "Field_1" = 'YES' then "Field_2" = 'True' else "Field_2" = 'False' ...
1
vote
1answer
54 views

Setting up if/then/else for choice of two options or boolean in ArcGIS ModelBuilder?

I'm using ArcGIS Desktop 10.6 and have a model as shown in the image below. I'm calling it option 1. The model exports GIS data to CAD DWG format and is comprised of two submodels, "Setup" and "Export"...
0
votes
2answers
66 views

Using Boolean And to overlay layers in ArcGIS Pro?

I am working for a project related to a site selection in which I have 5 layers to overlay to have as result: Zone1: area suitable Zone2: area not suitable. Boolean And seems to be the perfect ...
2
votes
1answer
122 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 ...
0
votes
0answers
20 views

Con statement with multiple AND fails

I have a conditional statement that runs through multiple rasters. It produces the correct output in Raster Calculator but not when I run the code. I don't get any errors, it just creates blank ...
0
votes
1answer
45 views

Converting from Boolean to point features using ArcPy?

I used geometry objects and da.searchCursor to check if randomly created points fall within polygon. Now I get True and False of each points that falls within or outside of the polygon. I made a list ...
0
votes
1answer
350 views

Using Update Cursor gives IndexError: list assignment index out of range?

I am trying to use an update cursor and receiving an error. I'm not very familiar with using cursors, so please bear with me. I am trying to write a 1 or 0 to a field, based on a condition. The error ...
3
votes
1answer
82 views

Selecting lossyear polygon of Hansen data

I'm working with Hansen database in Google Earth Engine. I would like to select polygon of two different years for example 2010 and 2011 for a certain area using lossyear map. This is my code: var ...
2
votes
1answer
77 views

Conditional zonal statistics

I have often used the Zonal Statistics plugin to calculate the mean pixel value of a raster. However, this time I have an additional Boolean (pixels are equal either to 1 or to 0) raster, which is ...
1
vote
2answers
195 views

error in reasoning: logical operators in raster calculator

I'm processing a formula in QGIS raster calculator and have an error in reasoning. Having the layers a and b I want to create output layer c under the following conditions: (1) if a = 1 or b = 1 --&...
2
votes
0answers
85 views

Visualizing Strahler-Order bigger than a specific value

I try to visualize the Strahler-Order bigger than 8 using raster calculator. I changed the style of the raster by changing the render type to singleband pseudocolor and, in the colors selector, I ...
1
vote
1answer
68 views

Cannot set boolean operator within ArcMap ModelBuilder as True

I'm trying to set up my own tool to automate processing ASCII data (3D laser scanning data exported from the software CloudCompare) and have thus far got everything running pretty much as I would like ...
4
votes
1answer
495 views

Overpass API Boolean Filtering?

So I'm trying to get a good list of embassies from Overpass, here's my initial query: [out:json]; ( node["amenity"="embassy"]; way["amenity"="embassy"]; relation["amenity"="embassy"] ); ...
2
votes
1answer
604 views

Check for field, add or skip to next step if exists in ModelBuilder?

I am building a model to add many fields to an iteration of feature classes. For each step (broken into sub-models) to add a field I am checking, using a boolean Field Check script, whether the field ...
0
votes
1answer
149 views

Creating attribute field with restricted values on ArcMap? [duplicate]

I am looking to create a field in my attribute table for polyline features and I want the values for the field to be restricted to specified options (that is, a field with just YES/NO value). Any ...
4
votes
3answers
1k views

python script tool validation checkboxes to radio boxes?

I am trying to build a tool in arcmap, which uses radio buttons in its gui. Since I read, that radio buttons are not supported, I figured, it couldn't be too hard changing the behaviour of simple ...
1
vote
0answers
133 views

Determining mathematical expression for Boolean logic with 5 raster layers in ArcGIS for Desktop? [closed]

I have 5 layers in ArcGIS 10.2 for Desktop, and i want to apply Boolean Logic. What will be the mathematical expression in "Raster Calculator". I know that for to layers expression will be like ("...
1
vote
2answers
674 views

PostGIS: ST_Within returns “t”/“f” letters instead of “true”/“false” booleans

I have simple query which contains among others: SELECT ST_Within(ST_GeomFromText('POINT(lon lat)', 4326), buildings.geom) AS is_within So I expect the result column is_within to be Boolean value. ...
0
votes
1answer
141 views

Boolean GetParameterAsText in a loop

I have this tool where the user inputs an ID number and the tool selects a list of features applies symbology (.lyr) and adds the queried features to the open mxd. # Import modules import arcpy ...
3
votes
4answers
5k views

Using boolean parameters in Python Script Tool of ArcPy?

I'm using ArcGIS for Desktop 10.3.0.4322 I have a script tool which requires a parameter (folder path to a gdB, via GetParameterAsText) so that a later process can be saved there. The thing I want to ...
5
votes
2answers
1k views

How can I use boolean value in QGIS style rule?

I'm trying to make a style based on rules, and I want to use a boolean field I have created for that. But I do the following: "field" like 'TRUE' "field" like TRUE "field" like 1 "field" like '1' ...
3
votes
1answer
455 views

How to update only non-empty fields with a user input value in a model?

I have a model which iterates through a GDB, populating the same attribute field in every feature class with a parameter value. In this way I can mark all FC's in the geodatabase as to what project ...
1
vote
2answers
1k views

Enabling/disabling parameters based on Conditions/Preconditions in ModelBuilder?

I have been working with ModelBuilder and I am having trouble placing a precondition on an input parameter. However, I may be going about it in the wrong way and may just need a Python script. My ...