py3dtiles.tileset.tile module

class py3dtiles.tileset.tile.Tile(geometric_error: float = 500, bounding_volume: BoundingVolume[Any] | None = None, transform: ndarray[Any, dtype[float64]] = array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), refine_mode: Literal['ADD', 'REPLACE'] = 'ADD', content_uri: Path | None = None)[source]

Bases: RootProperty[TileDictType]

add_child(tile: Tile) None[source]
delete_on_disk(root_uri: Path, delete_sub_tileset: bool = False) None[source]

Deletes all files linked to the tile and its children. The uri of the folder where tileset is, should be defined.

Parameters:
  • root_uri – The folder where tileset is

  • delete_sub_tileset – If True, all tilesets present as tile content will be removed as well as their content.

If False, the linked tilesets in tiles won’t be removed.

classmethod from_dict(tile_dict: TileDictType) Tile[source]
get_all_children() list[Tile][source]
Returns:

the recursive (across the children tree) list of the children tiles

get_or_fetch_content(root_uri: Path | None) TileContent | TileSet[source]

If a tile_content content has been set, returns this content. If the tile content is None and a tile_content uri has been set, the tile will load the file and return its content.

Parameters:

root_uri – the base uri which tile.content_uri is relative to. Usually the directory containing the tileset containing this tile.

get_refine_mode() Literal['ADD', 'REPLACE'][source]
has_content() bool[source]

Returns if there is a tile content (loaded or not).

has_content_loaded() bool[source]

Returns if there is a tile content loaded in this tile.

set_refine_mode(mode: Literal['ADD', 'REPLACE']) None[source]
sync_bounding_volume_with_children() None[source]
to_dict() TileDictType[source]
write_content(root_uri: Path | None) None[source]

Write (or overwrite) the tile content to the directory specified as parameter and withing the relative filename designated by the tile’s content uri.

Parameters:

root_uri – the base uri of this tile, usually the folder where the tileset is