FindPolygonInRanges {RapidPolygonLookup}R Documentation

Use range-search to map points to polygon.

Description

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.

Usage

FindPolygonInRanges(poly.list, XY, poly.id = "fips", poly.id.colname = "census.block", 
    verbose = 0)

Arguments

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

Author(s)

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

Examples


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)


[Package RapidPolygonLookup version 0.1.1 Index]