Entry
Reader's guide
Entries A-Z
Subject index
Logical Expressions
Logical expressions are statements that follow the rules of propositional logic both in their composition and their evaluation. They are used ubiquitously in programming and GIS applications to express the conditions or constraints that must be met prior to conducting certain operations.
Most logical expressions have a simple structure: two operands P and Q, connected with each other through a logical operator, such as AND, OR, XOR (exclusive OR), IMPLIES, and so on. All expressions evaluate to one of only two truth values: true or false. For example, the logical expression
P AND Q
evaluates to true if and only if both P and Q are true and evaluates to false in all other cases.
Both the operands of a logical expression and the expression itself can be made subject to the NOT modifier. For instance, the logical expression
NOT(P) AND Q
evaluates to true if and only if P is false and Q is true and evaluates to false in all other cases. Similarly, the expression
NOT(P AND Q)
evaluates to true if and only if either P or Q is false.
Logical Operators
Table 1 is a truth table that shows the truth values (true or false) for various logical expressions containing two operands and a single logical operator. These operators are described in the following sections.
Conjunction: AND
The conjunction P AND Q (in formal logic often written as PλQ) evaluates to true if both P and Q evaluate to true. The application of this type of expression is straightforward, as we can use it to say that a specific action X must be taken in case both P and Q are true. For instance,
Condition: if a location is within the metropolitan growth boundary AND the location is zoned “industrial”
Action: add the location to the list of candidates for development of an industrial park
Disjunction: OR
The disjunction P OR Q (in formal logic often written as PηQ) evaluates to true if either P or Q is true. Disjunctions are easier to satisfy than conjunctions; in Table 1, PηQ evaluates to true in three of the four combinations of P's and Q's truth values, whereas the conjunction PλQ is true only in one of the four combinations.
| Table 1 Truth Table | ||||
|---|---|---|---|---|
| P, Q | P, Not(Q]) | Not(P), Q | Not(P), Not(Q) | |
| P AND Q | true | false | false | false |
| P OR Q | true | true | true | false |
| P XOR Q | false | true | true | false |
| P NAND Q | false | true | true | true |
| P NOR Q | false | false | false | true |
| P implies Q | true | false | true | true |
Exclusive or: XOR
The exclusive or expression P XOR Q (sometimes written as P⊕Q) evaluates to true if one of the operands P or Q is true and the other is false. The XOR is not elementary like OR and AND, as it can be rewritten as
- (P AND NOT(Q)) OR (NOT(P) AND Q)
XOR expressions are used less frequently than conjunctions and disjunctions. They have some interesting applications, however. One of these is as a means to quickly convert between various series of operator values. To illustrate this, let the series 1101 represent four logical operands, P, Q, R and S, with a 1 representing true and a 0 representing false. XORing this series with another series, say 0101, yields 1101 XOR 0101 = 1000. Interestingly, if we now XOR, the result (1000) again with the series 0101, we obtain the original series back: 1000 XOR 0101 = 1101. Since series of 1s and 0s are used to represent numbers in binary form and since computers can manipulate binary numbers very rapidly, XORing is often used in computer programs that require certain properties to flip back and forth between two predefined values, using a third value as the XOR intermediary.
...
- Analytical Methods
- Analytical Cartography
- Cartographic Modeling
- Cost Surface
- Cost-Benefit Analysis
- Data Mining, Spatial
- Density
- Diffusion
- Ecological Fallacy
- Effects, First- and Second-Order
- Error Propagation
- Exploratory Spatial Data Analysis (ESDA)
- Fragmentation
- Geocoding
- Geodemographics
- Geographical Analysis Machine (GAM)
- Geographically Weighted Regression (GWR)
- Georeferencing, Automated
- Geostatistics
- Geovisualization
- Image Processing
- Interpolation
- Intervisibility
- Kernel
- Location-Allocation Modeling
- Minimum Bounding Rectangle
- Modifiable Areal Unit Problem (MAUP)
- Multicriteria Evaluation
- Multidimensional Scaling (MDS)
- Multivalued Logic
- Network Analysis
- Optimization
- Outliers
- Pattern Analysis
- Polygon Operations
- Qualitative Analysis
- Regionalized Variables
- Slope Measures
- Spatial Analysis
- Spatial Autocorrelation
- Spatial Econometrics
- Spatial Filtering
- Spatial Interaction
- Spatial Statistics
- Spatial Weights
- Spatialization
- Spline
- Structured Query Language (SQL)
- Terrain Analysis
- Cartography and Visualization
- Analytical Cartography
- Cartograms
- Cartography
- Choropleth Map
- Classification, Data
- Datum
- Generalization, Cartographic
- Geovisualization
- Isoline
- Legend
- Multiscale Representations
- Multivariate Mapping
- National Map Accuracy Standards (NMAS)
- Normalization
- Projection
- Scale
- Shaded Relief
- Symbolization
- Three-Dimensional Visualization
- Tissot's Indicatrix
- Topographic Map
- Virtual Environments
- Visual Variables
- Conceptual Foundations
- Accuracy
- Aggregation
- Cognitive Science
- Direction
- Discrete versus Continuous Phenomena
- Distance
- Elevation
- Extent
- First Law of Geography
- Fractals
- Geographic Information Science (GISci)
- Geographic Information Systems (GIS)
- Geometric Primitives
- Isotropy
- Layer
- Logical Expressions
- Mathematical Model
- Mental Map
- Metaphor, Spatial and Map
- Nonstationarity
- Ontology
- Precision
- Representation
- Sampling
- Scale
- Scales of Measurement
- Semantic Interoperability
- Semantic Network
- Spatial Autocorrelation
- Spatial Cognition
- Spatial Heterogeneity
- Spatial Reasoning
- Spatial Relations, Qualitatitve
- Topology
- Uncertainty and Error
- Data Manipulation
- Data Modeling
- z-Values
- Computer-Aided Drafting (CAD)
- Data Modeling
- Data Structures
- Database Management System (DBMS)
- Database, Spatial
- Digital Elevation Model (DEM)
- Discrete versus Continuous Phenomena
- Elevation
- Extensible Markup Language (XML)
- Geometric Primitives
- Index, Spatial
- Integrity Constraints
- Layer
- Linear Referencing
- Network Data Structures
- Object Orientation (OO)
- Open Standards
- Raster
- Scalable Vector Graphics (SVG)
- Spatiotemporal Data Models
- Structured Query Language (SQL)
- Tessellation
- Three-Dimensional GIS
- Topology
- Triangulated Irregular Networks (TIN)
- Virtual Reality Modeling Language (VRML)
- Design Aspects
- Geocomputation
- Geospatial Data
- Accuracy
- Address Standard, U.S.
- Attributes
- BLOB
- Cadastre
- Census
- Census, U.S.
- Computer-Aided Drafting (CAD)
- Coordinate Systems
- Data Integration
- Datum
- Digital Chart of the World (DCW)
- Digital Elevation Model (DEM)
- Framework Data
- Gazetteers
- Geodesy
- Geodetic Control Framework
- Geography Markup Language (GML)
- Geoparsing
- Georeference
- Global Positioning System (GPS)
- Interoperability
- LiDAR
- Linear Referencing
- Metadata, Geospatial
- Metes and Bounds
- Minimum Mapping Unit (MMU)
- National Map Accuracy Standards (NMAS)
- Natural Area Coding System (NACS)
- Photogrammetry
- Postcodes
- Precision
- Projection
- Remote Sensing
- Scale
- Semantic Network
- Spatial Data Server
- Standards
- State Plane Coordinate System
- TIGER
- Topographic Map
- Universal Transverse Mercator (UTM)
- Organizational and Institutional Aspects
- Address Standard, U.S.
- Association of Geographic Information Laboratories for Europe (AGILE)
- Canada Geographic Information System (CGIS)
- Census, U.S.
- Chorley Report
- Coordination of Information on the Environment (CORINE)
- COSIT Conference Series
- Data Access Policies
- Data Warehouse
- Digital Chart of the World (DCW)
- Digital Earth
- Digital Library
- Distributed GIS
- Enterprise GIS
- Environmental Systems Research Institute, Inc. (ESRI)
- ERDAS
- Experimental Cartography Unit (ECU)
- Federal Geographic Data Committee (FGDC)
- Framework Data
- Geomatics
- Geospatial Intelligence
- GIS/LIS Consortium and Conference Series
- Google Earth
- GRASS
- Harvard Laboratory for Computer Graphics and Spatial Analysis
- IDRISI
- Intergraph
- Interoperability
- Land Information Systems
- Life Cycle
- Location-Based Services (LBS)
- Manifold GIS
- MapInfo
- Metadata, Geospatial
- MicroStation
- National Center for Geographic Information and Analysis (NCGIA)
- National Geodetic Survey (NGS)
- National Mapping Agencies
- Open Geospatial Consortium (OGC)
- Open Source Geospatial Foundation (OSGF)
- Open Standards
- Ordnance Survey (OS)
- Quantitative Revolution
- Software, GIS
- Spatial Data Infrastructure
- Spatial Decision Support Systems
- Standards
- U.S. Geological Survey (USGS)
- University Consortium for Geographic Information Science (UCGIS)
- Web GIS
- Web Service
- Societal Issues
- Access to Geographic Information
- Copyright and Intellectual Property Rights
- Critical GIS
- Cybergeography
- Data Access Policies
- Digital Library
- Economics of Geographic Information
- Ethics in the Profession
- Geographic Information Law
- Historical Studies, GIS for
- Liability Associated With Geographic Information
- Licenses, Data and Software
- Location-Based Services (LBS)
- Privacy
- Public Participation GIS (PPGIS)
- Qualitative Analysis
- Quantitative Revolution
- Spatial Literacy
- Loading...
Get a 30 day FREE TRIAL
-
Watch videos from a variety of sources bringing classroom topics to life
-
Read modern, diverse business cases
-
Explore hundreds of books and reference titles
Sage Recommends
We found other relevant content for you on other Sage platforms.
Have you created a personal profile? Login or create a profile so that you can save clips, playlists and searches