Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method...

60
Spatial Analysis II Spatial data analysis Spatial analysis and inference

Transcript of Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method...

Page 1: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Spatial Analysis IISpatial data analysisSpatial analysis and inference

Page 2: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Roadmap Spatial Analysis IOutline:

What is spatial analysis?Spatial JoinsStep 1: Analysis of attributesStep 2: Preparing for analyses: working with distanceStep 3: Spatial patterns analysisStep 4: Kernel density analysisSummary

Page 3: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Roadmap Spatial Analysis IIOutline:

What is spatial analysis?TransformationsIntroduction to spatial interpolationClassification of spatial interpolation methodsInterpolation methodsAreal interpolationKrigingSummary

Page 4: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Spatial analysisA method of analysis is spatial if the results depend on the locations of the objects being analyzed

move the objects and the results changeresults are not invariant under relocation

Spatial analysis requires both the attributes and locations of objects

Spatial analysis is the crux of GIS Attribute linkages

Spatial data

P,L,A,Px

Attribute data

NOIR

Page 5: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Spatial analysisMuch of what we do in spatial analysis is about transformations—transforming the data from one form of presentation (e.g., points, lines, areas) into another form of presentation (e.g., density [such as a density of crimes per CT], surfaces [such as creating a TIN or a DEM from mass points], buffers, lines [such as creating contour lines from a points, a TIN or a DEM]). (Also, normalizing vars. in MCE.)

Transformations are used for simple cartographic purposes (e.g., overlays), to aid in inductive reasoning, and for more complex purposes (e.g., hot spot analyses), as part of deductive reasoning.

Transforming spatial data from one form (point, line or area) into another form (area, line or point) is a

common and important precursor to much of spatial analysis.

Why and how are some of the ways in which we transform spatial data?

Page 7: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

TransformationsOne of the most important means of transforming data is through spatial interpolation.

Can you describe / define interpolation?

What does interpolation provide for us (as geospatial scientists)? That is, why do we interpolate (field) data?

Page 8: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Uses of spatial interpolationTo create isolines (or other graphics) for visualization

To calculate some property of the surface at a location ( ) where measurements weren’t taken

To change the unit of comparison when using different data structures (e.g., census tracts to planning districts)

Both physical and social applications

Page 9: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Field representationslattice random points regular grid

areas TIN (Voronoi) contours

What are the ways we can represent field data in a GIS?

Hexagons

Page 10: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Basic forms of interpolationPoint to points (e.g., random points to a regular lattice)

Points to lines (e.g., random points to contour lines)

Lines to points (e.g., digitized contours to a regular grid)

Areas to areas (e.g., census tracts to planning districts)

Points

LinesAreas

Transformations

Page 11: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Point to Continuous

Page 12: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Point to Continuous

Elevation

Rainfall

Page 13: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Point to Continuous

Page 14: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

RoadmapOutline:

What is spatial analysis?TransformationsIntroduction to spatial interpolationClassification of spatial interpolation methodsInterpolation methodsAreal interpolationKrigingSummary

Page 15: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

ConsiderationsGiven the wide variety of spatial interpolation methods, you need to consider:

Which method best fits the data you have available.Which method best fits the process associated with the data.Which method will produce the result you need.

Know your data

Page 16: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

A classification of interpolation methods

Global versus Local

Exact versus Approximate

Stochastic versus Deterministic

Abrupt versus Smooth

Global LocalAspatial

Could you describe what each of these dichotomies might encompass?

Windows

Page 17: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Exact versus Approximate

