Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

39
www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations

Transcript of Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

Page 1: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

www.spatialanalysisonline.com

Chapter 4

Part A: Geometric & related operations

Page 2: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 2

Length & Area – vector datasets

Polygon area in the plane

1

1112

1 n

iiiii yyxxA

1

111 )(

21 n

iiiii yxyxA

Page 3: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 3

Length & Area – vector datasets

Polyline lengthDistance formulas

Plane

Spherical

22jijiij yyxxd

)cos(coscossinsincos 2121111 Rdij

2,

2:

coscossinsinsin2 221

jiji

jiij

BAwhere

BARd

Page 4: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 4

Length & Area – raster datasets

Definition of areas and lines in grid modelsMembership functionsGrid orientationGrid metricsGrid resolution – size, shape and attribute

assignment

Page 5: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 5

Surface Area – TIN datasets

Planimetric area, A

Surface area, A'

jjjjjj

jjjjjjj yxyxyx

yxyxyxA

133221

312312

21

2

33

22

112

33

22

112

33

22

11

1

1

1

1

1

1

1

1

1

21

xz

xz

xz

zy

zy

zy

yx

yx

yx

A

A

A'A'=A/ cos()

Page 6: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 6

Geometric & related operations

Surface Area – Raster datasets Grid model: average of 8 Triangular components

Page 7: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 7

Geometric & related operations

Surface Area: Unprojected vector datasets

Terrestrial quadrangle

Terrestrial polygon

Great circles, Spherical triangles, Spherical excess and Azimuths

22121180

RAAA

2)2( RnAi

i

Page 8: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 8

Point weeding and line smoothing

A . Po int w e e ding

B. Sim ple sm oothing

1

23 4

5

6

78

9

10

C. Spline sm oothing

Page 9: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 9

Centroids and centres1a Polygons

M3x = [max(x)-min(x)]/2

M3y = [max(y)-min(y)]/2

1 , ( , )i i

i i

x yM x y

n n

AxxyxyxM ii

n

iiiiix 6/)()(2 1

1

111

AyyyxyxM ii

n

iiiiiy 6/)()(2 1

1

111

Page 10: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 10

Centroids and centres

1b Polygons

Data source: US Census Bureau

Page 11: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 11

Centroids and centres

1c Polygons Maximum inscribed circle Minimum bounding circle

Page 12: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 12

Centroids and centres

Point sets (weighted or unweighted)

M6 (MAT point) – iteration formula

i i iiii

iiii wywwxw,yx /,/M1 00

n

ikii

n

ikiiik dwdxwx

1,

1,1 //

n

ikii

n

ikiiik dwdywy

1,

1,1 //

Page 13: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 13

Point (object) in polygon

MBR screening

Semi-line algorithm Standard cases Special cases

Winding number (wn) algorithm

1

0 1

11cosn

i ii

iiwnpvpvpvpv

Page 14: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 14

Polygon decomposition

Convex partsTriangulationsSkeletonisation/medial

axis transformsObject labellingAssignment of

attributesClipping/cookie cutters

Page 15: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 15

Polygon shape – alternative measures

Dimensionless ‘global’ measures

Perimeter2/Area ratio (P2A):

Shape Index or Compactness ratio (C)

Related bounding figure (RBF)

Measures for point and line/network sets

2

2 ii

i

LP A

A

ii

i

AC

B

1 ii

i

ARBF

F

Page 16: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 16

Layers & overlay operations - vector Intersection/OR; Union/AND; Not/Difference; Exclusive OR/Symmetric

difference OGC OpenGIS Simple Features Specification: Spatial Analysis

Method Description

Note: a and b are two geometries (one or more geometric objects or features — points, line objects, polygons, surfaces including their boundaries); I(x) is the interior of x; dim(x) is the dimension of x, or maximum dimension if x is the result of a relational operation

Spatial analysis

Distance the shortest distance between any two points in the two geometries as calculated in the spatial reference system of this geometry

Buffer all points whose distance from this geometry is less than or equal to a specified distance value

Convex Hull the convex hull of this geometry

Intersection the point set intersection of the current geometry with another selected geometry

Union the point set union of the current geometry with another selected geometry

Difference the point set difference of the current geometry with another selected geometry

Symmetric difference

the point set symmetric difference of the current geometry with another selected geometry (logical XOR)

Page 17: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 17

Method Description

Note: a and b are two geometries (one or more geometric objects or features — points, line objects, polygons, surfaces including their boundaries); I(x) is the interior of x; dim(x) is the dimension of x, or maximum dimension if x is the result of a relational operation

Spatial relations

Equals spatially equal to: a=b

Disjoint spatial disjoint: equivalent to ab=

Intersects spatially intersects: [ab] is equivalent to [not a disjoint(b)]

Touches spatially touches: equivalent to [ab and I(a)I(b)= ]; does not apply if a and b are points

Crosses spatially crosses: equivalent to [dim(I(a)I(b))<max{dim(I(a)),dim(I(b))} and aba and abb]

Within spatially within: within(b) is equivalent to [ab=a and I(a)I(b)]

Contains spatially contains: [a contains(b)] is equivalent to [b within(a)]

Overlaps spatially overlaps: equivalent to [dim(I(a)I(b))=dim(I(a))=dim(I(b)) and aba and abb]

Relate spatially relates, tested by checking for intersections between the interior, boundary and exterior of the two components

OGC OpenGIS Simple Features Specification: Spatial Relations

Layers & overlay operations - vector

Page 18: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 18

Layers & overlay operations – vector

Terminologies/operations often mentioned: Spatial join Slivers/sliver handling Clipping/cookie cutters Dissolving and merging Concatenation and conflation Transformation (attribute assignment rules)

Page 19: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 19

Areal interpolation

Assignment of attributes Using smallest available zonings By proportion of area intersected (new zonings) By surface modelling Utilising ancilliary data (e.g. road networks)

Volume preserving/pycnophylactic assignment

Page 20: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 20

Districting/re-districting

Spatial constraints Contiguity Compactness

Attribute constraints/objectives Mean size/spread Attribute values Attribute mix

Statistical (scale) effects Spatial (arrangement) effects

Page 21: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 21

Districting/re-districting

Statistical (scale) effects - example

Employed (000s) Unemployed (000s)Total (000s) (Unemployed %)

Area A

European 81 9 90 (10%)

Asian 9 1 10 (10%)

Total 90 10 100 (10%)

Area B

European 40 10 50 (20%)

Asian 40 10 50 (20%)

Total 80 20 100 (20%)

A and B

European 121 19 140 (13.6%)

Asian 49 11 60 (18.3%)

Total 170 30 200 (15%)

Page 22: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 22

Districting/re-districting

Spatial (arrangement) effects - example

Page 23: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 23

Classification – univariate schemes:1

Classification scheme

Description/application

Unique values Each value is treated separately, for example mapped as a distinct colour

Manual classification The analyst specifies the boundaries between classes required as a list, or specifies a lower bound and interval or lower and upper bound plus number of intervals required

Equal interval, Slice The attribute values are divided into n classes with each interval having the same width=Range/n. For raster maps this operation is often called slice

Defined interval A variant of manual and equal interval, in which the user defines each of the intervals required

Exponential interval Intervals are selected so that the number of observations in each subsequent interval increases exponentially

Equal count or quantile

Intervals are selected so that the number of observations in each interval is the same. If each interval contains 25% of the observations the result is known as a quartile classification. Ideally the procedure should indicate the exact numbers assigned to each class, since they will rarely be exactly equal.

Percentile Percentile plots are a variant of equal count or quantile plots. In the standard version equal percentages (percentiles) are included in each class. In GeoDa’s implementation of percentile plots unequal numbers are assigned to provide classes that contain 6 intervals: 1%, 1% to <10%, 10% to <50%, 50% to <90%, 90% to <99% and 99%

Page 24: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 24

Classification – univariate schemes:2

Classification scheme Description/application

Natural breaks Widely used within GIS packages, these are forms of variance-minimisation classification. Breaks are typically uneven, and are selected to separate values where large changes in value occur. May be significantly affected by the number of classes selected and tends to have unusual class boundaries.

Standard deviation The mean and standard deviation of the attribute values are calculated, and values classified according to their deviation from the mean (z-transform). The transformed values are then mapped, usually at intervals of 1.0 or 0.5 standard deviations. Note that this results in no central class, only classes either side of the mean

Box A variant of quartile classification designed to highlight outliers. Typically six classes are defined, these being the 4 quartiles, plus two further classifications based on outliers that may exist within the lower and upper quartiles. These outliers are defined as being data items (if any) that are more than 1.5 times the inter-quartile range (IQR) from the median. An even more restrictive set is defined by 3.0 the IQR. A slightly different formulation is sometimes used to determine these box ends or hinge values. Box plots are implemented in GeoDa and STARS, but are not generally found in mainstream GIS software. They are commonly implemented in statistics packages, including the MATLab Statistics Toolbox

Page 25: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 25

Classification – Natural breaks

Jenks Natural Breaks algorithm

Step 1: The user selects the attribute, x, to be classified and specifies the number of classes required, k

Step 2: A set of k‑1 random or uniform values are generated in the range [min{x},max{x}]. These are used as initial class boundaries

Step 3: The mean values for each initial class are computed and the sum of squared deviations of class members from the mean values is computed. The total sum of squared deviations (TSSD) is recorded

Step 4: Individual values in each class are then systematically assigned to adjacent classes by adjusting the class boundaries to see if the TSSD can be reduced. This is an iterative process, which ends when improvement in TSSD falls below a threshold level, i.e. when the within class variance is as small as possible and between class variance is as large as possible. True optimisation is not assured. The entire process can be optionally repeated from Step 1 and TSSD values compared

Page 26: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 26

Classification – Multivariate methods

Dimensional analysis/reduction methods Factor analysis Principal Components Analysis - PCA Multi-dimensional scaling – MDS

Cluster analysis Non-hierarchical Hierarchical Aggregation vs disaggregation methods

Assignment methods Discriminant analysis

Page 27: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 27

Classification – Multivariate clustering:1Method Description – Unsupervised methods

Simple one-class clustering

A technique that generates up to M clusters by assigning each input cell to the nearest cluster if its Euclidean distance is less than a given threshold. If not the cell becomes a new cluster centre. It principal merit is speed, but its quality of assignment may not be acceptable

K-means Partition-based algorithm. K-means clustering attempts to partition a multivariate dataset into K distinct (non-overlapping) clusters such that points within a cluster are as close as possible in multi-dimensional space, and as far away as possible from points in other clusters.

Fuzzy c-means (FCM)

Similar to the K-means procedure but uses weighted distances rather than unweighted distances. Weights are computed from prior analysis of sample data for a specified number of classes. These cluster centres then define the classes and all cells are assigned a membership weight for each cluster. The process then proceeds as for K-means but with distances weighted by the prior assigned membership coefficients

Minimum distribution angle

An iterative procedure similar to K-means but instead of computing the distance from points to selected centres this method treats cell centres and data points as directed vectors from the origin. The angle between the data point and the cluster centre vector provides a measure of similarity of attribute mix (ignoring magnitude). This concept is similar to considering mixes of red and blue paint to produce purple. It is the proportions that matter rather than the amounts of paint used

ISODATA/ ISOCluster (Iterative Self-Organising)

Again, similar to the K-means procedure but at each iteration the various clusters are examined to see if they would benefit from being combined or split, based on a number of criteria: (i) combination — if two cluster centres are closer than a pre-defined tolerance they are combined and a new mean of means calculated as the cluster centre; if the number of members in a cluster is below a given level the cluster is discarded and the members re-assigned to the closest cluster; and (ii) separation — if the number of members, or the standard deviation, or the average distance from the cluster centre exceed pre-defined values than the cluster may be split

Page 28: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 28

Classification – Multivariate clustering:2

Method Description – Supervised methods

Minimum distance to mean

Essentially the same as Simple one-pass clustering but cluster centres are pre-determined by analysis of a training dataset. Fast but subject to similar problems as the Simple method

Maximum likelihood A method that uses statistical analysis (variance and covariance) of a training dataset, whose contents are assumed to be Normally distributed. It seeks to determine the probability (or likelihood) that a cell should be assigned to a particular cluster, with assignment being based on the Maximum Likelihood value computed.

Stepwise linear/Fisher This is essentially a Discriminant Analysis method, which attempts to compute linear functions of the dataset variables that best explain or discriminate between values in a training dataset. New linear functions are added incrementally, orthogonal to each other, and then these functions are used to assign all data points to the classes. The criterion function minimised in such methods is usually Mahalanobis distance, or the D2 function.

Classified tree analysis A univariate hierarchical data splitting procedure, that progressively divides the training dataset pixels into two classes based on a splitting rule, and then further subdivides these two classes

Page 29: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 29

Boundaries and zone membership

Convex hulls Point sets Object sets Boundary definition issues Applications MBRs/MERs

MBR/MER

Convex hull

Page 30: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 30

Boundaries and zone membership

Non-convex hulls Example criteria

Polygonal form (or non-polygonal alpha hulls) Compactness Convex-like Inclusion of all objects/points Reflects the density of objects

Procedures Expansion Contraction Density contouring

Page 31: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 31

Boundaries and zone membership Non-convex hulls – alpha hulls

>0

<0

>>0

<<0

Page 32: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 32

Boundaries & zone membership

Fuzzy boundaries Use of fuzzy membership functions

Sigmoidal, j-shaped, linear, user-defined Use of fuzzy classification procedures

Wombling Confusion index Classification entropy

Page 33: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 33

Boundaries & zone membership

Breaklines and natural boundaries Hard breaklines Soft breaklines Faults/breaklines with areal extent Barriers Applications

Page 34: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 34

Tessellations & triangulations

Delaunay triangulation

“ Three points form a Delaunay Triangulation if and only if (iff) a circle which passes through all three points contains no other points in the set”

• unique (broadly)

• ‘best’ (fewest thin triangles)

• one of many possible triangulations of irregular point sets (TINs)

Page 35: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 35

Tessellations & triangulations

TINs Delaunay triangulation is one example of a TIN Designed – engineering Derived – fixed point sets Derived fixed plus rule-based point sets

Adaptive densification

Page 36: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 36

Tessellations & triangulations

Tessellations (of the plane) Simple regular grids

Intersections at regular spacings Cells: square, rectangular, triangular, hexagonal Fill or partially fill study region Typically square cells and square or rectangular

grids Irregular grids

Typically triangulations Dual of triangulation defines a set of regions

Page 37: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 37

Tessellations & triangulations

Voronoi regions (proximity polygons) AKA: Thiessen polygons, Dirichlet cells Dual of Delaunay triangulation

“Given a set of points, {S}, in the plane, every location in a Voronoi polygon is closer to one member of {S} than to any other member (ignoring ties)”

• Uniquely partitions the plane (tessellates) – edge regions are treated in a variety of ways

• One of many possible planar enforced partitions of the plane

Page 38: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 38

Tessellations & triangulationsVoronoi regions (proximity polygons) - Many applications

e.g. assignment of point data attributes to nearest zones

Simple forms of interpolation (nearest and natural neighbour)

Spatial partitioning Analysis of zones of influence, growth etc…

Grid based Voronoi regions Generated by spread (ACS) or distance transform

(DT) algorithms Shape and boundary affected by grid size,

orientation and algorithm Can be applied uniform or variable cost surfaces Related to optimum routing problems

Page 39: Www.spatialanalysisonline.com Chapter 4 Part A: Geometric & related operations.

3rd edition www.spatialanalysisonline.com 39

Tessellations & triangulations

Voronoi region – network based