Skip to content

@urban-toolkit/autk-db


@urban-toolkit/autk-db / isVectorTable

Function: isVectorTable() ​

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

Defined in: interfaces.ts:201

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: "background" | "surface" | "parks" | "water" | "roads" | "buildings" | "points" | "polygons" | "polylines" } | UserTable & { type: "background" | "surface" | "parks" | "water" | "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.