Utility to create efficient quadtree spatial index of any set of lat,lon
Source:R/PROXIMITY_FUNCTIONS.R
indexpoints.Rd
Index a list of points (e.g., schools)
so getpointsnearby()
can find them very quickly
Usage
indexpoints(pts, indexname = "custom_index", envir = globalenv())
Value
Just returns TRUE when done. Side effect is to
put into the globalenv()
(or specified envir) that spatial index with name defined by indexname,
as created by indexpoints()
.
Details
This creates a spatial index
to be used by getpointsnearby()
to support proxistat()
,
to create a new proximity score for every block and block group in the US.
It relies on create_quaddata()
for one step, then SearchTrees::createTree()
Examples
if (FALSE) { # \dontrun{
# EXAMPLES NOT TESTED YET ***
pts <- testpoints_10
tempenv <- new.env()
index10 <- indexpoints(pts, "index10", envir = tempenv)
x <- getpointsnearby(pts, quadtree = get(index10, envir = tempenv))
# y <- proxistat(pts)
# rm(custom_index)
} # }