9. Analyzing
Spatial Relationships
9.2 Spatial
Join
Containment Spatial Join
(point-in-polygon)
Proximity Spatial Join (point-to-point)
Let¡¯s look at
the relationship between city and 20 min fly circles illustrated above. ArcView
Theme-on-theme selection allows for selecting cities within the fly circle. But
can we identify which fly circles serve which cities? Actually we can do this
at least one by one. But it is too time-consuming. What if we want to have a
statistics of all fly circles, such as how many cities are served and how many
people are served by the fly circles in the entire country. If we look at the
relation between them, we can say cities are within fly circles. In that case,
point is in polygon. Sometimes this relation is called point-in-polygon
overlay. Graphically the relation is as follows:
In terms of
theme tables, the relation can be shown as follows:
If you join
two theme attribute tables together using their Shape field as the common
field, ArcView automatically bases the join on the spatial relationship between
the features in the two themes. This is called a spatial join.
A spatial
join is similar to an attribute join; however it is based on the spatial
relationship between the features in the two themes. For each feature
represented in the destination table, ArcView looks to see if it has one of the
following spatial relationships with any feature represented in the source
table, and if it does, that feature's record from the source table is joined
into the destination (target) table:
¡¡ |
source theme |
¡¡ |
¡¡ |
¡¡ |
target theme |
¡¡ |
point |
line |
polygon |
point |
¡¡ |
nearest |
nearest |
inside |
line |
¡¡ |
nearest |
part of |
inside |
polygon |
¡¡ |
n/a |
n/a |
inside |
We typically deal with
point-in-polygon relation, which is called containment spatial join, and
point-to-point relation, which is called proximity spatial join.
Containment Spatial Join (point-in-polygon)
Open a source
theme table; Polygon theme is the source theme. (e.g., fly circle)
Open a target
theme table; Point theme is the target theme. (e.g., city theme)
Click the
[Shape] field for a source theme table, and then click the [Shape] field for a
target theme table.
Select the Join
button .
The source
theme attributes will be appended to the target theme table.
Summarize on the fly
circle; Click the field [Rad_20m_id] and select the Summarize button ; In the Summary Table definition dialog box, select pop_98
for the Field, and sum for the Summarize by, and then press Add button; Press
OK button.
The summary table shows
how many cities and how many people each fly circle serves as shown in the
field [Count] and [Sum_Pop_98].
Join this summary table
to the theme table of a 20 minutes fly circle. Make a thematic map showing the
population served by each fly circle. This map clearly shows the degree to
which each fly circle is likely to be congested.
If you want to save this
theme permanently, you can do so by choosing Convert to Shapefiles¡¦ in the
Theme menu when the theme is made active. When you selected some features among
this active theme, only the selected features will be converted to the
shapefiles.
Proximity Spatial Join (point-to-point)
Finding the nearest
facilities from a certain facilities would be asked quite often. For example,
where is the nearest post office from your office? Where is the nearest DMV
office?, and so on. Proximity spatial join allows you to get a complete list of
nearest relation between source and target theme. In our example, we want to
assign each helipad to the nearest hospital. The hospital is the target theme,
and the helipad becomes the source theme. The join is performed based on the
nearest relationship.
Result:
Target theme to which source theme attributes are appended along with Distance
field.
Open target theme table
(hospital); select the field [shape]
Open source theme table
(helipad); select the field [shape]
Select the Join button .
The source theme
attributes will be appended to the target theme. ArcView adds a Distance field
to the target table. This field is automatically calculated by ArcView and
contains the distance to the nearest feature represented in the source table
for each feature represented in the destination table. The distance is
calculated in the view¡¯s map units. Query hospital based on the attributes
appended from a source theme tables (e.g., helipad id), and label the distance
to a specific helipad.