Session#

Session is the headless workspace that backs both the mosaic-pipeline CLI and MosaicData. It owns two DataContainer instances (point clouds and fitted models), dispatches geometry operations through GeometryOperations, and reads or writes session archives.

The class is also re-exported at top level as mosaic.Session for scripting use.

Constructor#

Session

Headless workspace that holds geometry data and dispatches operations.

Target Resolution#

The shell and pipeline languages refer to geometries by index specifiers ("#3", "#1-5", "*", "@last"). These helpers turn specifiers into concrete Geometry objects.

Session.resolve(spec)

Resolve a target specifier to a list of Geometry objects.

Session.resolve_many(specs)

Resolve multiple specifiers, preserving order and deduplicating.

File I/O#

Session.open(filepath[, offset, scale, ...])

Load geometries from a file.

Session.save(geometries, filepath, **kwargs)

Export geometries to a file.

Session.save_session(filepath[, sections])

Save session state to filepath.

Session.load_session(filepath[, persist])

Restore session state from a session file.

Operations#

Every registered operation in GeometryOperations is dispatched through apply(). Per-geometry scalar properties (volume, surface area, …) are evaluated through measure().

Session.apply(operation_name, geometries, ...)

Apply a GeometryOperations function.

Session.measure(property_name, geometries, ...)

Compute a property via GeometryProperties.

Filtering and Queries#

Select geometries by predicate over their measured properties.

Session.filter(geometries, prop_name[, ...])

Filter geometries by property value range.

Session.list_filtered([type, name, group, ...])

Return matching geometries as (index, geometry) pairs.

Container Manipulation#

Session.remove(geometries)

Remove geometries from the session.

Session.merge(geometries[, name])

Merge multiple geometries into one.

Session.group(geometries, name)

Assign geometries to a named group.

Session.ungroup(geometries)

Remove geometries from their groups.

Logging#

Session.log_command(cmd_str)

Append a command string to the session log.