API Reference

Classes

class Object(dtcc_core.model.model.Model)[source]

Base class for all object classes.

class GeometryType(enum.Enum)[source]
class Building(dtcc.Object)[source]

Represents a building in a city.

class BuildingPart(dtcc.Object)[source]
class City(dtcc.Object)[source]

Represents a city, the top-level container class for city models.

class CityObject(dtcc.Object)[source]

Represents a generic object in a city.

class Terrain(dtcc.Object)[source]

Represents a terrain object in a city.

class RoadNetwork(dtcc.Object)[source]
class RoadType(enum.Enum)[source]

Enumeration representing different road types.

class Landuse(dtcc.Object)[source]
class LanduseClasses(enum.Enum)[source]
class Bounds(dtcc_core.model.model.Model)[source]

Represents the boundaries of a rectangular region in the xy plane) with optional extension along the z-axis (depth)

class Geometry(dtcc_core.model.model.Model)[source]

Base class for all geometry classes.

class Grid(dtcc.Geometry)[source]

Represents a structured quadrilateral grid in 2D.

class Mesh(dtcc.Geometry)[source]

Represents an unstructured triangular mesh in 3D.

class MultiSurface(dtcc.Geometry)[source]

Represents a planar surfaces in 3D.

class PointCloud(dtcc.Geometry)[source]

Represents a set of points in 3D.

class Surface(dtcc.Geometry)[source]

Represents a planar surface in 3D.

class Transform(dtcc_core.model.model.Model)[source]

Represents an affine transformation to a global coordinate system.

class VolumeGrid(dtcc.Geometry)[source]

Represents a structured hexahedral grid in 3D.

class VolumeMesh(dtcc.Geometry)[source]

Represents an unstructured tetrahedral mesh in 3D.

class LineString(dtcc.Geometry)[source]
class MultiLineString(dtcc.Geometry)[source]
class Field(dtcc_core.model.model.Model)[source]

Represents a field (scalar or vector) defined on a geometry.

class Raster(dtcc_core.model.model.Model)[source]

A georeferenced n-dimensional raster of values.

Free functions

error(message)
critical(message)
init_logging(name='dtcc-core')[source]

Initialize logging for given package

get_logger(name='dtcc-core')[source]

Get logger for given package

debug(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘DEBUG’.

info(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘INFO’.

warning(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘WARNING’.

load_mesh(path)[source]
save_mesh(mesh, path)
save_volume_mesh(mesh, path)
load_volume_mesh(path)[source]
load_pointcloud(path, ...) PointCloud

Load a LAS/LAZ/CSV file or a directory containing LAS/LAZ/CSV files as a PointCloud object.

save_pointcloud(pointcloud, outfile)
load_raster(path, delimiter=',') Raster

Load a raster file as a Raster object.

save_raster(raster: Raster, path)

Save a Raster object to a file.

load_city(path)
load_footprints(...) [<class 'dtcc_core.model.object.building.Building'>]

Load the buildings from a supported file and return a City object.

save_footprints(city, filename)

Save the buildings in a City object to a supported file.

load_cityjson(cityjson_path: str | dict) City

Load a CityJSON file into a City object.

load_roadnetwork(filename, id_field='id', ...) RoadNetwork
extract_roof_points(...) list[Building][source]
compute_building_heights(buildings, ...) list[Building][source]
build_lod1_buildings(...) list[Building][source]

Build the LOD1 representation of the given buildings.

build_city_mesh(city: City, ...) Mesh[source]

Build a mesh from the surfaces of the buildings in the city.

build_terrain_mesh(data: PointCloud | Raster, ...) Mesh[source]
build_terrain_raster(pc: PointCloud, cell_size, ...) Raster[source]

Rasterize a point cloud into a Raster object.

flat_terrain(height, bounds: Bounds) Terrain[source]

Create a flat terrain.

merge_building_footprints(buildings, ...) list[Building][source]
simplify_building_footprints(buildings, ...) list[Building][source]
fix_building_footprint_clearance(buildings, ...) list[Building][source]
split_footprint_walls(buildings, ...) list[Building][source]
merge_buildings(city: City, max_distance=0.15, ...) City[source]

Merge buildings that are close together.

fix_building_clearance(city: City, target_clearance, ...) City[source]

Fix the clearance of the footprints in the building models. After running each building should have a minimum_clearance of tol meters and a minimum angle between each edge of min_angle degrees.

clean_building_surfaces(city: City, lod: GeometryType, ...) City[source]
building_heights_from_pointcloud(...) list[Building][source]
download_data(data_type: str, provider: str, bounds: Bounds, ...)[source]

A wrapper for downloading data, but with a dummy step for actual file transfer. If provider=’dtcc’, we do an SSH-based authentication check and then simulate a download. If provider=’OSM’, we just do a dummy download with no SSH.

download_pointcloud(bounds: Bounds, provider='dtcc', epsg='3006')[source]
download_footprints(bounds: Bounds, provider='dtcc', epsg='3006')[source]
download_roadnetwork(bounds: Bounds, provider='dtcc', epsg='3006')[source]
empty_cache(cache_type=None)[source]