Tilequery class provides access to the Mapbox Tilequery API. You can import it from either the
mapbox module or the
>>> from mapbox import Tilequery
>>> from mapbox.services.tilequery import Tilequery
See https://www.mapbox.com/api-documentation/maps/#tilequery for general documentation of the API.
Use of the Tilequery API requires an access token, which you should set in your environment. For more information, see the access tokens documentation.
The public method of the
Tilequery class provides access to the Tilequery API and returns an instance of
Usage: Retrieving Features
>>> tilequery = Tilequery()
tilequery method, passing in values for
lat. Pass in values for optional arguments as necessary -
>>> response = tilequery.tilequery("mapbox.mapbox-streets-v8", lon=0.0, lat=1.1)
Evaluate whether the request succeeded, and retrieve the features from the response object.
>>> if response.status_code == 200: ... features = response.json()