Manipulations interpolation/extrapolation line intersections points in polygon line and polygon...

15
Manipulations • interpolation/extrapolation • line intersections • points in polygon • line and polygon intersections • union/intersection of polygon areas • buffering • data transformations

Transcript of Manipulations interpolation/extrapolation line intersections points in polygon line and polygon...

Page 1: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Manipulations

• interpolation/extrapolation

• line intersections

• points in polygon

• line and polygon intersections

• union/intersection of polygon areas

• buffering

• data transformations

Page 2: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Interpolations

• nearest neighbor• linear interpolation w/ two points• linear interpolation with multiple points

• spline interpolations • stochastic interpolation based on pseudo random

number and fractal parameter• model based interpolation

Page 3: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Extrapolations

• L&T note that there are two “case” when data to be determined falls “within” existing data and when it falls “outside” existing data.

interpolation extrapolation

Page 4: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Geometric inference

• the specific case of interpolation when three dimensional surfaces are interpolated

• some examples– surface fitting (trend surfaces etc) (not in L&T)

– inverse distance weighting (not in L&T)

• role of privileged points– in some situations some data points are not to be

subjected to change.. E.g. line/surface should “run” through that point

Page 5: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Some issues with geometric inference

• number of data points to be used for each new point

• distance observed data is from the to be interpolated point

• compass directions

• procedures used for interpolation n and their characteristics

• in particular– are observed points representative– is there some underlying “condition” present that will influence

relationship between points• is there some knowledge about underlying processes that can be brought to

bear• erosion on elevation• underlying geological strata - some erode easily some do not

Page 6: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Spatial autocorrelation

• basic premise is that points closer to each other are more closely related than points at greater distances– this is

• not always true

• amount of “relationship” varies with distance

– possible to determine the distance of this influence

• kriging is an “interpolation” method that explicitly uses the degree of autocorrelation to develop the interpolated surface

Page 7: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Interpolators are local or global

• some processes only utilize data ‘close” to point to be interpolated– nearest neighbor– inverse distance weighting

• others use all data – global interpolators

• trend surface

• honoring data points– exact interpolators insure that result “goes through” existing data points

• kriging, splines, some nearest neighbor• others do not - trend surfaces, moving averages

Page 8: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Line intersections

• problem - determine if two lines intersect– two cases lines are of infinite length

– lines are composed of straight line segments terminating in nodes/vertices

• representation of a line in cartesian geometry– ux + vy + w = 0

– more general case of y = a + bx

Page 9: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Representation of a line segment

• use of parameter expression– provide coordinates for end points

– parameter showing where the equation passing through the end points is valid

x

yt=0

t=1

X = xa + t(xb - xa)y = ya + t(yb - ya)where 0 <= t <= 1

With such two equations we can compute1 - is a point “on” the line2 - do two lines cross3 can use bounding box for a quick estimate

Page 10: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Computing intersection

• Let there be two line segments– AB and CD

– to determine (1) if and (2) where they intersect solve

– if 0 <= t <= 1 and 0 <= s <= 1 is NOT true no intersect

))(())((

))(()()( c

abdcdcab

acdcdca

yyxxyyxx

yyxxyyxxt

))(())((

))(()()( b

abdcdcab

acca

yyxxyyxx

yybxaxyayxxs

Page 11: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Line intersection

• first step• determine if the two lines are even within

overlapping bounding rectangles or quads etc.

Max y

Min y

Min x Max x

Page 12: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Point in polygon

• very common task– is the home in the zone of influence of the store

• can also be “is a vertex (of another polygon) in the first polygon”

Page 13: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Point in poly via half-line theorem • (use line intersection computation)• draw straight line from point to beyond end of polygon• if number of intersections is odd the point is in the polygon if even its out (check

first w/ bounding box)

Page 14: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

More global issue

• point in tessellation– which poly of full tessellation does the point fall within

• brute force approach – compute point in polygon for all possible polygone

– in US there are some 3300 counties

• hierarchical organization approach– in larger poly (state)

– then check smaller included ones

• necessary for every mouse “info” operation

Page 15: Manipulations interpolation/extrapolation line intersections points in polygon line and polygon intersections union/intersection of polygon areas buffering.

Centroid

• dual of polygon• how best to assign?

– Defined from vertices– statistical mean or center of gravity– center of enclosed or enclosing rectangle or circle– peak value of surface fitted to polygon– intuitively (visually)

• Problem cases– lots of vertices– strange polygon– hole in polygon