gis.utils ========= .. py:module:: gis.utils Attributes ---------- .. autoapisummary:: gis.utils.Endpoint gis.utils.GeocodeProfile gis.utils.DirectionsProfile Classes ------- .. autoapisummary:: gis.utils.MapboxRequests Functions --------- .. autoapisummary:: gis.utils.outside_bbox Module Contents --------------- .. py:data:: Endpoint .. py:data:: GeocodeProfile .. py:data:: DirectionsProfile .. py:class:: MapboxRequests(access_token: str | None, endpoint: Literal['geocoding'] = 'geocoding', profile: GeocodeProfile = 'places', api_version: str = 'v5') MapboxRequests(access_token: str | None, endpoint: Literal['directions'], profile: DirectionsProfile, api_version: str = 'v5') .. py:attribute:: host :type: ClassVar[str] :value: 'https://api.mapbox.com' .. py:attribute:: endpoints :type: ClassVar[tuple[Endpoint, Ellipsis]] :value: ('directions', 'geocoding') .. py:attribute:: geocode_profiles :type: ClassVar[tuple[GeocodeProfile, Ellipsis]] :value: ('places',) .. py:attribute:: directions_profiles :type: ClassVar[tuple[DirectionsProfile, Ellipsis]] :value: ('driving-traffic', 'driving', 'walking', 'cycling') .. py:attribute:: access_token .. py:attribute:: endpoint :value: 'geocoding' .. py:attribute:: profile :value: 'places' .. py:attribute:: api_version :value: 'v5' .. py:property:: base_url :type: purl.URL .. py:method:: 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 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 .. py:method:: directions(coordinates: collections.abc.Iterable[tuple[str | float, str | float]], as_url: Literal[False] = False) -> requests.Response directions(coordinates: collections.abc.Iterable[tuple[str | float, str | float]], as_url: Literal[True]) -> purl.URL directions(coordinates: collections.abc.Iterable[tuple[str | float, str | float]], as_url: bool) -> requests.Response | purl.URL coordinates: iterable of tuples of (lat, lon) .. py:function:: outside_bbox(coordinate: onegov.gis.models.coordinates.AnyCoordinates | None, bbox: collections.abc.Collection[onegov.gis.models.coordinates.RealCoordinates] | None) -> bool Checks if the Coordinates instance is inside the bounding box defined by the most outward sitting points in an iterable of two+ Coordinates.