Skip to main content

flywave-terrain-datasource

Home > @flywave/flywave-terrain-datasource

flywave-terrain-datasource package

Classes

Class

Description

CesiumWorldTerrainSource

Implementation of a terrain source for Cesium World Terrain data

This class simplifies access to Cesium World Terrain by automatically handling the authentication flow with Cesium Ion access tokens. It extends the standard QuantizedTerrainSource with Cesium-specific configuration options.

The source provides efficient storage and transmission of terrain data by using a variable level of detail (LOD) approach that adapts to the viewer's distance from the terrain surface.

DEMTerrainSource

DEM (Digital Elevation Model) terrain data source

This class implements a terrain data source that loads and renders DEM data for 3D terrain visualization. It extends the base TerrainSource class and provides specialized functionality for handling digital elevation models.

The source supports various DEM formats and can load data from different providers using the DemTileProvider. It also provides elevation and elevation range services for querying height information at specific geographic coordinates.

GroundModification

Represents a ground modification with spatial properties and terrain data

This class encapsulates a ground modification polygon along with its associated properties and methods for interacting with the terrain system. It provides a high-level interface for managing ground modifications.

GroundModificationManager

Manages ground modification polygons with spatial indexing and event system

This class handles the creation, modification, and querying of ground modifications such as excavations and elevations. It maintains spatial indexing for efficient querying and provides events for change notifications.

The manager supports various types of geographic areas including bounding boxes, polygons, and line strings, and provides methods for spatial queries like finding modifications that intersect with a given area or contain a specific point.

QuantizedStratumSource

Implementation of a terrain source for quantized stratum data

This class handles the creation and configuration of quantized stratum sources, providing specialized terrain data with geological stratum information.

Stratum data provides enhanced elevation accuracy and detail for specific regions by incorporating geological layer information into the terrain model.

QuantizedTerrainSource

Implementation of a terrain source for quantized mesh terrain data

This class handles the creation and configuration of quantized terrain sources, including water masks, vertex normals, and metadata as requested.

Quantized mesh terrain provides efficient storage and transmission of terrain data by using a variable level of detail (LOD) approach that adapts to the viewer's distance from the terrain surface.

TerrainTileDecoder

Terrain tile decoder implementation This class handles decoding of various terrain data formats in a web worker context It supports multiple terrain formats including quantized meshes, stratum tiles, and DEM data

The decoder implements the ITileDecoder interface which is part of the mapview decoder system

TerrainTileDecoderService

Service class for managing the terrain tile decoder This class registers the TerrainTileDecoder with the worker service manager to make it available for processing terrain tiles in web workers

Functions

Function

Description

deserializeGroundModificationPolygon(serialized)

Deserializes a SerializedGroundModificationPolygon back to a GroundModificationPolygon

Reconstructs geometry objects from JSON representations. This is the inverse operation of serializeGroundModificationPolygon and is used when loading modifications from storage or receiving them from web workers.

serializeGroundModificationPolygon(polygon)

Serializes a GroundModificationPolygon to a format suitable for storage/transfer

Converts geometry objects to JSON representations for efficient transmission between web workers and persistent storage. This is necessary because complex geometry objects cannot be directly serialized.

Interfaces

Interface

Description

GroundModificationEventParams

Parameters for ground modification events

This interface defines the structure of events that are dispatched when ground modifications are added, removed, updated, or cleared. These events provide detailed information about what changed and where, allowing other parts of the system to react appropriately.

GroundModificationManagerOptions

Options for configuring the GroundModificationManager

This interface defines optional configuration parameters that can be used to customize the behavior of the GroundModificationManager.

GroundModificationOptions

Kriging interpolation parameter configuration

This interface defines the parameters used for kriging interpolation in ground modification operations. Kriging is a geostatistical method for spatial interpolation that provides optimal predictions.

GroundModificationPolygon

Represents a ground modification polygon with spatial properties

Used to define areas where terrain height should be modified. This interface provides a rich set of properties for defining complex terrain modifications with spatial boundaries.

GroundModificationType

Ground modification type (composite type)

Combines vertex source and height operation to define how terrain is modified. This composite type allows for flexible terrain modification strategies.

SerializedGroundModificationPolygon

Serialized format for worker communication and storage

This format is optimized for transmission between web workers and persistent storage. It uses JSON-compatible types to ensure efficient serialization and deserialization.

Type Aliases

Type Alias

Description

DecodedTerrainTile

Represents a decoded terrain tile with additional terrain data This extends the base DecodedTile interface to include specific terrain data that can be one of several formats: - QuantizedTerrainMeshData: For quantized mesh terrain - StratumTileData: For stratum-based terrain - DEMData: For digital elevation model data - ImageBitmap: For raster terrain data

DemTerrainSourceOptions

Configuration options for DEM terrain source

This type extends the base TerrainSourceOptions but omits the dataProvider property since it will be automatically created by the DEMTerrainSource. It adds specific properties for DEM data sources such as the source URL or description and encoding format.

HeightOperationType

Height operation mode type

Defines how the height modification is applied to the base terrain. Different operations produce different visual effects and use cases.

VertexSourceType

Vertex data source type

Determines where the vertex data originates from when modifying terrain. This affects how the modification is applied to the base terrain data.