Intro to Spatial Analysis (mostly 2D)
description
Transcript of Intro to Spatial Analysis (mostly 2D)
![Page 1: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/1.jpg)
CS 128/ES 228 - Lecture 12a 1
Intro to Spatial Analysis (mostly 2D)
![Page 2: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/2.jpg)
CS 128/ES 228 - Lecture 12a 2
Some GIS Queries How big is the lake? What is the longest trail? How many fire hydrants on campus? Which dorms are within 100 m of an
academic building? Where is the best place for a new
dorm?
![Page 3: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/3.jpg)
CS 128/ES 228 - Lecture 12a 3
Types of queries Aspatial – make no reference to
spatial data Which dorm has the highest occupancy
rate? (we can already do) Spatial – make reference to spatial
(and possibly attribute) data Which fire hydrant is closest to the
chemistry labs? (we can sort of do)
![Page 4: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/4.jpg)
CS 128/ES 228 - Lecture 12a 4
Time for some geometry!
![Page 5: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/5.jpg)
CS 128/ES 228 - Lecture 12a 5
“Simple” spatial queries How long is this line?
“Tricky” if line is a bunch of line segments
“Tricky” if distance isn’t Pythagorean How much area does this polygon
cover? (Can we do this?) Is this point in this polygon? (Can’t
do this!)
![Page 6: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/6.jpg)
CS 128/ES 228 - Lecture 12a 6
Conventional Distance The Pythagorean
Theorem helps us compute “conventional” distances in the plane
Of course ArcMap does it automatically
![Page 7: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/7.jpg)
CS 128/ES 228 - Lecture 12a 7
“Alternative” distance “Manhattan” distance How many blocks (via a
taxi cab) from A to B? ArcMap can do this in a
query/report
A
B
What about one-way streets?
![Page 8: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/8.jpg)
CS 128/ES 228 - Lecture 12a 8
Not your mother’s “Distance”
More complex distances require more complex analysis
![Page 9: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/9.jpg)
CS 128/ES 228 - Lecture 12a 9
Area (by vector) Area of a
rectilinearly aligned trapezoid is easy. A B
CC*(A+B)/2
![Page 10: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/10.jpg)
CS 128/ES 228 - Lecture 12a 10
Area (by vector)
For a polygon, add up the (signed) trapezoidal areas
![Page 11: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/11.jpg)
CS 128/ES 228 - Lecture 12a 11
Area (by Raster) Simply count the
rasters inside the polygon
orHow big is this?
![Page 12: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/12.jpg)
CS 128/ES 228 - Lecture 12a 12
Area (by ArcMap)
![Page 13: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/13.jpg)
CS 128/ES 228 - Lecture 12a 13
Points in Polygon Send out a
“ray” and count the crossings. ODD implies
inside EVEN implies
outside3 Crossings => INSIDE2 Crossings => OUTSIDE
![Page 14: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/14.jpg)
CS 128/ES 228 - Lecture 12a 14
Overlaying vector layers
Spatial information (from layers) can be used to create new spatial information (i.e. new layers)
![Page 15: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/15.jpg)
CS 128/ES 228 - Lecture 12a 15
Overlaying Layers (Intersection) Keep only those things that belong
to both layers
Example: Overlay my property with a hydrology layer Learn how much of my “land” is under
water. What to do about the property
boundary and the lake?
![Page 16: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/16.jpg)
CS 128/ES 228 - Lecture 12a 16
Overlaying Layers (Intersection)
Keep any things that belong to either layer
Example: Overlay state highways layer and local roads layer to create pavement layer
Note: New Layer not actually created in this figure
![Page 17: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/17.jpg)
CS 128/ES 228 - Lecture 12a 17
Overlaying Layers (Clipping) Keep only those things from a given
layer that lie within a specified boundary (often rectangular)
Example: Consider only those roads that lie within Cattaraugus County Problem: What if a road crosses the
boundary?
![Page 18: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/18.jpg)
CS 128/ES 228 - Lecture 12a 18
DIGRESSION: What are rasters?
Vector layers with a single attribute datum?
![Page 19: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/19.jpg)
CS 128/ES 228 - Lecture 12a 19
Overlaying Rasters Simple Mathematics will often
suffice
But there is less information
![Page 20: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/20.jpg)
CS 128/ES 228 - Lecture 12a 20
Effective Overlaying via Reclassification Data is not always in a good format
If raster pixels have different coverages, overlaying may be effectively impossible
Codings are generally categorical, not mathematical Adding codings usually does not make sense
Solution: RECLASSIFY
![Page 21: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/21.jpg)
CS 128/ES 228 - Lecture 12a 21
A Sample ReclassificationLand Use
Old value
New value
“Other” new value
Wetland 7 1 4Road 10 0 0Lake 12 1 7Forest 14 0 1
![Page 22: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/22.jpg)
CS 128/ES 228 - Lecture 12a 22
Buffering – another tool Buffering (building
a neighborhood around a feature) is a common aid in GIS analysis
![Page 23: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/23.jpg)
CS 128/ES 228 - Lecture 12a 23
Using Buffers to Select
• Select the features
• Save the features as a layer
• (Export)
![Page 24: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/24.jpg)
CS 128/ES 228 - Lecture 12a 24
Putting it all together Siting a nuclear waste dump
Build Layer A by selecting good geology Build Layer B by reclassifying
population for high density Build Layer C by clipping B from A Build Layer D by buffering roads Build Layer E by intersecting C and D …
See also: Box 6.5, pp. 187-88
![Page 25: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/25.jpg)
CS 128/ES 228 - Lecture 12a 25
Where does it fit in? GIS holds data Spatial analysis causes us to view
the data as information Combining queries turns that
information into knowledge
(It’s all a spectrum)
![Page 26: Intro to Spatial Analysis (mostly 2D)](https://reader036.fdocuments.net/reader036/viewer/2022062410/56816585550346895dd832d0/html5/thumbnails/26.jpg)
CS 128/ES 228 - Lecture 12a 26
Conclusions A GIS without spatial analysis is like
a car without a gas pedal.
There are some things you can still do with it, but it’s hardly worth maintaining the vehicle.