osm_search_spatial: Search for places, returning a list of...

Description Usage Arguments Details Note Examples

Description

Vectorized over query. If the return types are mixed (i.e. not all of the same spatial type) the function will stop with an error.

Usage

1
2
3
4
5
osm_search_spatial(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

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

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

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/

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# returns SpatialPointsDataFrame
osm_search_spatial("[bakery]+berlin+wedding", limit=5)

# returns SpatialLinesDataFrame
osm_search_spatial("135-7 pilkington avenue, birmingham", limit=10)

# returns SpatialPolygonsDataFrame
osm_search_spatial("135 pilkington avenue, birmingham", limit=10)

## End(Not run)

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