gis.utils

Attributes

Endpoint

GeocodeProfile

DirectionsProfile

Classes

MapboxRequests

Functions

outside_bbox(→ bool)

Checks if the Coordinates instance is inside the bounding box defined

Module Contents

gis.utils.Endpoint[source]
gis.utils.GeocodeProfile[source]
gis.utils.DirectionsProfile[source]
class gis.utils.MapboxRequests(access_token: str | None, endpoint: Literal['geocoding'] = 'geocoding', profile: GeocodeProfile = 'places', api_version: str = 'v5')[source]
class gis.utils.MapboxRequests(access_token: str | None, endpoint: Literal['directions'], profile: DirectionsProfile, api_version: str = 'v5')
host: ClassVar[str] = 'https://api.mapbox.com'[source]
endpoints: ClassVar[tuple[Endpoint, Ellipsis]] = ('directions', 'geocoding')[source]
geocode_profiles: ClassVar[tuple[GeocodeProfile, Ellipsis]] = ('places',)[source]
directions_profiles: ClassVar[tuple[DirectionsProfile, Ellipsis]] = ('driving-traffic', 'driving', 'walking', 'cycling')[source]
access_token[source]
endpoint = 'geocoding'[source]
profile = 'places'[source]
api_version = 'v5'[source]
property base_url: purl.URL[source]
geocode(text: str | None = None, street: str | None = None, zip_code: str | None = None, city: str | None = None, ctry: str | None = None, locale: str | None = None, as_url: Literal[False] = False) requests.Response[source]
geocode(text: str | None = None, street: str | None = None, zip_code: str | None = None, city: str | None = None, ctry: str | None = None, locale: str | None = None, *, as_url: Literal[True]) purl.URL
geocode(text: str | None = None, street: str | None = None, zip_code: str | None = None, city: str | None = None, ctry: str | None = None, locale: str | None = None, *, as_url: bool) requests.Response | purl.URL
directions(coordinates: Iterable[tuple[str | float, str | float]], as_url: Literal[False] = False) requests.Response[source]
directions(coordinates: Iterable[tuple[str | float, str | float]], as_url: Literal[True]) purl.URL
directions(coordinates: Iterable[tuple[str | float, str | float]], as_url: bool) requests.Response | purl.URL

coordinates: iterable of tuples of (lat, lon)

gis.utils.outside_bbox(coordinate: AnyCoordinates | None, bbox: Collection[RealCoordinates] | None) bool[source]

Checks if the Coordinates instance is inside the bounding box defined by the most outward sitting points in an iterable of two+ Coordinates.