149
How Can Data Be Retrieved From a GIS for Analysis?
querying a layer or database to find what attributes meet certain conditions.
For example, a layer made up of points representing cities in Ohio also has a
number of fields representing its attributes, such as city name, population,
and average income. If you just wanted to do analysis with one of these records
(the city called “Boardman”), then a query could be built to find all records
where the field called CITY_NAME contained the characters of ‘Boardman’
as: CITY_NAME = ‘Boardman’. This should return one record for you to use
in your analysis. Another example would be to select all cities in Ohio with a
population greater than or equal to 50,000 persons. The attribute table has a
field called POP2010 (representing the 2010 city population) that contains
this information. Thus, a query of POP2010 >= 50000 could be built, and all
records whose population field contains a value of greater than or equal to the
number 50,000 would be selected for your use (see Figure 6.2 for an example
of a query in GIS).
A query will use one of the following relational operators:
a Equal (=): This is used when you want to find all values that match the
query. For instance, querying for CITY_NAME = ‘Poland’ will locate all
records that exactly match the characters in the string that comprise the
word ‘Poland’. If the record was called ‘Poland Township’ it would not be
located since the character string looks for an exact match.
a Not Equal (<>): This is used when you want to find all the records that
do not match a particular value. For instance, querying for CITY_NAME
<> ‘Poland’ will return all the records that do not have a character string
of the word ‘Poland’ (which would probably be all of the other cities with
names in the database).
FIGURE 6.2 A database
query for Ohio cities
returning multiple records
(selected records and
their corresponding cities
are in cyan). (Source: Esri®
ArcGIS ArcMap ArcView
graphical user interface
Copyright © Esri.)
relational operator
one of the six
connectors (=, < >, <, >,
>=, or =<) used to build
a query.
Précédent

- 169/522

Suivant