UNPKG

gis-tools-ts

Version:

A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.

71 lines 2.4 kB
import { Info } from './info.js'; import type { PbfReader } from 'pbf-ts'; import type { Properties, VectorFeature } from '../../geometry/index.js'; import type { InfoBlock, OSMProperties, OSMReader } from './index.js'; import type { OSMMetadata, PrimitiveBlock } from './primitive.js'; /** Linebased node reference store */ export type WayNodes = number[]; /** An intermediate vector feature where the way nodes haven't been resolved yet. */ export interface IntermediateWay { id: number; properties: OSMProperties; metadata: InfoBlock; wayNodes: WayNodes; isArea: boolean; } /** * Convert an intermediate way to a vector feature * @param way - intermediate way * @param reader - OSM reader * @returns - way vector feature */ export declare function intermediateWayToVectorFeature(way: IntermediateWay, reader: OSMReader): Promise<VectorFeature<OSMMetadata, Properties, OSMProperties> | undefined>; /** * Way Class */ export declare class Way { #private; primitiveBlock: PrimitiveBlock; reader: OSMReader; id: number; info?: Info; /** * @param primitiveBlock - the primitive block to access keys and values * @param reader - the OSM reader * @param pbf - the Protobuf object to read from */ constructor(primitiveBlock: PrimitiveBlock, reader: OSMReader, pbf: PbfReader); /** * Checks if the way is filterable or not * @returns - true if the way is filterable */ isFilterable(): boolean; /** * Access the way's properties * @returns - the way's properties */ properties(): OSMProperties; /** * Access the way's node IDs associated with this way * @returns - the way's nodes */ nodeRefs(): number[]; /** * Checks if the way has a key-value pair (value optional) * @param key - the key * @param val - the value * @returns - true if the way has the key and value */ hasKeyValue(key: string, val?: string): boolean; /** * Checks if the way is an area based on it's key-value pairs * @returns - true if the way is an area */ isArea(): boolean; /** * Converts the way to an intermediate vector feature (way's nodes have not been parsed) * @returns - the way as an intermediate vector feature */ toVectorFeature(): undefined | IntermediateWay; } //# sourceMappingURL=way.d.ts.map