29
1 Spatial Analysis in Spatial Analysis in GIS GIS EAA 502 MSc. Course EAA 502 MSc. Course Lecture 3 Lecture 3 Dr Mohd Sanusi Dr Mohd Sanusi

1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

Embed Size (px)

Citation preview

Page 1: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

1

Spatial Analysis in GISSpatial Analysis in GIS

EAA 502 MSc. CourseEAA 502 MSc. Course

Lecture 3Lecture 3

Dr Mohd SanusiDr Mohd Sanusi

Page 2: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

2

What is spatial analysis?What is spatial analysis?

Methods for working with spatial data Methods for working with spatial data – to detect patterns, anomaliesto detect patterns, anomalies

– to find answers to questions to find answers to questions

– to test or confirm theories to test or confirm theories » deductive reasoningdeductive reasoning

– to generate new theories and generalizationsto generate new theories and generalizations» inductive reasoninginductive reasoning

"a set of methods whose results change when the "a set of methods whose results change when the locations of the objects being analyzed change"locations of the objects being analyzed change"

Page 3: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

3

What is Spatial Analysis What is Spatial Analysis (cont.)(cont.)

Methods for adding value to data Methods for adding value to data – in doing scientific research in doing scientific research

– in trying to convince othersin trying to convince others

Turning raw data into useful informationTurning raw data into useful information A collaboration between human and machine A collaboration between human and machine

– Human directs, makes interpretations and inferencesHuman directs, makes interpretations and inferences

– Machine does tedious, complex stuffMachine does tedious, complex stuff

Page 4: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

4

Objectives of Spatial AnalysisObjectives of Spatial Analysis Queries and reasoningQueries and reasoning MeasurementsMeasurements

– Aspects of geographic data, length, area, etc.Aspects of geographic data, length, area, etc. TransformationsTransformations

– New data, raster to vector, geometric rulesNew data, raster to vector, geometric rules Descriptive summariesDescriptive summaries

– Essence of data in 1 or 2 parametersEssence of data in 1 or 2 parameters OptimizationOptimization - - ideal locations, routesideal locations, routes Hypothesis testingHypothesis testing - - sample to entire pop. sample to entire pop.

Page 5: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

5

Types of Spatial AnalysisTypes of Spatial Analysis Retrieval (spatial query) / reclassification / measurementRetrieval (spatial query) / reclassification / measurement Overlay operations with polygons, lines, pointsOverlay operations with polygons, lines, points Neighbourhood operations:Neighbourhood operations:

– search, interpolation,contouring, thiessen polygons, surface search, interpolation,contouring, thiessen polygons, surface generationgeneration

Connectivity functions:Connectivity functions:– contiguity measures, network analysis, spread and seek contiguity measures, network analysis, spread and seek

functions, intervisibilityfunctions, intervisibility

Page 6: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

Classes GIS Spatial Analytical Classes GIS Spatial Analytical OperationsOperations

Page 7: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

1. Reclassifying Maps1. Reclassifying Maps

Page 8: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

2. Overlaying Maps2. Overlaying Maps

Page 9: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

9

Page 10: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

10

OperationsOperations

Raster Overlay faster than vector overlayRaster Overlay faster than vector overlaya a a a b a 1 1 2 2 2 2a a a b b a 1 1 1 1 2 2a a a b b b 1 1 1 1 2 2a a b b b b and 3 1 1 1 2 2a a a b b b 3 3 1 2 2 2a a b b b a 3 3 2 2 2 2a b b b a a 3 2 2 2 2 2vegetation type plus soil type

where a + 1 equals M, a + 2 equals N, a + 3 equals Qb + 1 equals O, b + 2 equals P

M M N N P NM M M O P NM M M O P PQ M O O P PQ Q M P P PQ Q P P P NQ P P P N N

Page 11: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

11

OperationsOperations

Vector overlayVector overlay– calculate new nodes, arcs and polygonscalculate new nodes, arcs and polygons

a

b c

1

2

3plus

gives

New NodesExamples ofArc's being Split

Exampls of new Polygons

Page 12: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

12

3. Transformations3. Transformations

BUFFERING BUFFERING POINT IN POLYGONPOINT IN POLYGON POLYGON OVERLAY POLYGON OVERLAY SPATIAL INTERPOLATION SPATIAL INTERPOLATION DENSITY ESTIMATION DENSITY ESTIMATION

Produce new objects and data sets from Produce new objects and data sets from existing objects and data setsexisting objects and data sets

Page 13: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

13

BufferingBuffering buffering takes points, lines, or areas and buffering takes points, lines, or areas and

creates areascreates areas every location within the resulting area is every location within the resulting area is

either: either: – in/on the original object in/on the original object – within the defined buffer within the defined buffer

width of the original object width of the original object

Page 14: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

Buffering to Find RegionsBuffering to Find Regions

The overlay of the 60m buffer with the parcels helps to identifywhich parcels are selected.

Page 15: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

15

ApplicationsApplications

find all areas of National Forest beyond 1 find all areas of National Forest beyond 1 km from a roadkm from a road

find all households within 1 km of a find all households within 1 km of a proposed new freewayproposed new freeway– and send them notification of proposaland send them notification of proposal

find all cyber cafe within 500m of a school find all cyber cafe within 500m of a school – and notify them of a proposed change in the and notify them of a proposed change in the

lawlaw

Page 16: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

16

Variants Variants vary the object's buffer width according to an vary the object's buffer width according to an

attribute valueattribute value– e.g. noise buffers depending on road traffic volumee.g. noise buffers depending on road traffic volume

