Find placenames near a given location
an_near(gaz, loc, max_distance)data.frame or SpatialPointsDataFrame: as returned by an_read, an_preferred, or an_filter
numeric: target location (a two-element numeric vector giving longitude and latitude, or a SpatialPoints object)
numeric: maximum search distance in kilometres
data.frame of results
if (FALSE) { # \dontrun{
g <- an_read(cache = "session")
## named features within 10km of 110E, 66S
an_near(g, loc = c(110, -66), max_distance = 10)
## using pipe operator
g %>% an_near(loc = c(100, -66), max_distance = 10)
## with sp objects
gsp <- an_read(cache = "session", sp = TRUE)
loc <- sp::SpatialPoints(matrix(c(110, -66), nrow = 1),
proj4string = CRS("+proj=longlat +datum=WGS84 +ellps=WGS84"))
an_near(gsp, loc = loc, max_distance = 10)
} # }