osm_geocode: Search for places by address

Description Usage Arguments Details Note Examples

Description

Geocode place addresses

Usage

1
2
3
4
5
osm_geocode(query, country_codes = NULL, viewbox = NULL, bounded = FALSE,
  address_details = TRUE, exclude_place_ids = NULL, limit = 1,
  email = getOption("OSM_API_EMAIL", "nominatimrpackage@example.com"),
  accept_language = getOption("LANG", "en-US,en;q=0.8"),
  key = getOption("OSM_API_KEY", ""))

Arguments

query

Query string to search for. SHould be in standard address format.

country_codes

Limit search results to a specific country (or a list of countries). Should be the ISO 3166-1alpha2 code,e.g. gb for the United Kingdom, de for Germany, etc. Format: <countrycode>[,<countrycode>][,<countrycode>]...

viewbox

The preferred area to find search results. Format: <left>,<top>,<right>,<bottom>

bounded

Restrict the results to only items contained with the bounding box. Restricting the results to the bounding box also enables searching by amenity only. For example a search query of just "[pub]" would normally be rejected but with bounded=TRUE will result in a list of items matching within the bounding box.

address_details

Include a breakdown of the address into elements (TRUE == include)

exclude_place_ids

If you do not want certain openstreetmap objects to appear in the search result, give a comma separated list of the place_id's you want to skip. This can be used to broaden search results. For example, if a previous query only returned a few results, then including those here would cause the search to return other, less accurate, matches (if possible). Format <place_id,[place_id],[place_id]>

limit

Limit the number of returned results (numeric)

email

If you are making large numbers of request please include a valid email address or alternatively include your email address as part of the User-Agent string. This information will be kept confidential and only used to contact you in the event of a problem, see Usage Policy for more details. You can pass the value in directly or set the OSM_API_EMAIL option and the function will it for all requests.

accept_language

Preferred language order for showing search results Either uses standard rfc2616 accept-language string or a simple comma separated l ist of language codes. The LANG option will be used, if set.

key

To access the openstreetmap API you need a valid API key. You can get it for free at https://developer.mapquest.com

Details

Vectorized over query

Nominatim indexes named (or numbered) features with the OSM data set and a subset of other unnamed features (pubs, hotels, churches, etc).

Search terms are processed first left to right and then right to left if that fails.

Note

A slight delay is introduced between calls as both OpenStreetMap Nominatim & MapQuest Nominatim API calls to reduce load on their servers.

Data (c) OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright
Nominatim Usage Policy: http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy
MapQuest Nominatim Terms of Use: http://info.mapquest.com/terms-of-use/

Examples

1
2
3
4
## Not run: 
osm_search("[bakery]+berlin+wedding", limit=5)

## End(Not run)

hrbrmstr/nominatim documentation built on May 17, 2019, 5:11 p.m.