Async Basemap

This module provides functionality for working with async basemaps.

class AsyncBasemap(api, data={})[source]

Bases: AsyncBase

Parameters:
BASE_ENDPOINT = 'basemaps/'
__init__(api, data={})[source]

Initialize a basemap instance.

Parameters:
  • api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.

  • data (Dict) – The data of the basemap.

async classmethod get_basemaps(api)[source]

[async] Get a list of basemaps

Parameters:

api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.

Returns:

list of basemaps.

Return type:

List[AsyncBaseMap]

Example

>>> from geobox.aio import AsyncGeoboxClient
>>> from geobox.aio.basemap import AsyncBasemap
>>> async with AsyncGeoboxClient() as client:
>>>     basemaps = await AsyncBasemap.get_basemaps(client)
or
>>>     basemaps = await client.get_basemaps()
async classmethod get_basemap(api, name)[source]

[async] Get a basemap object

Parameters:
  • api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.

  • name (str) – the basemap name

Returns:

the basemap object

Return type:

AsyncBasemap

Raises:

NotFoundError – if the base,ap with the specified name not found

Example

>>> from geobox.aio import AsyncGeoboxClient
>>> from geobox.aio.basemap import Basemap
>>> async with AsyncGeoboxClient() as client:
>>>     basemap = await Basemap.get_basemap(client, name='test')
or
>>>     basemap = await client.get_basemap(name='test')
property thumbnail: str

Get the thumbnail url of the basemap

Returns:

the thumbnail url

Return type:

str

property wmts: str

Get the wmts url of the basemap

Returns:

the wmts url

Return type:

str

property server_url: str

[async] Get the server url of the basemap

Returns:

the server url

Return type:

str

property proxy_url: str

[async] Get the proxy url of the basemap

Returns:

the proxy url

Return type:

str

async classmethod proxy_basemap(api, url)[source]

[async] Proxy the basemap

Parameters:
  • api (AsyncGeoboxClient) – The GeoboxClient instance for making requests.

  • url (str) – the proxy server url.

Returns:

None

Return type:

None

Example

>>> from geobox.aio import AsyncGeoboxClient
>>> from geobox.aio.basemap import Basemap
>>> async with AsyncGeoboxClient() as client:
>>>     await Basemap.proxy_basemap(client, url='proxy_server_url')
or
>>>     await client.proxy_basemap(url='proxy_server_url')