Find placenames near a given location
Arguments
- gaz
data.frame or SpatialPointsDataFrame: as returned by
an_read
,an_preferred
, oran_filter
- loc
numeric: target location (a two-element numeric vector giving longitude and latitude, or a SpatialPoints object)
- max_distance
numeric: maximum search distance in kilometres
Examples
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)
} # }