mz_autocomplete {rmapzen} | R Documentation |
Mapzen search API
Description
Functions to access the various endpoints from the Mapzen Search API.
For more details, see https://github.com/pelias/documentation/. If your
data is already split up by street, city, state, zip, etc., then you might
find mz_structured_search
to be more precise. All arguments
besides text
(point
in the case of mz_reverse_geocode
) are
optional. If you have parsed addresses (e.g. for geocoding), use mz_structured_search
Usage
mz_autocomplete(
text,
boundary.country = NULL,
boundary.rect = NULL,
focus.point = NULL,
sources = NULL,
layers = NULL,
api_key = NULL
)
mz_reverse_geocode(
point,
size = NULL,
layers = NULL,
sources = NULL,
boundary.country = NULL,
api_key = NULL
)
mz_search(
text,
size = 10,
boundary.country = NULL,
boundary.rect = NULL,
boundary.circle = NULL,
focus.point = NULL,
sources = NULL,
layers = NULL,
api_key = NULL
)
Arguments
text |
Search string |
boundary.country |
ISO-3166 country code to narrow the search.
See |
boundary.rect |
4 corners that define a box to narrow the search. Can
be the result of |
focus.point |
A point to "focus" the search. Can be created with
|
sources |
The originating source of the data (to filter/narrow search
results). See |
layers |
Which layers (types of places) to search. See
https://github.com/pelias/documentation/
for definitions, and use |
api_key |
Your Mapzen API key. The default is to look for the key within the provider information that was set up with 'mz_set_host'. |
point |
For reverse geocoding, the location to reverse geocode. Can be
created with |
size |
Number of search results requested |
boundary.circle |
A circle to narrow the search. Should have named elements with names "lon", "lat", and "radius" |
See Also
mz_place
, mz_structured_search
,
mz_countries
, mz_sources
, mz_layers
Examples
## Not run:
# hard rock cafes in sweden:
mz_search("Hard Rock Cafe", boundary.country = "SE")
# autocompletions when the user types in "Union Square"
# prioritizing San Francisco results first:
mz_autocomplete("Union Square",
focus.point = mz_geocode("San Francisco, CA"))
## End(Not run)