©2007 austin troy lecture 8: introduction to gis 1.multi-layer vector query operations in arc gis...

43
©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University of Vermont

Upload: adelia-mcgee

Post on 17-Dec-2015

237 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Lecture 8:

Introduction to GIS

1. Multi-layer vector query operations in Arc GIS

2. Vector Spatial Joining

Lecture by Austin Troy, University of Vermont

Page 2: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

1. Multi-layer vector queries in Arc GIS

Page 3: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Let’s say we want get information about all the houses in four sample neighborhoods and see which ones overlay fire hazard zones

Selecting By Location

Page 4: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Now with “sample houses” active, we click select by theme and tell it to choose features that intersect the features of fire hazard zone

Layer to be selected

Selection Method

Selection rule

Selection overlay theme

Selecting By Location

Page 5: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Those that overlay a hazard zone are selected

selected

Not selected

Selecting By Location

Page 6: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

…Zooming in to one of those neighborhoods

Selecting By Location

Page 7: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Now run statistics on the selection; 1955 houses overlay fire zones; mean price is $467,551!

Selecting By Location

Page 8: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Invert selection; non fire zone houses are worth less on average!Only $246,752

Selecting By Location

Page 9: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Select houses within 1 mile of a StarbucksSelecting By Location:Distance

Page 10: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

This time we use a different selection method with different parameters

Selecting By Location :Distance

Note how we can specify the distance for selection

Page 11: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Results in the following selectionSelecting By Location :Distance

Page 12: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Zooming into a neighborhood…Selecting By Location :Distance

Page 13: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Now if we run statistics on price again…Selecting By Location :Distance

Those within a mile of a Starbucks have a mean value of $504,972

Those not within a mile of a Starbucks have a mean value of $273,866!

By the way, these are real data, I’m not making this up!!

Page 14: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

For that same selection we could get statistics on a different variable—here we’ll look at lot size

Selecting By Location :Distance

Those within a mile of a Starbucks have a mean size of 8776 square feet

Those not within a mile of a Starbucks have a mean lot size of 10,024 sq feet. Why might that be?

Page 15: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Linear feature: selecting houses in a neighborhood within a mile of a highway

Selecting By Location :Distance

Note that these smaller roads are in a different layer

Page 16: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Selecting based on existing selection

Find homes within 500 meters of Valley Blvd. (let’s say there’s going to be a parade and the city needs to inform all those homeowners near that street).

Query Hwyname = “Valley Blvd”

Selecting By Location :Distance

Page 17: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Once that feature is selected we can do a “select by location” operation

Selecting By Location :Distance

Notice that this time we check “Use selected features”

Page 18: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Thus we end up only selecting those houses within 500 m of Valley Blvd, and none within 500 m of other roads

Selecting By Location :Distance

Page 19: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Spatial overlap problem: whole polygon will be selected even if only a small part is coincident, assuming we are using the default selection overlay method, “intersect.”

Selecting By Location: Polygons

However, there are many other methods we can choose from that will change the number of polygons selected.

Page 20: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Example: let’s select any census tract that intersects even slightly with a fire zone; here’s the pre-selection map

Selecting By Location: Polygons

Page 21: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Using the “intersect” overlay method we get thisSelecting By Location: Polygons

Page 22: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

Using “that are completely within” method, we get no selected feature. But, with “have their center in” we get

Selecting By Location: Polygons

Page 23: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Likewise, if we select Merced County in the counties layer, activate “highways” in the TOC, and then select by theme, we will only choose those road segments that intersect that county

Introduction to GIS

Selecting By Location on Selections

Page 24: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Note that the resulting selection was made using the “intersect method.” If the “completely within” method is used, a different set of lines will be selected

Introduction to GIS

Selecting By Location on Selections

Page 25: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Left: intersect method

Right: completely within method

Introduction to GIS

Selecting By Location on Selections

Page 26: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Once a selection has been done using “select by location” you can do all the same things you would do with a normal single-layer selection:– Make a new layer from the selection

– Do statistics on it

– Make a new field in that layer (e.g.a field called “Parade”, where “yes” means the house is within 500m of the parade route).

– Calculate or recalculate a field for a selection

Introduction to GIS

What can be done with multi-layer selections?

Page 27: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Introduction to GIS

2. Vector Spatial Joining —assigning attributes by location

Page 28: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join

Introduction to GIS

• Assigns attribute data from features in one layer to spatially coincident features in another

• Can assign polygon data to a point that overlays• Can assign point to point and point to line

distances between two layers• Simply adds attributes to

the DBF table

Page 29: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join

Introduction to GIS

• We access Spatial Join by right clicking on the “to” layer and clicking Joins and Relates>>join

• We then specify that we want to join by location and choose which layer we are joining from

Page 30: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join

Introduction to GIS

• In this case we are going to join tracts to the houses from our sample neighborhoods. Each house inherits all the attributes of the tract in which it falls.

Note that this creates a new layer

Page 31: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join

Introduction to GIS

• Plot of houses graduated by percent unemployment of the tract to which they belong

Page 32: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Distance

Introduction to GIS

• We can also do spatial joins based on distance. Whenever we join a point or line layer to another point or line layer, for each feature in the TO layer it gives us the attributes of the nearest feature in the FROM layer PLUS the distance between those features in whatever map units we specify

Page 33: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Distance

Introduction to GIS

• Use Spatial Join to assign as attribute to our house point layer the name of the nearest major road.

Page 34: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Distance

Introduction to GIS

• Two options: choose to numerically summarize for each point the values of the lines intersecting it, or assign all attributes from the nearest line.

My FROM layer

Page 35: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Distance

Introduction to GIS

• Now name of nearest highway is an attribute for each housing point

Page 36: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Distance

Introduction to GIS

• Distance from each point to the nearest road feature was also recorded under the attribute “Distance.”

Page 37: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Distance

Introduction to GIS

• We can also do a join to get the distance from a series of points in one layer to a series of points in another: here is distance of houses to nearest Starbucks

Page 38: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Polygons

Introduction to GIS

• What about polygons? Problem: a polygon is layer A may overlay several polygons in layer B, so whose attributes to you give it?

Layer A

Layer B

Page 39: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Polygons

Introduction to GIS

• Answer: we can do spatial join and summarize (by average, for instance) each polygon in layer A the values of all the overlapping polygons in layer B.

• Example: Marketing study; have a census tract layer with all sorts of demographic info (population, race, etc) and a zip code layer with no demographic info attached to it. Client needs map showing median age and percent Hispanic by zip code.

Page 40: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Polygons

Introduction to GIS

• Unfortunately, the tract boundaries and zip code boundaries do not match up in the slightest. Note that tracts are not nested within zip codes—they cut across

Page 41: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Polygons

Introduction to GIS

• Do a spatial join of two polygon layers and choose the “summarize” option (the first radio button). Choose a statistic by which to summarize values

Page 42: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Spatial Join:Polygons

Introduction to GIS

• Plot of median age

Page 43: ©2007 Austin Troy Lecture 8: Introduction to GIS 1.Multi-layer vector query operations in Arc GIS 2.Vector Spatial Joining Lecture by Austin Troy, University

©2007 Austin Troy

Vector Limitations

Introduction to GIS

• Multi-layer vector polygon analysis is limited in that generally polygons in different layers are of different sizes and shapes: irregular minimum mapping unit

• Next week we will discuss how vector geoprocessing can be used to help overcome this to a certain extent

• Geoprocessing includes methods by which vector features are broken down into smaller features, or aggregated into larger features.