UNPKG

s2-tools

Version:

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

72 lines 2.38 kB
import { Info } from './info'; import type { Metadata } from './primitive'; import type { PrimitiveBlock } from './primitive'; import type { Pbf as Protobuf } from '../../readers/protobuf'; import type { InfoBlock, OSMReader } from '.'; import type { Properties, VectorFeature } from '../../geometry'; /** 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: Properties; 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<Metadata> | 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: Protobuf); /** * 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(): Record<string, string>; /** * 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