Async 3D Tile
This module provides functionality for working with async 3d tiles.
- class AsyncTile3d(api, uuid, data={})[source]
Bases:
AsyncBase- Parameters:
api (AsyncGeoboxClient)
uuid (str)
data (Dict | None)
- BASE_ENDPOINT = '3dtiles/'
- __init__(api, uuid, data={})[source]
Initialize a 3D Tile instance.
- Parameters:
api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.
uuid (str) – The unique identifier for the 3D Tile.
data (Dict) – The data of the 3D Tile.
- async classmethod get_3dtiles(api, **kwargs)[source]
[async] Get list of 3D Tiles with optional filtering and pagination.
- Parameters:
api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.
- Keyword Arguments:
q (str) – query filter based on OGC CQL standard. e.g. “field1 LIKE ‘%GIS%’ AND created_at > ‘2021-01-01’”
search (str) – search term for keyword-based searching among search_fields or all textual fields if search_fields does not have value. NOTE: if q param is defined this param will be ignored.
search_fields (str) – comma separated list of fields for searching.
order_by (str) – comma separated list of fields for sorting results [field1 A|D, field2 A|D, …]. e.g. name A, type D. NOTE: “A” denotes ascending order and “D” denotes descending order.
return_count (bool) – Whether to return total count. default is False.
skip (int) – Number of items to skip. default is 0.
limit (int) – Number of items to return. default is 10.
user_id (int) – Specific user. privileges required.
shared (bool) – Whether to return shared maps. default is False.
- Returns:
A list of 3D Tile instances or the total number of 3D Tiles.
- Return type:
List[AsyncTile3d] | int
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tiles = await AsyncTile3d.get_3dtiles(client, q="name LIKE '%My tile%'") or >>> tiles = await client.get_3dtiles(q="name LIKE '%My tile%'")
- async classmethod get_3dtile(api, uuid, user_id=None)[source]
[async] Get a 3D Tile by its UUID.
- Parameters:
api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.
uuid (str) – The UUID of the map to 3D Tile.
user_id (int) – Specific user. privileges required.
- Returns:
The 3D Tile object.
- Return type:
- Raises:
NotFoundError – If the 3D Tile with the specified UUID is not found.
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await AsyncTile3d.get_3dtile(client, uuid="12345678-1234-5678-1234-567812345678") or >>> tile = await client.get_3dtile(uuid="12345678-1234-5678-1234-567812345678")
- async classmethod get_3dtile_by_name(api, name, user_id=None)[source]
[async] Get a 3dtile by name
- Parameters:
api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.
name (str) – the name of the 3dtile to get
user_id (int, optional) – specific user. privileges required.
- Returns:
returns the 3dtile if a 3dtile matches the given name, else None
- Return type:
AsyncTile3d | None
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile3d = await AsyncTile3d.get_3dtile_by_name(client, name='test') or >>> tile3d = await client.get_3dtile_by_name(name='test')
- async update(**kwargs)[source]
[async] Update the 3D Tile.
- Keyword Arguments:
name (str) – The name of the 3D Tile.
display_name (str) – The display name of the 3D Tile.
description (str) – The description of the 3D Tile.
settings (Dict) – The settings of the 3D Tile.
thumbnail (str) – The thumbnail of the 3D Tile.
- Returns:
The updated 3D Tile data.
- Return type:
Dict
- Raises:
ApiRequestError – If the API request fails.
ValidationError – If the 3D Tile data is invalid.
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await AsyncTile3d.get_3dtile(client, uuid="12345678-1234-5678-1234-567812345678") >>> await tile.update_3dtile(display_name="New Display Name")
- async delete()[source]
[async] Delete the 3D Tile.
- Returns:
None
- Return type:
None
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await Map.get_3dtile(client, uuid="12345678-1234-5678-1234-567812345678") >>> await tile.delete()
- property thumbnail: str
Get the thumbnail URL of the 3D Tile.
- Returns:
The thumbnail url of the 3D Tile.
- Return type:
str
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await AsyncTile3d.get_3dtile(client, uuid="12345678-1234-5678-1234-567812345678") >>> tile.thumbnail
- async get_item(path)[source]
[async] Get an Item from 3D Tiles
- Parameters:
path (str) – the path of the item.
- Returns:
the data of the item.
- Return type:
Dict
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await AsyncTile3d.get_3dtile(client, uuid="12345678-1234-5678-1234-567812345678") or >>> tile = await client.get_3dtile(uuid="12345678-1234-5678-1234-567812345678") >>> item = await tile.get_item()
[async] Shares the 3D Tile with specified users.
- Parameters:
users (List[AsyncUser]) – The list of user objects to share the 3D Tile with.
- Returns:
None
- Return type:
None
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await AsyncTile3d.get_3dtile(client, uuid="12345678-1234-5678-1234-567812345678") >>> users = await client.search_users(search='John') >>> await tile.share(users=users)
[async] Unshares the 3D Tile with specified users.
- Parameters:
users (List[AsyncUser]) – The list of user objects to unshare the 3D Tile with.
- Returns:
None
- Return type:
None
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await AsyncTile3d.get_3dtile(client, uuid="12345678-1234-5678-1234-567812345678") >>> users = await client.search_users(search='John') >>> await tile.unshare(users=users)
[async] Retrieves the list of users the 3D Tile is shared with.
- Parameters:
search (str, optional) – The search query.
skip (int, optional) – The number of users to skip.
limit (int, optional) – The maximum number of users to retrieve.
- Returns:
The list of shared users.
- Return type:
List[AsyncUser]
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await AsyncTile3d.get_3dtile(client, uuid="12345678-1234-5678-1234-567812345678") >>> await tile.get_shared_users(search='John', skip=0, limit=10)
- async get_tileset_json()[source]
[async] Get Tileset JSON of a 3D Tiles.
- Returns:
The tileset JSON configuration.
- Return type:
Dict
Example
>>> from geobox.aio import AsyncGeoboxClient >>> from geobox.aio.tile3d import AsyncTile3d >>> async with AsyncGeoboxClient() as client: >>> tile = await AsyncTile3d.get_3dtile(api=client, uuid="12345678-1234-5678-1234-567812345678") >>> tile_json = await tile.get_tileset_json()