query_tiles | R Documentation |
Get information about features in a tileset using the Tilequery API
query_tiles(
location,
tileset_id,
radius = 0,
limit = 5,
dedupe = TRUE,
geometry = NULL,
layers = NULL,
access_token = NULL
)
location |
The location for which you'd like to query tiles, expressed as either a length-2 vector of longitude and latitude or an address you'd like to geocode. |
tileset_id |
The tileset ID to query. |
radius |
The radius around the point (in meters) for which you'd like to query features. For point-in-polygon queries (e.g. "what county is my point located in?") the default of 0 should be used. |
limit |
How many features to return (defaults to 5). Can be an integer between 1 and 50. |
dedupe |
Whether or not to return duplicate features as identified by their IDs. The default, TRUE, will de-duplicate your dataset. |
geometry |
The feature geometry type to query - can be |
layers |
A vector of layer IDs you'd like to query (recommended); if left blank will query all layers, with the limitation that at most 50 features can be returned. |
access_token |
A Mapbox access token, which can be set with
|
An R list containing the API response, which includes information about the requested features. Parse the list to extract desired elements.
https://docs.mapbox.com/help/tutorials/find-elevations-with-tilequery-api/
## Not run:
library(mapboxapi)
elevation <- query_tiles(
location = "Breckenridge, Colorado",
tileset_id = "mapbox.mapbox-terrain-v2",
layer = "contour",
limit = 50
)
max(elevation$features$properties$ele)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.