Expand description
Constructors§
Properties§
Methods§
Source§buildHeatmap(params: BuildHeatmapParams): Promise<Table>
buildHeatmap(params: BuildHeatmapParams): Promise<Table>
Builds a heatmap from spatial data by creating a grid and aggregating values. The heatmap is generated by creating a grid over the bounding box and aggregating values from the source table into each grid cell.
Source§getBoundingBoxFromLayer(layerName: string): Promise<BoundingBox>
getBoundingBoxFromLayer(layerName: string): Promise<BoundingBox>
Retrieves the bounding box of a layer by its table name.
Source§getLayer(
layerTableName: string,
): Promise<FeatureCollection<Geometry, GeoJsonProperties>>
getLayer(
layerTableName: string,
): Promise<FeatureCollection<Geometry, GeoJsonProperties>>
Retrieves the GeoJSON representation of a layer by its table name. The returned FeatureCollection will include a bbox property with the layer's bounding box.
Source§getLayerTables(): (LayerTable | CustomLayerTable)[]
getLayerTables(): (LayerTable | CustomLayerTable)[]
Retrieves all layer tables (LayerTable and CustomLayerTable) from the loaded tables.
Source§getOsmBoundingBox(): [number, number, number, number] | null
getOsmBoundingBox(): [number, number, number, number] | null
Retrieves the bounding box of the OSM data loaded from the Overpass API.
Source§init(): Promise<void>
init(): Promise<void>
Initializes the SpatialDb instance by loading the DuckDB database and setting up use cases.
Source§loadCsv(params: Params): Promise<CsvTable>
loadCsv(params: Params): Promise<CsvTable>
Loads a CSV file into the database and returns the created CsvTable.
Source§loadCustomLayer(params: Params): Promise<CustomLayerTable>
loadCustomLayer(params: Params): Promise<CustomLayerTable>
Loads a custom layer from a GeoJSON file and returns the created CustomLayerTable. If OSM bounding box is available, it will be automatically applied to crop the layer.
Source§loadGridLayer(params: LoadGridLayerParams): Promise<GridLayerTable>
loadGridLayer(params: LoadGridLayerParams): Promise<GridLayerTable>
Loads a grid layer and returns the created GridLayerTable. If no bounding box is provided in params, the OSM bounding box will be used if available.
Source§loadJson(params: Params): Promise<JsonTable>
loadJson(params: Params): Promise<JsonTable>
Loads a JSON file into the database and returns the created JsonTable.
Source§loadLayer(params: Params): Promise<LayerTable>
loadLayer(params: Params): Promise<LayerTable>
Loads a layer from an OSM input table and returns the created LayerTable.
Source§loadOsmFromOverpassApi(params: Params): Promise<void>
loadOsmFromOverpassApi(params: Params): Promise<void>
Loads OSM data from the Overpass API and optionally loads layers based on the provided parameters. When autoLoadLayers is enabled, this method will automatically extract and process specific layers (e.g., buildings, roads, surface) from the OSM data, and optionally polygonize the surface layer.
SpatialDb class provides methods to interact with a DuckDB database for spatial data operations.
It allows loading OSM data, CSV, JSON, custom layers, and grid layers, as well as performing spatial joins and raw queries. It also provides methods to retrieve layer data and bounding boxes.