150
Chapter 6 Using GIS for Spatial Analysis
a Greater Than (>) or Greater Than Or Equal To (>=): This is used for selecting values that are more than (or more than or equal to) a particular
value.
a Less Than (<) or Less Than Or Equal To (=<): This is used for selecting
values below (or below and equal to) a particular value.
While a simple query only uses one operator and one field, a compound
query enables you to make selections using multiple criteria. There are different ways of linking multiple criteria together for creating one of these types of
compound queries, each using a different option of querying (referred to as a
Boolean operator):
a AND: For instance, you want to select cities in Ohio that have a population of over 50,000 (a variable called POP2010 in the attribute table) and
an average household income (a variable called AVERAGEHI) of more
than $30,000. A compound query can combine these two requests by saying: POP2010>= 50000 AND AVERAGEHI > 30000. Because “AND” is
being used as the operator, only records that match both the criteria get
returned by the query. If an attribute only meets one criterion, it is not
selected. An “AND” query is referred to as an Intersection since it returns
what the two items have in common.
a OR: A different query could be built by saying: POP2010>= 50000 OR
AVERAGEHI > 30000. This would return records of cities with a population of greater than or equal to 50,000, or cities with an average household income of greater than $30,000, or cities that meet both. When an
OR operator is being used, records that meet one or both criteria are
selected. An “OR” query is referred to as a Union since it returns all the
elements of both operations.
a NOT: A third query could be built around the concept that you want all of
the data related to one criteria, but to exclude what relates to the second
criteria. For instance, if you want to select cities with a high population,
but not those with a higher average household income, you could build a
query like: POP2010>= 50000 NOT AVERAGEHI > 30000 to find those
particular records. A “NOT” query is referred to as a Negation since it
returns all the elements of one dataset, but not what they have in common with the other.
a XOR: A final type of query can be built using the idea that you want all
of the data from each layer, except for what they have in common. For
instance, if you wanted to find those cities with a high population or those
that had high incomes, but not both types of cities, your query would be:
POP1990>= 50000 XOR AVERAGEHI > 30000. XOR works as the opposite of AND since it returns all data, except for the intersection of the
datasets. An “XOR” query is referred to as an Exclusive Or, since it acts
like a Union but leaves out the Intersection data.
Compound queries can use multiple operations to select multiple records
by adhering to an order of operations, such as: (POP2010>=50000 AND
compound query a
query that contains
more than one operator.
Boolean operator one
of the four connectors
(AND, OR, NOT, XOR)
used in building a
compound query.
AND the Boolean
operation that
corresponds with an
Intersection operation.
Intersection the
operation wherein the
chosen features are
those that meet both
criteria in the query.
OR the Boolean
operator that
corresponds with
Union operation.
Union the operation
wherein the chosen
features are all that
meet the first criteria
as well as all that meet
the second criteria in
the query.
NOT the Boolean
operator that
corresponds with a
Negation operation.
Negation the
operation wherein the
chosen features are
those that meet all of
the first criteria and
none of the second
criteria (including
where the two criteria
overlap) in the query.
XOR the Boolean
operator that
corresponds with an
Exclusive Or operation.
Chapter 6 Using GIS for Spatial Analysis
a Greater Than (>) or Greater Than Or Equal To (>=): This is used for selecting values that are more than (or more than or equal to) a particular
value.
a Less Than (<) or Less Than Or Equal To (=<): This is used for selecting
values below (or below and equal to) a particular value.
While a simple query only uses one operator and one field, a compound
query enables you to make selections using multiple criteria. There are different ways of linking multiple criteria together for creating one of these types of
compound queries, each using a different option of querying (referred to as a
Boolean operator):
a AND: For instance, you want to select cities in Ohio that have a population of over 50,000 (a variable called POP2010 in the attribute table) and
an average household income (a variable called AVERAGEHI) of more
than $30,000. A compound query can combine these two requests by saying: POP2010>= 50000 AND AVERAGEHI > 30000. Because “AND” is
being used as the operator, only records that match both the criteria get
returned by the query. If an attribute only meets one criterion, it is not
selected. An “AND” query is referred to as an Intersection since it returns
what the two items have in common.
a OR: A different query could be built by saying: POP2010>= 50000 OR
AVERAGEHI > 30000. This would return records of cities with a population of greater than or equal to 50,000, or cities with an average household income of greater than $30,000, or cities that meet both. When an
OR operator is being used, records that meet one or both criteria are
selected. An “OR” query is referred to as a Union since it returns all the
elements of both operations.
a NOT: A third query could be built around the concept that you want all of
the data related to one criteria, but to exclude what relates to the second
criteria. For instance, if you want to select cities with a high population,
but not those with a higher average household income, you could build a
query like: POP2010>= 50000 NOT AVERAGEHI > 30000 to find those
particular records. A “NOT” query is referred to as a Negation since it
returns all the elements of one dataset, but not what they have in common with the other.
a XOR: A final type of query can be built using the idea that you want all
of the data from each layer, except for what they have in common. For
instance, if you wanted to find those cities with a high population or those
that had high incomes, but not both types of cities, your query would be:
POP1990>= 50000 XOR AVERAGEHI > 30000. XOR works as the opposite of AND since it returns all data, except for the intersection of the
datasets. An “XOR” query is referred to as an Exclusive Or, since it acts
like a Union but leaves out the Intersection data.
Compound queries can use multiple operations to select multiple records
by adhering to an order of operations, such as: (POP2010>=50000 AND
compound query a
query that contains
more than one operator.
Boolean operator one
of the four connectors
(AND, OR, NOT, XOR)
used in building a
compound query.
AND the Boolean
operation that
corresponds with an
Intersection operation.
Intersection the
operation wherein the
chosen features are
those that meet both
criteria in the query.
OR the Boolean
operator that
corresponds with
Union operation.
Union the operation
wherein the chosen
features are all that
meet the first criteria
as well as all that meet
the second criteria in
the query.
NOT the Boolean
operator that
corresponds with a
Negation operation.
Negation the
operation wherein the
chosen features are
those that meet all of
the first criteria and
none of the second
criteria (including
where the two criteria
overlap) in the query.
XOR the Boolean
operator that
corresponds with an
Exclusive Or operation.