Exact interpolators honour the input data points (which doesn't mean that the surface is an exact replicate of the ‘true’ surface from which the points were collected, just that the surface falls exactly on the points)

Approximate interpolators allow for uncertainty in the input data points, which allows for smoothing

Page 18: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Stochastic versus DeterministicStochastic methods incorporate the concept of randomness (similar to a linear regression model—a surface of ‘best fit’)

Deterministic methods do not use probability theory (they exclude randomness).

Page 19: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Abrupt versus Smooth

Abrupt interpolators allow for barriers (e.g., faults, fronts)

Smooth interpolators produce a smooth surface

Page 20: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Issues to consider

What happens to trends?

What about minima / maxima?

How does the data distribution affect the results?How are the parameters selected?

In previous lectures we’ve talked about a few of the problematic issues

that might arise in spatial analysis, although at the time spatial interpolation

wasn’t specifically mentioned.

Rule uncertainty

Page 21: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Roadmap

Outline:What is spatial analysis?TransformationsIntroduction to spatial interpolationClassification of spatial interpolation methodsInterpolation methodsAreal interpolationKrigingSummary

Page 22: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Know your data?

20 30

13

?

What is the expected value?

Process?

Page 23: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Interpolation methods

Exact methods of point-based interpolation

Proximal: local, exact, abrupt, deterministicbest for nominal data (aka Thiessen polygons)

Thiessen polygons are the ‘dual’ of a Delaunay triangulation

Note: The point patterns are identical.

Page 24: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Splines

B-Splines: “french curves” piecewise polynomials, local, exact, can be smooth, not min/max bound

Page 25: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Manual methods

Manual interpolation: knowledge-based, local, abrupt, tend to be exact, subjective

Often associated with geological mapping

Page 26: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Interpolation methods

Approximate methods of point-based interpolation

Trend surface analysis: similar to regression, global, smooth, deterministic

The simplest surface:z = a + bx + cy

What is this called?

Page 27: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Trend surface analysis

The graph illustrates a quadratic or second-order surface: z = a + bx + cy + dx2 + exy + fy2

Page 28: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being
Page 29: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Fourier methods

Fourier Series: assumes that the surface can be approximated by overlaying a series of sine and cosine waves

global, smooth, deterministic

The first four partial sums of the Fourier series

for a square wave

Page 30: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Distance-weighted methods

Moving Average / Distance-Weighted Average:can be exact or, more typically, approximate, local to global, smooth or abrupt the most widely used spatial interpolation method in Geography

an almost unlimited number of modifications or variations are available, including:

variations on the distance function imposing constraints on the point selection process (e.g., by direction, limiting the number of points, limiting the distance).

Page 31: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Moving averages

Moving averages are widely used in time series analysesThe smoother curves (dark blue on left, red on right) represent the moving average of the original time series. Note that the smoothed curve can never be higher nor lower than any of the data points.

Moving averages cannot extendacross the entire range of the data.

Why?

Page 32: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

point iknown value zilocation xiweight wi distance di

unknown value (z to be interpolated)location x

∑∑=i

ii

ii wzwz )(x

βii dw 1=

The estimate is a weighted average

Weights decline with distance,

β is usually given a value of 2, but it can be any value > 1

Distance-weighted formulaSpatial Moving Averages (SMA)

Page 33: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Effects of changing parametersIDW: Changing the exponent from 2 to 4

21 ii dw = 41 ii dw =

Page 34: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

TINs

Triangulated Irregular Networks (TINs)Not really a form of interpolation, per se, although using TINs one can create contours or regions.

Exact, local, abrupt, deterministic.

Page 35: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Contour placement

Although the process of 'stringing' contours between the vertices of the TIN triangles (or between two grid points) may seem unproblematic, there are some interesting issues (issues which should be addressed in any contouring exercise, but typically are never explicitly addressed).

Basically: what assumption should be made with respect to how the surface should be modeled between the known points?

Page 36: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Contour placement

The default for most programs, although this is likely more realistic.

Page 37: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

RoadmapOutline:

What is spatial analysis?TransformationsIntroduction to spatial interpolationClassification of spatial interpolation methodsInterpolation methodsAreal interpolationKrigingSummary

Page 38: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

What of areal interpolation?If the areas can be represented by a single point, and the data can be considered to be a field, you can use a point-based interpolation method (e.g., pop density of CTs).

Areal interpolation is actually a complex process. Polygon overlays , and using the proportional areas as weights, is a typical

approach (but one that is not reversible nor volume preserving—total pop after ≠ total pop before).Pycnophylactic interpolation is a reversible, volume preserving method (see

lecture notes for a link to a video that describes this method in detail).

Page 39: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Polygon overlays

The problem with (nonreversible) polygon overlays:

The fundamental assumption is that the field has a homogeneous distribution throughout the zones.

Note that the totals assigned to the two polygons in the bottom row

do not equal the values within each polygon in the top row.

Each area is split into 2 equal parts,

assuming equal pop in each part.

Page 40: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Pycnophylactic interpolation

Page 41: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

ArcGIS’s Areal Interpolation Method

Page 43: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

RoadmapOutline:

What is spatial analysis?TransformationsIntroduction to spatial interpolationClassification of spatial interpolation methodsInterpolation methodsAreal interpolationKrigingSummary

Page 44: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Geostatistical methods: KrigingKriging

stochastic, exact, smooth or abrupt, global or local

Natural data are difficult to model using smooth functions because naturally-occurring random fluctuations and measurement error combine to cause irregularities in sampled data values.

Kriging was developed to model those stochastic concepts.

It is based on the concept of a regionalized variable that has three components:

Page 45: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Components of a Regionalized Variable

data

STRUCTURAL – This may be represented by the

mean or a constant trend.

SPATIALLY CORRELATED – Data often exhibit positive spatial

correlations.

RANDOM NOISE – Measurement errors, other errors,

random fluctuations.

Topography is a reflection of many processesoperating at different scales; with Kriging we hope to develop models of some of those processes.

Page 46: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Components of a Regionalized Variable

The random noise component (non-fitted)

The spatially correlated component

The structural component (e.g., a linear trend)

This is what we areattempting to model.

Page 47: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Kriging

Kriging is implemented using a semi-variogram

There are many different varieties of kriging (e.g, ordinary, universal, simple, indicator), and selecting the appropriate one requires careful consideration of the data.

ArcGIS's help file--look up the term kriging—provides a lot of information on the various types of kriging (and co-kriging) that are commonly used in spatial analysis.

ArcGIS’s tutorial for the Geostatistical Analyst is also very informative (in particular consider the Geostatistical Wizard)

Page 48: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Kriging

The semivariogram is based on modeling the (squared) differences in the z-values as a function of the distances between the known points.

h

Page 49: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

KrigingThe first step in ordinary kriging is to construct a semivariogram from the points being interpolated.

A semivariogram consists of two parts: an experimental semivariogram (the data) a model semivariogram (the math).

The experimental semivariogram is found by calculating the variance (g) of each point in the set with respect to each of the other points and plotting the (semi)variances versus distance (h) between the points.

Page 50: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Semivariogram

Variance between points is represented over space. The above shows how variance between point values tends to increase as distance between points increases.

The values of the points could be rainfall, elevation, demographic continuous data, ozone levels, percentage of gold in a sample…

Page 51: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

N= number of pairsf1 = Headf2 = Tail

h = distance (0 -> range)

Page 52: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

SemivariogramThe semivariogram is used to explore a data set visually and to estimate at what distance the spatial autocorrelation becomes insignificant (i.e., the range).

Page 53: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

SemivariogramNugget represents subgrid scale variation that cannot be estimated by reasons of the sampling grid spacing or measurement error.

Range is a measure of the spatial autocorrelation between data points, represented in terms of the lag distance. It represents the distance at which the spatial autocorrelation is at its global value.

Page 54: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

SemivariogramSill is the value of the semi-variance as the lag tends towards infinity – in non-standardized data it is equal to the total variance of the dataset.

Lag refers to distances (e.g., 1250m) that typically have ‘bands’ associated with them (e.g., +/- 250m). Distance may be a direct measure or a transformation of distance (e.g., log(1000 m)).

N= number of pairsf1 = Headf2 = Tail

h = distance (0 -> range)

Page 55: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Kriging

This is an example of a semivariogram produced using ArcGIS's Geostatistical Analyst.

Page 56: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

KrigingOne of the very useful outputs from a kriging

analysis is the uncertainty surface that can be generated--we can answer the question: "How good are the predictions?"

Using some of the data that we used in lab 2 (where you created a TIN), I created an ordinary kriged map and a map showing the standard error of the predictions (and a TIN for comparison).

Page 57: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

Kriging Prediction standard error mapshowing data points

TINOrdinary krigedprediction map

Page 58: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

IDW versus kriging

Page 59: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being

SummaryInterpolation is a very important process in GIS, and in particular in spatial analysis. ArcGIS's help files provide a lot of useful information.

It is important to know, first, about your data (how was it collected, the spatial distribution of the collection points, the process responsible for creating the 'field' you are mapping) and, second, about the spatial interpolation method (its assumptions, faults and fine points).

Know your data

Page 60: Spatial Analysis IIblogs.ubc.ca/advancedgis/files/2019/10/Lecture08SAII.pdfSpatial analysis A method of analysis is spatial if the results depend on the locations of the objects being