Basemap
This module provides functionality for working with basemaps.
- class Basemap(api, data={})[source]
Bases:
Base- Parameters:
api (GeoboxClient)
data (Dict | None)
- BASE_ENDPOINT = 'basemaps/'
- __init__(api, data={})[source]
Initialize a basemap instance.
- Parameters:
api (GeoboxClient) – The GeoboxClient instance for making requests.
data (Dict) – The data of the basemap.
- classmethod get_basemaps(api)[source]
Get a list of basemaps
- Parameters:
api (GeoboxClient) – The GeoboxClient instance for making requests.
- Returns:
list of basemaps.
- Return type:
List[BaseMap]
Example
>>> from geobox import GeoboxClient >>> from geobox.basemap import Basemap >>> client = GeoboxClient() >>> basemaps = Basemap.get_basemaps(client) or >>> basemaps = client.get_basemaps()
- classmethod get_basemap(api, name)[source]
Get a basemap object
- Parameters:
api (GeoboxClient) – The GeoboxClient instance for making requests.
name (str) – the basemap name
- Returns:
the basemap object
- Return type:
- Raises:
NotFoundError – if the base,ap with the specified name not found
Example
>>> from geobox import GeoboxClient >>> from geobox.basemap import Basemap >>> client = GeoboxClient() >>> basemap = Basemap.get_basemap(client, name='test') or >>> basemap = 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
Get the server url of the basemap
- Returns:
the server url
- Return type:
str
- property proxy_url: str
Get the proxy url of the basemap
- Returns:
the proxy url
- Return type:
str
- classmethod proxy_basemap(api, url)[source]
Proxy the basemap
- Parameters:
api (GeoboxClient) – The GeoboxClient instance for making requests.
url (str) – the proxy server url.
- Returns:
None
- Return type:
None
Example
>>> from geobox import GeoboxClient >>> from geobox.basemap import Basemap >>> client = GeoboxClient() >>> Basemap.proxy_basemap(client, url='proxy_server_url') or >>> client.proxy_basemap(url='proxy_server_url')