vary the rate of spread according to a friction vary the rate of spread according to a friction fieldfield

Page 17: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

17

Point-in-PolygonPoint-in-Polygon Determine whether a given point lies inside or Determine whether a given point lies inside or

outside a given polygon outside a given polygon – assign a set of points to a set of polygonsassign a set of points to a set of polygons– e.g., count numbers of accidents in counties e.g., count numbers of accidents in counties – e.g., whose property does this phone pole lie in?e.g., whose property does this phone pole lie in?

AlgorithmAlgorithm– draw a line from the point to infinitydraw a line from the point to infinity– count intersections with the polygon boundarycount intersections with the polygon boundary– inside if the count is odd inside if the count is odd – outside if the count is evenoutside if the count is even

Page 18: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

18

Point-in-Poly AlgorithmPoint-in-Poly Algorithm inside if the count is odd inside if the count is odd outside if the count is evenoutside if the count is even what if the point lies on the boundary? what if the point lies on the boundary?

Page 19: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

19

4. Spatial Measurement4. Spatial Measurement

often difficult to make by hand from maps often difficult to make by hand from maps – measuring the length of a complex feature measuring the length of a complex feature – measuring area measuring area – how did we measure area before GIS?how did we measure area before GIS?

Distance and lengthDistance and length– calculation from metric coordinatescalculation from metric coordinates– straight-line distance on a planestraight-line distance on a plane

Page 20: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

20

Distance Distance (cont.)(cont.) Simplest distance calculation in GISSimplest distance calculation in GIS d = sqrt ((xd = sqrt ((x11-x-x22))22+(y+(y11-y-y22))22) - works for lat/long??) - works for lat/long??

Page 21: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

21

Distance Distance (cont.)(cont.)

GIS needs more complex spherical GIS needs more complex spherical calculationscalculations

distance on a spherical Earth distance on a spherical Earth from (latfrom (lat11,long,long11) to (lat) to (lat22,long,long22) ) R is the radius of the Earth, roughly 6378 R is the radius of the Earth, roughly 6378

km km d = R cosd = R cos-1-1 [sin lat [sin lat11 sin lat sin lat22 + cos lat + cos lat11 cos lat cos lat22

cos (longcos (long11 - long - long22)])]

Page 22: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

22

LengthLength add the lengths of polyline or polygon segments add the lengths of polyline or polygon segments Two types of distortionsTwo types of distortions

(1) if segments are straight,(1) if segments are straight,length will be length will be underestimated underestimated in generalin general

Page 23: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

23

Length Length (cont.)(cont.) Two types of distortionsTwo types of distortions

(2) line in 2-D GIS on a plane considerably(2) line in 2-D GIS on a plane considerably

shorter than 3-Dshorter than 3-D

Area of land parcel based on area of horiz. projection, Area of land parcel based on area of horiz. projection, not true surface areanot true surface area

Page 24: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

24

AreaArea

how to measure area of a polygon? how to measure area of a polygon? proceed in clockwise direction around the polygon proceed in clockwise direction around the polygon for each segment:for each segment:

– drop perpendiculars to the x axis drop perpendiculars to the x axis

– this constructs a trapezium this constructs a trapezium

– compute the area of the trapezium compute the area of the trapezium

– difference in x times average of ydifference in x times average of y

– keep a cumulative sum of areaskeep a cumulative sum of areas

Page 25: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

25

Area Area (cont.)(cont.) Green, orange, blue trapeziaGreen, orange, blue trapezia Areas = differences in x times averages of yAreas = differences in x times averages of y Subtract 4th to get area of polySubtract 4th to get area of poly

Page 26: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

26

AlgorithmAlgorithm

when might the algorithm when might the algorithm fail? fail? – ““islands” must all be islands” must all be

scanned clockwise scanned clockwise – ““holes” must be scanned holes” must be scanned

anticlockwise anticlockwise – holes have negative areaholes have negative area

Wrong result if area is Wrong result if area is very small and the very small and the coordinate values are coordinate values are very large (UTM)very large (UTM)

need double precision for need double precision for calculations but not for calculations but not for results!results!

• Area of poly - a “numerical recipe”• a set of rules executed in sequence to solve a problem

Page 27: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

27

Applying the Algorithm to a Applying the Algorithm to a CoverageCoverage

keep running total for each polygonkeep running total for each polygon for each arc:for each arc: proceed segment by segment from FNODE proceed segment by segment from FNODE

to TNODE to TNODE add trapezia areas to R polygon area add trapezia areas to R polygon area subtract from L polygon areasubtract from L polygon area on completing all arcs, totalson completing all arcs, totals are correct areaare correct area

Page 28: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

28

ShapeShape

how to measure shape of an area? how to measure shape of an area? a compact shape has a small perimeter for a a compact shape has a small perimeter for a

given area given area compare perimeter to the perimeter of a compare perimeter to the perimeter of a

circle of the same area circle of the same area shape = perimeter / [3.54 sqrt (area)] shape = perimeter / [3.54 sqrt (area)]

Page 29: 1 Spatial Analysis in GIS EAA 502 MSc. Course Lecture 3 Dr Mohd Sanusi

29

What Use are Shape Measures?What Use are Shape Measures?

““Gerrymandering”Gerrymandering”– creating oddly shaped districts to manipulate creating oddly shaped districts to manipulate

the vote the vote – named for Elbridge Gerry, governer of MA and named for Elbridge Gerry, governer of MA and

signatory of the Declaration of Independencesignatory of the Declaration of Independence– today GIS is used to design districtstoday GIS is used to design districts

After 1990 Census