28
Interpolasi Spasial Praktikum 5 | Statistika Spasial [email protected]

Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial [email protected] Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

  • Upload
    ngotu

  • View
    228

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Interpolasi SpasialPraktikum 5 | Statistika Spasial

[email protected]

Page 2: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Outline

• Trend surface

• Thiesen Polygon

• Inverse Weight Distance

Page 3: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques
Page 4: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques
Page 5: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

General list of techniques(points)

• trend surface - a global interpolator which calculates a best overall surface fit

• IDW - inverse distance weighting

• loess – local weighted smoothing regression (weighted quadratic least squares regression)

• spline - mathematical piecewise curve fitting

• Kriging - using geostatistical techniques

Page 6: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Other procedures

• Thiessen or Voronoi tessellation – area divided into regions around the sample data points where every pixel or area in the region is assigned to the data point which is the closest

• TIN - sample data points become vertices of a set of triangular facets covering the study area

Page 7: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques
Page 8: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques
Page 9: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Topo Data SetSpatial Topographic Data

Description: The topo data frame has 52 rows and 3 columns, oftopographic heights within a 310 feet square.

This data frame contains the following columns:

x : x coordinates (units of 50 feet)

y : y coordinates (units of 50 feet)

z : heights (feet)

Source: Davis, J.C. (1973) Statistics and Data Analysis in Geology. Wiley.

Page 10: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Trend surface in gstat

library(MASS)

library(raster)

library(gstat)

library(sp)

data(topo)

Page 11: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

coordinates(topo) <- ~ x+y

plot(topo)

Page 12: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

x=seq(0,6.3, by=0.1);y=seq(0,6.3, by=0.1)

topo.grid <- expand.grid(x=x,y=y)

gridded(topo.grid) <- ~x+y

plot(topo.grid)

Page 13: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

1st-order trend surfacex <- gstat(formula=topo$z ~ 1, data=topo, degree=1)

kt <- predict(x, newdata=topo.grid)

spplot(kt[1], contour=TRUE,main="topo trend surface (1)-gstat")

Page 14: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

2nd order trend surfacex <- gstat(formula=topo$z ~ 1, data=topo, degree=2)

kt2 <- predict(x, newdata=topo.grid)

p1 <- spplot( kt2[1], contour=TRUE, main="topo trend surface (2)-

gstat",sp.layout=list(list("sp.points", topo@coords, pch=19,

col=2)))

p1

Page 15: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques
Page 16: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Inverse Distance Weighting

• Points closer to interpolation point should have more influence

• The technique estimates the Z value at a point by weighting the influence of nearby data point according to their distance from the interpolation point.

• An exact method for topographic surfaces

• Fast

• Simple to understand and control

Page 17: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

IDW on Topo data set

kid <- krige(topo$z ~ 1, topo, topo.grid, NULL)

spplot(kid["var1.pred"], main = "TopIDW",contour=TRUE,

sp.layout=list(list("sp.points", topo@coords, pch=19, col=2)))

Page 18: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Thiessen Polygons

Page 19: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Meuse River Data Set

Description: This data set gives locations and topsoil heavy metalconcentrations, along with a number of soil and landscape variablesat theobservation locations, collected in a flood plain of the river Meuse, near thevillage of Stein (NL). Heavy metal concentrations are from compositesamples of an area of approximately 15 m x 15 m.

This data frame contains the following columns:

x : a numeric vector; Easting (m) in Rijksdriehoek (RDH) (Netherlandstopographical) map coordinates

y : a numeric vector; Northing (m) in RDH coordinates

zinc : topsoil zinc concentration, mg kg-1 soil ("ppm")

Page 20: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Meuse Data Setlibrary(sp)

data(meuse)

names(meuse)

summary(meuse)

hist(meuse$zinc)

plot(meuse$x,meuse$y,asp=1)

Page 21: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

coordinates(meuse) = ~x + y # convert data to spatial points data frame

class(meuse)[1] "SpatialPointsDataFrame"

attr(,"package")

[1] "sp"

data(meuse.grid)# this is gridded data for the meuse data set

str(meuse.grid)'data.frame': 3103 obs. of 7 variables:

$ x : num 181180 181140 181180 181220 181100 ...

$ y : num 333740 333700 333700 333700 333660 ...

$ part.a: num 1 1 1 1 1 1 1 1 1 1 ...

$ part.b: num 0 0 0 0 0 0 0 0 0 0 ...

$ dist : num 0 0 0.0122 0.0435 0 ...

$ soil : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ...

$ ffreq : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ...

coordinates(meuse.grid) = ~x + y # converts to spatial class

gridded(meuse.grid) <- TRUE

Page 22: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Thiessen Polygons

zn.tp = krige(log(zinc) ~ 1, meuse, meuse.grid, nmax = 1)

#for this search, the neighborhood is set to nmax=1

image(zn.tp["var1.pred"])

points(meuse, pch = "+", cex = 0.65)

cc = coordinates(meuse)

Page 23: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Thiessen Polygons

library(tripack)

plot(voronoi.mosaic(cc[, 1], cc[, 2]), do.points = FALSE, add = TRUE)

title("Thiessen (or Voronoi) polygon interpolation of log(zinc)")

Page 24: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Spline

• Surface created with Spline interpolation• Passes through each sample point

• May exceed the value range of the sample point set

Page 25: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Spline Interpolation

library(akima)

data(meuse)

meuse.zinc <- data.frame(cbind(meuse$x,

meuse$y,meuse$zinc))

par(mfcol=c(1,1))

meuse.akim <- interp(meuse.zinc$X1, meuse.zinc$X2, meuse.zinc$X3)

image(meuse.akim,,xlab="", ylab="",asp=1)

contour(meuse.akim,add=TRUE,, levels = seq(100,2000,200))

title(main="Bilinear Interpolation (Akima - default)")

points(meuse.zinc)

Page 26: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques
Page 27: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

Choosing the Right Interpolation

• The quality of sample point set can affect choice of interpolation method as well. If the sample points are poorly distributed or there are few of them, the surface might not represent the

actual terrain very well. If we have too few sample points, add more sample points in areas

where the terrain changes abruptly or frequently, then try using Kriging.

• The real-world knowledge of the subject matter will initially affect which interpolation method to use. If it is know that some of the features in surface exceed the z value, for example, and that IDW will result in a surface that does not exceed the highest or lowest z value in the sample point

set, choose the Spline method.

• If we know that the splined surface might end up with features that we know don’t exist because Spline interpolation doesn’t work well with sample points that are close together and have

extreme differences in value, you might decide to try IDW

Page 28: Interpolasi Spatial Statistics...Praktikum 5 | Statistika Spasial rahmaanisa@apps.ipb.ac.id Outline •Trend surface •Thiesen Polygon •Inverse Weight Distance General list of techniques

References

1. Anonymous. 2017. Interpolation in R. https://mgimond.github.io/Spatial/interpolation-in-r.html [17 Okt 2017]

2. [gisresource]. 2013. Choosing the Right Interpolation Method. https://www.gisresources.com/choosing-the-right-interpolation-method_2/ [17 Okt 2017)

3. Lewis, J. Spatial Interpolation: Methods for Extending Information on Spatial Data Fields.

4. Lewis, J. 2013. GEOSTAT13 Tutorial: Spatial Interpolation with R.

5. Sang. 2006. Lecture Notes: Spatial Interpolation. http://sbs.mnsu.edu/geography/people/sang/LECTURE8_SPATIAL_INTERPOLATION.pdf [17 Okt2017]

6. Pustaka lain yang relevan.