Skip to contents

Given a table of frompoints (lat lon coordinates), find IDs of and distances to all nearby points that could represent e.g., schools, parks, or EPA-regulated facilities with locations in Facility Registry Services (FRS). Like getblocksnearby() but for nearby points of any type.

Usage

getpointsnearby(
  frompoints,
  topoints,
  radius = 3,
  maxradius = 31.07,
  avoidorphans = FALSE,
  retain_unadjusted_distance = TRUE,
  quadtree = NULL,
  quaddatatable = NULL,
  quiet = FALSE,
  updateProgress = FALSE,
  report_progress_every_n = 1000,
  ...
)

Arguments

frompoints

used as the sitepoints param of getblocksnearby(). Can be for example Census blocks (based on internal point of each block).

topoints

table of lat lon coordinates of points that may be nearby. These could be schools, parks, facilities, or any other set of points.

radius

passed to getpointsnearbyviaQuadTree()

maxradius

passed to getpointsnearbyviaQuadTree()

avoidorphans

passed to getpointsnearbyviaQuadTree()

retain_unadjusted_distance

passed to getpointsnearbyviaQuadTree()

quadtree

optional index of topoints

  • if not provided, created by indexpoints()

quaddatatable

optional table of topoints (in format provided by internal helper function create_quaddata() as needed).

quiet

passed to getpointsnearbyviaQuadTree()

updateProgress

progress bar object, passed to getpointsnearbyviaQuadTree()

report_progress_every_n

passed to getpointsnearbyviaQuadTree()

...

passed to getpointsnearbyviaQuadTree()

Value

sites2points data.table one row per pair of frompoint and nearby topoint, like output of getpointsnearbyviaQuadTree()

Details

Later steps can aggregate at each frompoint to summarize

  • count schools or facilities, etc., near each frompoint

  • max/min distance for each frompoint, like proximity of nearest, etc.

  • a proximity score for each frompoint (e.g., block) and then each blockgroup