alsdb.ALSDatabase#

class alsdb.ALSDatabase(storage_type: str = 'local', uri: str | None = None, schema_cfg: TileDBSchemaConfig | None = None, url: str | None = None, region: str = 'eu-central-1', credentials: Dict[str, str] | None = None, s3_config_overrides: Dict[str, str] | None = None)[source]#

Write interface for the ALS TileDB array.

Inherits storage / context management from TileDBProvider. Creates the TileDB array on first write if it does not exist, then appends subsequent tiles as new fragments.

The array uses three dimensions — X, Y (UTM metres) and Year (int16) — so repeated surveys of the same tile in different years are stored and queryable independently.

An ingestion manifest is kept in the array’s metadata (key "ingestion_manifest"). Each entry records the filename, acquisition year, point count, status ("ok" / "failed"), and UTC timestamp. Re-ingesting a file that is already marked "ok" is a no-op unless overwrite=True is passed.

Parameters:
  • storage_type"local" or "s3".

  • uri – Array URI (filesystem path or s3:// URI).

  • schema_cfg – Domain and tile-size configuration. Uses sensible UTM Zone 30N defaults when not provided.

  • url – S3 endpoint URL (required for S3 storage).

  • region – S3 region.

  • credentials – S3 credentials dict (keys: "AccessKeyId", "SecretAccessKey", "SessionToken").

  • s3_config_overrides – Raw TileDB vfs.s3.* overrides.

__init__(storage_type: str = 'local', uri: str | None = None, schema_cfg: TileDBSchemaConfig | None = None, url: str | None = None, region: str = 'eu-central-1', credentials: Dict[str, str] | None = None, s3_config_overrides: Dict[str, str] | None = None) None[source]#

Methods

__init__([storage_type, uri, schema_cfg, ...])

array_exists()

Return True if the TileDB array already exists.

consolidate([mode, fragment_size, ...])

Consolidate and vacuum the TileDB array.

create([overwrite, crs])

Explicitly create the TileDB array.

fragment_count()

Return the current number of fragments in the array.

ingest(laz_path[, chunk_size, ...])

Ingest a single LAZ tile into the TileDB array.

ingest_many(laz_paths[, chunk_size, ...])

Ingest a list of LAZ files, skipping already-ingested ones.

list_ingested()

Return a list of manifest entries, sorted by timestamp.

load_manifest()

Return the ingestion manifest stored in array metadata.

open(mode)

Open the TileDB array in the given mode ("r" or "w").

stored_crs()

Return the CRS stored in array metadata, or None if not set.

write(x, y, year, attrs[, crs])

Append a batch of points to the TileDB array.

Attributes

schema

Return (and cache) the array schema.