oe_search: Search for a place and return an sf data frame locating it

View source: R/search.R

oe_searchR Documentation

Description

This (only internal and experimental) function provides a simple interface to the nominatim service for finding the geographical location of place names.

Usage

oe_search(
  place,
  base_url = "https://nominatim.openstreetmap.org",
  destfile = tempfile(fileext = ".geojson"),
  ...
)

Arguments

place

Text string containing the name of a place the location of which is to be found, such as "Leeds" or "Milan".

base_url

The URL of the nominatim server to use. The main open server hosted by OpenStreetMap is the default.

destfile

The name of the destination file where the output of the search query, a .geojson file, should be saved.

...

Extra arguments that are passed to sf::st_read.

Value

An sf object corresponding to the input place. The sf object is read by sf::st_read() and it is based on a geojson file returned by Nominatim API.


osmextract documentation built on May 29, 2024, 6:48 a.m.