Detects the geometry from the payload. POI replies (from $pois_search(),
$block_pois(), $point_pois(), $poi(), $places()) become points from
their lat/lon. An isochrone reply with format = "geojson" becomes
polygons. Block replies ($blocks_query(), $place_blocks(),
$poi_catchment(), isochrone format = "blocks") carry only GEOIDs, so the
block boundaries are joined from block_geometry, or downloaded with tigris
when fetch = TRUE.
Arguments
- x
(
close_reply)
A reply, or the same list shape.- block_geometry
(
sf, default NULL)
Block boundaries with ageoid_colcolumn, joined to block replies on the 15-digit GEOID.- geoid_col
(
character(1), default'GEOID20')
Name of the GEOID column inblock_geometry(TIGER 2020 blocks).- crs
(default
4326)
Coordinate reference system for point and polygon geometry.- fetch
(
logical(1), default FALSE)
IfTRUEandblock_geometryisNULL, download the needed TIGER blocks withtigris(inferring state and county from the GEOIDs).
Examples
if (FALSE) { # \dontrun{
close <- close_client(output = 'raw')
close_as_sf(close$pois_search(lat = 41.82, lon = -71.41, radius_m = 1500))
} # }
