Competency Exercise 11.
ArcView
exercise 2: Spatial querying and MCE in ArcView
Begin
|
5/3
|
Due:
|
5/10
|
Data:
|
same as for competency ex. 10
|
|
|
Turn In:
|
Brief written answers to all questions (1-7).
|
1. SPATIAL QUERYING
There are two types of spatial analysis in ArcView. In this exercise we will
use the Select by Theme feature of ArcView to select whole features (points,
lines or polygons) that have some spatial relationship to other whole features.
In other words, we will perform spatial queries using layers with different
geographies. In ArcView exercise 3 (Competency exercise 12), we will actually
create new features based on spatial relationships between features (such as a
new polygon representing the intersection of two polygons).
Select by Theme queries based on spatial relations are of three basic kinds:
- proximity (select features
within a certain distance of another feature)
- containment (select features
contained within other features)
- intersection (select
features that cross other features)
Proximity:
The first type of query based on spatial relations is that of proximity. In
this case we are interested to select features that are within a distance of
another feature or set of features. In particular, we want to know if there
are any factories in our dataset that are located within a 200 meter buffer
zone of streams (remember that features can be points, lines, or polygons).
This is done by using the SELECT BY THEME option under THEME in the main
menu. The SELECT BY THEME dialog box selects features from the active theme
that are in some spatial relationship with the features (or selected features)
of another theme.
- The features to select are
factories (the active theme) that
- are within a distance of (200
m)
- streams (the selector theme).
We are interested in all streams, so there is no need to
prepare the selector theme. (If we wanted to know which factories are within
200 meters of particular streams we would first select those streams using a
regular attribute query.)
- Display the streams and
factories themes in a new View.
- Make the factories theme
active.
- Choose the SELECT BY THEME
option from the THEME menu.
- Choose to select features of
active themes (factories) that are within a distance of the
selected features of streams, and enter a selection distance of 200.
- Click NEW SET.
- Look at the Factories theme
in the View and also open its attribute table. Promote the selected
records to the top.
Question 1: How many factories are located within 200
meters of streams?
Question 2: If you wanted to know how many factories were located within 200
meters of the Hackensack
River, what steps
would you follow?
Clear the selected features by clicking on CLEAR SELECTED FEATURES in the
THEME menu item (with the View on top) or SELECT NONE from the Edit menu
if the Table is on top. (The "white page" icon does this as well.)
Containment:
Let's assume that the factories in our database produce chemicals that may
be dangerous in a residential area. We can query the database to find all
factories that are contained within residential areas. This is a two
step process.
The first step is to perform a single attribute query in order to
identify/isolate all residential areas. This information can be found in the
LANDUSE theme.
- Add the LANDUSE theme to
the View and make it active.
- Select TABLE from the THEME
menu. This is that database field associated with the LANDUSE layer.
Notice that the CLASS field has a general category called
URBAN, but that the LABEL field has more detailed categories such as
RESIDENTIAL and INDUSTRIAL that all fall within the URBAN class. It is this
field that we will query in this first step.
- Select QUERY from the TABLE
menu (or use the hammer icon)
- Enter the SQL command
([LABEL] = "RESIDENTIAL") and click the NEW SET button. LABEL is
the single attribute being queried. This operation selects all those
polygons in the LANDUSE layer that are residential.
- Notice that all the
selected records turn yellow as well as the features with which they are
associated. To see all selected records together in the table use PROMOTE.
- Close the Query tool dialog
box.
The second step of this containment analysis is to
select the factory sites that are contained within the residential zones
already selected. Use the SELECT BY THEME option under THEME in the main menu.
The steps for this procedure are:
- Make the FACTORIES theme
active.
- Choose SELECT BY THEME
under the THEME menu.
- Choose to select features
in the active theme (factories) that are Completely Within the
selected records of LANDUSE.SHP (records that correspond to residential
areas).
- Click the NEW SET button.
This operation selects those points (factories) that fall within the
features in the LANDUSE that are already selected (residential zones).
- You can drag the Factories
theme to the top of the list of themes in the view. If it is still
difficult to see, make the other two themes invisible. If it is still
difficult for you to see, you can also change the background of the view
by choosing Properties in the View menu, click on Select Color and choose
another color (like black).
[Note that the choices of spatial relationship available
change according to the theme used for the selection. If you don't see
"are Completely Within" be sure to enter LANDUSE as the theme used
for selection. Then go back to the type of spatial relationship/selection.]
Question 3: How many factories are located in residential areas. What are
their names?
Again, CLEAR SELECTED FEATURES from the THEME menu.
Intersection:
The last of the queries based on spatial relationship is that of intersection.
Here we will isolate/select features that are intersected (to some degree)
by a feature from another theme. The selected features are entire features and not
just the geographic location where the intersection actually occurs.
Streams in our database are of different orders (1 - 5) that correspond to
their size and volume. We are interested to isolate/select municipalities that
are intersected by order 5 streams. A single order 5 stream might flow through
(intersect with) several municipalities. This is a two step process similar to
above.
The first step is to perform a single attribute query to select just order 5
streams from the streams attribute table.
- Add the theme MUNICIP to
the View.
- Make MUNICIP and STREAMS
visible, and all other themes invisible. Drag Streams to the top of the
theme list so they will display on top of the Municiple areas.
- Make STREAMS active and
display the streams attribute table.
- Select QUERY from the TABLE
menu.
- Enter the SQL command ([ORDER]
= 5) and click the NEW SET button. ORDER is the single attribute being
queried. This operation selects all those lines (streams) in the STREAMS
theme that are of order 5.
- Notice that all the
selected records turn yellow in the table as do the corresponding features
in the View. To see all selected records together in the table use
PROMOTE.
- Close the Query tool dialog
box.
The second step of this intersection analysis is to
select the municipalities that are intersected by the already selected order 5
streams. The steps for this procedure are:
- Make the MUNICIP theme
active.
- Choose SELECT BY THEME
under the THEME menu.
- Choose to select features
in the active theme (municipalities) that intersect the selected records
of STREAMS.SHP (records that correspond to streams of order 5).
- Click the NEW SET button.
This operation selects those municipalities that intersect to some degree
the features in STREAMS that are already selected (those of order 5).
Once our query is complete there are many ways to explore
the resultant selected features/records. One way is to make summary tables that
summarize information from the selected records in the attribute table. For the
muncipalities that we have selected (those intersected by order 5 streams)
let's find out how many of them are in Bergen
county and how many are in Hudson
county. Also, what are the total number of acres in each county.
Using SUMMARY TABLE DEFINITION we can create unique summary tables and save
them in our PROJECT.
- Put the attribute table for
MUNICIP in focus (by clicking on its banner) and then click on the word
COUNTY at the top of the column/field which indicates the county of each
municipality. This will tell the SUMMARY TABLE DEFINITION function to make
summaries based on the field Counties (i.e., for each county, statistics
can be generated for other fields). Be careful not to click within the
table itself or you will de-select the municipalities intersected by order
5 streams.
- Choose the Summarize function
from the Field menu.
- The dialog allows you to
add several attributes to be summarized as well as the method of summary.
For this first summary, simply click OK with all the default values. The
result is a small table that counts the number of selected
muncipalities/records in each county.
Question 4: How many municipalities intersected by order
5 streams are in Bergen
county? How many are in Hudson
county?
- Suppose we also want to
know the sum of the acres in each county for the selected municipalities
(those that have an order 5 stream). Still with the County field chosen
and the filter on, choose Summarize from the Field menu again. This time
specify that you want to summarize the field AREA_ACRES and that you want
to summarize by SUM. Add this summary request by clicking on ADD.
- Click OK. Note that the two
tables just created can be recalled at any time from your initial PROJECT
window where they are saved.
Question 5: What is the total acreage of the
muncipalities in Bergen
county that are intersected by order 5 streams? And Hudson
county?
- Note that this Summarize
function is different from the Statistics function we used in the previous
exercise. The Statistics function operated on the attributes of the
selected field. The summarize function works on the attributes of other
fields, broken down by the attributes of the chosen field. For example, if
we selected the AREA_ACRES field, we could get the sum, avg, etc. for all
the selected records of the AREA_ACRES field using the Statistics
function. The Summarize function lets us choose a field (COUNTY) to
further break down our summary statistics -- we get the sum of the
AREA_ACRES field, for example, for each county in the COUNTY field.
Several summaries can be added to the summary table.
2. MULTI-CRITERIA EVALUATION (MCE)
The procedures used above, like those for raster analysis, can be organized
into multi-criteria evaluation problems where the objective is to find
locations (or in the case of ArcView, features) that meet several criteria. In
this section the problem is to combine several criteria that originate from
different geographies/themes using a combination of queries by attribute(s) and
queries based on spatial relationships.
In raster we explored both Boolean and non-Boolean forms of MCE, almost
always using criteria originating from different geographies (e.g. landuse and
elevation). Here, we will only examine the vector equivalent of a Boolean
approach to MCE. Non-boolean approach is harder to implement in vector format
because standartization into continuously changing suitability surfaces is
difficult.
The MCE problem is to find a place to live in the study area that is
suitable according to several criteria. Since locations must be features in
ArcView, let's look for a road on which to live. The road must meet the
following criteria:
- In a municipality with a
relatively low population density (less than 2000 in 1990),
- Close to a large lake
(within 4000 meters; area greater than 3,500,000 sq. m.),
- And within 2000 meters of a
public school.
You can think of this MCE problem in two stages
roughly analogous to standardization and aggregation in raster MCE.
Standardization will correspond in ArcView to single and multi-attribute
queries done within the attribute table of individual themes. These queries
take the range of values available for particular attributes and select from
that range just the records/features that meet our criteria. This step is
somewhat analogous to producing a raster Boolean image for each criteria.
- A single attribute query is
used to select municipalities that have a low population density from the
theme MUNICIP.
- A multi-attribute query is
used to select water bodies that are lakes AND are large in area from the theme
LAKES.
- A single attribute query is
used to select schools from all public properties in the theme PUBLIC.
After selecting each criteria the next step is to use them
for a series of spatial queries to be performed on the roads database
(this step is somewhat analogous to the raster aggregation of Boolean images).
To find the best roads on which to live, we'll repeately query the roads
database based on the spatial relationships of containment (roads within low
density muncipalities) and proximity (roads near large lakes and schools). With
each query we'll produce a smaller and smaller set of roads that are suitable,
given our criteria, by using the Select from Set option. The final result will
be only those roads that meet all criteria.
Let's start by creating a new VIEW and adding the themes called MUNICIP,
LAKES, PUBLIC and ROADS. We'll first perform all the individual attribute
queries and then later perform a series of spatial queries on the roads
database.
Selecting low density municipalities:
- Display the MUNICIP theme
and its attribute table. (It may be helpful to make visible only the theme
you are currently working on.) Make it active.
- Perform a single attribute
query using QUERY. Build an SQL statement such that only municipalities
with a population density < 2000 in 1990 will be selected.
- Click NEW SET and PROMOTE
the selected records in your table.
- Close the QUERY BUILDER,
close the attribute table, and turn off the display for MUNICIP.
Selecting water bodies that are lakes AND large in area:
- Display the LAKES theme and
its attribute table. Make it active.
- Here perform a
multi-attribute query using QUERY. Build an SQL statement that will select
water bodies with a WATBOD number of 3 (lakes) AND an AREA > 3500000
sq. meters.
- Click NEW SET and PROMOTE
the selected records in your table.
- Close QUERY BUILDER, close
the table, and turn off the display.
Selecting schools from the theme of public properties:
- Display the PUBLIC theme
and its attribute table. Make it active.
- Perform a single attribute
query using QUERY. Build an SQL statement that will select all properties
where the attribute TYPE = "SCHOOL".
- Click NEW SET and PROMOTE
the selected records in your table.
- Close QUERY BUILDER, close
the table, and turn off the display.
Review all criteria created by turning on the display for each
theme one at a time. Our objective is to find roads that are within the
selected municipalities, near the selected lakes, and near the selected
schools.
Using each criteria to query the roads database:
- Display the theme ROADS.
- Make it active and display
its attribute table. This is the set of roads that we are going to
continually reduce with each query until only the suitable roads are
selected.
- The first query will find
all those roads that are contained within the low population density
municipalities, a query based on spatial relationship. Make the ROADS
theme active and choose SELECT BY THEME. Select the features of the active
theme (ROADS) that are completely within the already selected
features of MUNICIP.SHP (those of low density). (Remember, you may need to
choose the selector theme first, then the relationship.)
- Click on NEW SET to select a
new set of roads. We have now reduced the set of suitable roads by
considering our first criteria. Note the set of yellow roads in your view
and attribute table.
Now consider the next criteria, proximity to large lakes.
The procedure is nearly the same except in our second query (again using SELECT
BY THEME) we will not create a new set. Instead we will select roads
from the existing set (the roads currently in yellow).
- Make the ROADS theme active
and again choose SELECT BY THEME from the THEME menu. This time we want to
select features of the active theme (ROADS) that are within a distance
of the already selected features in LAKES.SHP (large lakes). Specify a
distance of 4000 meters.
- Click on SELECT FROM SET
(not NEW SET). This will select only from the already existing set of
selected roads rather than all roads.
- View the result. You should
notice that the number of suitable roads has been reduced a second time.
The final criterion, distance from schools, will again
reduce the roads that are suitable. Again, the method is to make the roads
theme active and use SELECT BY THEME on the existing set of select roads.
- Choose SELECT BY THEME from
the the THEME menu. Specify that you want to select features of the active
theme (ROADS) that are within a distance of the already selected
features in PUBLIC.SHP (schools). Specify a distance of 2000 meters.
- Click on SELECT FROM SET (not
NEW SET). This will again select the already existing set of selected
roads rather than all roads from the original attribute table.
- View the result. The number
of suitable roads is reduced for a third time (once for each criteria).
The final result is, in a sense, the locations (features)
that exactly meet each of our criteria. These roads are the result of a Boolean
intersection (logical AND) of all criteria. These are roads that are contained
within low density municipalities AND are within 4000m of large lakes AND are
within 2000m of public schools.
Question 6: How many roads are selected?
In the roads theme, segments of the same road are recorded as separate
features. To prepare a more usable summary of information, we can use the
Summarize option from the Table menu. In our summary table, we want to list
each road name only once. We will automatically see the number of records that
have each road name. We will also add the name of the municipality to the
summary table.
- Put the roads attribute
table in focus (remember do not click inside the table itself or
you will de-select all the roads that have been selected) and click on the
column heading for the names of the roads (FNAME).
- Choose Summary from the
Field menu. (Or use the icon --the one with the summa.) This will
open the SUMMARY TABLE DEFINITION dialog and allow you to make summaries
based on road names.
- Choose to summarize the
field MUN (the muncipality names) and summarize by FIRST. ADD this summary
option and click OK.
- View the result. The new
table should have 3 columns: one for the road names, one that indicates
the number of line features making up each road, and one for the
muncipality to which each road belongs.
- Finally click on the column
heading FIRST_MUN in the summary table and choose to sort ascending in the
Field menu.
Question 7: How many roads in the muncipality called
Montvale Boro meet all of our criteria?