Description Usage Arguments Value Author(s) Examples
This function serves three purposes: (i) changes the (complicated) data structure of a spatial polygon (from the sp package) to a format which is aligned with the (simpler) PBSmapping polygon format. (ii) clips/crops the polygons to a pre specified bounding box (iii) computes and adds the polygon centers for each polygon
1 | CropSpatialPolygonsDataFrame(x, bb = NULL, verbose = 0)
|
x |
object of class SpatialPolygonsDataFrame |
bb |
bounding box to crop the polygons |
verbose |
level of verbosity |
New list with separate entries for data, polys, and poly centers
Markus Loecher <markus.loecher@gmail.com> and Madhav Kumar <madhavkumar2005@gmail.com>
1 2 3 4 5 | # San Francisco:
data(california.tract10, envir = environment())
sf.polys <- CropSpatialPolygonsDataFrame(x= california.tract10,
bb= data.frame(X=c(-122.5132, -122.37),
Y= c(37.70760, 37.81849)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.