CropSpatialPolygonsDataFrame: Crop polygons to bounding box and adds polygon centers

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
CropSpatialPolygonsDataFrame(x, bb = NULL, verbose = 0)

Arguments

x

object of class SpatialPolygonsDataFrame

bb

bounding box to crop the polygons

verbose

level of verbosity

Value

New list with separate entries for data, polys, and poly centers

Author(s)

Markus Loecher <markus.loecher@gmail.com> and Madhav Kumar <madhavkumar2005@gmail.com>

Examples

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)))

RapidPolygonLookup documentation built on May 2, 2019, 7:08 a.m.