Get addresses or landmarks from locations using the HERE 'Geocoder' API. The return value is an sf object, containing point geometries with suggestions for addresses or landmarks near the provided POIs.

reverse_geocode(poi, results = 1, landmarks = FALSE, url_only = FALSE)

Arguments

poi

sf object, Points of Interest (POIs) of geometry type POINT.

results

numeric, maximum number of results (Valid range: 1 and 20).

landmarks

boolean, retrieve landmarks instead of addresses (default = FALSE)?.

url_only

boolean, only return the generated URLs (default = FALSE)?

Value

An sf object, containing the suggested addresses or landmark names of the reverse geocoded POIs.

Note

If no addresses or landmarks are found near a POI, NULL for this POI is returned. In this case the rows corresponding to this particular POI are missing and merging the POIs by row is not possible. However, in the returned sf object, the column "id" matches the rows of the input POIs. The "id" column can be used to join the original POIs.

References

HERE Geocoder API: Geocode

Examples

# Provide an API Key for a HERE project set_key("<YOUR API KEY>") # Get addresses addresses <- reverse_geocode(poi = poi, results = 3, landmarks = FALSE, url_only = TRUE) # Get landmarks landmarks <- reverse_geocode(poi = poi, results = 3, landmarks = TRUE, url_only = TRUE)