Skip to content
pyautark (soon)

@urban-toolkit/autk-db


@urban-toolkit/autk-db / isVectorTable

Function: isVectorTable()

isVectorTable(table): table is OsmLayerTable | GeojsonTable | CsvTable & { type: "water" | "background" | "surface" | "parks" | "roads" | "buildings" | "points" | "polygons" | "polylines" } | UserTable & { type: "water" | "background" | "surface" | "parks" | "roads" | "buildings" | "points" | "polygons" | "polylines" }

Defined in: interfaces.ts:197

Narrows a table to vector geometry layers.

Excludes raw OSM tables, plain tabular imports, and raster tables.

Parameters

table

Table

Table metadata to inspect.

Returns

table is OsmLayerTable | GeojsonTable | CsvTable & { type: "water" | "background" | "surface" | "parks" | "roads" | "buildings" | "points" | "polygons" | "polylines" } | UserTable & { type: "water" | "background" | "surface" | "parks" | "roads" | "buildings" | "points" | "polygons" | "polylines" }

true when the table has a non-raster layer type.

Throws

Never throws.

Example

ts
const vectorTables = tables.filter(isVectorTable);
console.log(vectorTables.every((table) => table.type !== 'raster')); // true

Released under the MIT License.