Spatial Analysis
• What is spatial analysis?– It is the means by which we turn raw geographic
data into useful information– It does so by adding greater informative content
and value
• Spatial analysis reveals patterns, trends, and anomalies that might otherwise be missed– It provides a check on human intuition– It allows for analysis of data that could never be
done by humans
Analysis is considered spatial if the results depend on the locations of the objects being analyzed.
Thus if you move the objects, the results of spatial analyses will change.
To conduct a spatial analysis generally requires both attributes and locations of objects.
Spatial Analysis
Steps in Spatial Analysis
1. Frame the question we wish to ask.
2. Find appropriate data to answer the question.
3. Choose analytical method appropriate to answer question.
4. Process the data using the chosen method.
5. Review and question the results (often refining the approach by collecting more data and improving the analysis)
Spatial Relationships are at the Core of Spatial Analysis
• Most spatial analyses are based on topological questions:
• How near is Feature A to Feature B
• What features contain other features?
• What features are adjacent to other features?
• What features are connected to other features?
• From these topological building blocks, we can develop all sorts of spatial analysis approaches to answer many complex questions
Types of Spatial Analysis
• We will consider six categories of spatial analyses:1. Queries 2. Measurements3. Transformations4. Descriptive summaries5. Optimization6. Hypothesis testing
1. Queries• Queries
– Attribute based• Example: show me all pixels in a raster image with BV > 80.
– Location based• List all the block groups that fall within Orange County
• A GIS can respond to queries by selecting the appropriate data in – A map view– A table– Both
The Map View (~ a View)
Queries can be performed through interaction with a GIS on-screen map.
Identify objects
Query data objects based on specific criteria of attributes
Find coordinates of objects
The Table View (~ a Table)
Queries can be performed through interaction with a table.
Attribute based queries can be performed in the table.
When objects are selected in a table, a GIS can automatically highlight the selected data objects in the map view, and vice versa.
• Queries can be performed through command windows/programs, “Old School” style.
Queries
2. Measurements
• Measure:– Distance between two points
• Distances can be summed– Example: a truck makes multiple stops on a route. What is the
total distance traveled on the route?
• Other mathematical operations can be applied to distances:– We can square a set of distances, add them up, divide by the
amount of distances calculated in the set, and take the square root. What is an example of when this operation is used?
– Area of a polygon– Example: What is the area of a preserved forest tract?
Measurement of Length
• Types of length measurements– Euclidean distance: straight-line distance between two
points on a flat plane (as the crow flies)– Manhattan Distance limits movement to orthogonal
directions– Great Circle distance: the shortest distance between two
points on the globe– Network Distance:
• Along roads • Along pipe network• Along electric grid• Along phone grid• By river channels
•Distances can be calculated between points, along lines, or in a variety of fashions with areas
•Euclidean Distance – calculated in a Cartesian frame of reference:
Euclidean Distance
(x1 – x2)2 + (y1 – y2)2C=
C
P1 (x1,y1)
P2 (x2,y2)
• On what scales is this valid?
• Can we use this with latitude and longitude?
•Manhattan Distance is useful in some urban environments with orthogonal road networks.
•Movement is limited to city streets:
Manhattan Distance
P1 (x1,y1)
P2 (x2,y2)
dm = | x1 – x2 | + | y1 – y2 |
a reminder – the | symbols denote absolute value
Great Circle Distance
•The Great Circle distance is the shortest distance between two points on the globe.
•The two points must be specified using latitude & longitude positions.
Starting from: Carrboro, NC 27510 Save AddressArriving at: Washington, DC Save Addressistance:272.5 miles Approximate Travel Time:5 hours 23 mins
Network DistanceYahoo maps:
Issues with Length Measurement
• The length of a true curve is longer than the length of its polyline or polygon representation:
Issues with Length Measurement
• Length measurements in GIS are usually calculated in 2 dimensions. But changes in elevation increase distances.
X
Z
3. Transformations• Spatial transformations includes many analytical
approaches, applicable to:– Vector data– Raster data– Both
• Transformations can create new:– Attributes– Data objects
Buffering (Proximity Analysis)• Buffering operations create new objects consisting
of areas within a user-defined distance of existing objects.
• Examples of uses:– to determine areas impacted by a proposed highway– to determine the service area of a proposed hospital
• Buffering can be performed in both the vector and raster spatial data models
Buffering: The delineation of a zone around the feature of interest within a given distance. For a point feature, it is simply a circle with its radius equal to the buffer distance:
Buffering (Proximity Analysis)
•The buffer zone constructed around each feature can be based on a variable distance according to some feature attribute(s)
•Suppose we have a point pollution source, such as a power plant. We want to zone residential areas some distance away from each plant, based on the amount of pollution that power plant produces
For smaller power plants, the distance might be shorter.
For larger power plants that generate a lot of pollutant, we choose longer distances
Variable Distance Buffering
•Buffering higher order objects involves moving a circle of specified radius along the line (or the lines forming polygon)
Buffering Points, Lines, and Polygons
Buffer lines
Buffer polygons
Line and Polygon Buffer Examples
Raster Buffering• Buffering operations also can be performed using the raster data model• In the raster model, we can perform a simple distance buffer, or in this
case, a distance buffered according to values in a friction layer (e.g. travel time for a bear through different landcover):
lake
Areas reachable in 5 minutesAreas reachable in 10 minutesOther areas
Feature in Feature Transformations
• These transformations determine whether a feature lies inside or outside another feature
• The most basic of these transformations is point in polygon analysis, which can be applied in various situations:
The Point in Polygon Algorithm
•Draw a line from the point to infinity in any direction, and then count the number of intersections between this line and each polygon’s boundary
•The polygon with an odd number of intersections is the containing polygon; all other polygons have an even number of intersections
How do GIS programs calculate this?
Point in Polygon Algorithm
• For the point to be inside the polygon, there must be an odd number of intersections on either side of the point .
•We can use point in polygon results to calculate frequencies or densities of points per area•For example, given a point layer of bird’s nests and polygon layer of habitats, we can calculate densities:
Habitat Area(km2) Frequency Density . A 150 4 0.027 nests/km2
B 320 6 0.019 nests/km2
C 350 3 0.009 nests/km2
D 180 3 0.017 nests/km2
Bird’s NestsA B
DC
Habitat TypesA B
DC
Analysis Results
Point Frequency/Density Analysis
• Overlay line layer (A) with polygon layer (B)
– In which B polygons are A lines located?
» Assign polygon attributes from B to lines in A
A BExample: Assign land use attributes (polygons) to streams (lines):
Line in Polygon Analysis
David Tenenbaum – GEOG 070 – UNC-CH Spring 2005
Polygon Overlay, Discrete Object Case
•In this example, two polygons are intersected to form nine new polygons.
•One is formed from both input polygons (1);
•four are formed by Polygon A and not Polygon B (2-5);
•four are formed by Polygon B and not Polygon A (6-9)
A B
1
2
3
4
5
6 7
8
9
Polygon Combination
Common ways to combine polygons:
1. Show all new polygons as in diagram.2. UNION (Boolean OR)3. INTERSECTION (Boolean AND)
A B
1
2
3
4
5
6 7
8
9
What level of accuracy is ‘good’? (from lecture 20)
• The Overall accuracy (and row and column accuracies) are generally considered good/acceptable if they are above 85%. The USGS uses this as a guideline.
• The Kappa statistic describes agreement between the classified data and the reference data (it represents the increased accuracy of the performed classification over that of a random classification). A Kappa statistic of:– Above 80% is considered to have strong agreement.
– Between 40% and 80% is considered to have moderate agreement.
– Below 40% is considered to have poor agreement.
Some non-error data quality issues• Compatibility: can two or more geographic data sets be used together
properly?
– e.g. is it meaningful to overlay roads data digitized at 1:10,000 scale with road hazard sites digitized at 1:250,000?
• Completeness: does a given data set adequately cover a study area? Are there gaps in space or time?
– Example: a city’s municipal cadastral database -- do all parcel polygons have attribute information? Are any parcels missing?
• Consistency: are geographic data sets consistent in terms of content, format, etc?
– Example landcover data layer for a study area -- different sub-areas produced from two satellite scenes...
• one Landsat TM & classified into 10 classes -vs.-
• one Landsat MSS & classified into 5 classes