Description Usage Arguments Author(s) Examples
This function searches the lat-long ranges of polygons to come up with a shorter list of candidates on which point.in.polygon() from the sp package can be applied.
1 2 | FindPolygonInRanges(poly.list, XY, poly.id = "fips", poly.id.colname = "census.block",
verbose = 0)
|
poly.list |
polygon list with 3 or 4 elements: data, polys, poly.centers, and possibly ranges |
XY |
data frame containing X-Y columns |
poly.id |
column name in 'poly.list$data' containing the polygon identifier |
poly.id.colname |
desired column name in the output data frame containing the polygon identifier |
verbose |
level of verbosity |
Markus Loecher <markus.loecher@gmail.com> and Madhav Kumar <madhavkumar2005@gmail.com>
1 2 3 4 5 6 7 8 | data(sf.crime.2012, envir = environment())
data(sf.polys, envir = environment())
sf.polys <- AddRanges(sf.polys)
XY <- FindPolygonInRanges(sf.polys, sf.crime.2012[1:1000,], verbose=0)
which(is.na(XY[,"census.block"]))
table(XY$rank)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.