s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
97 lines • 3.27 kB
TypeScript
import { DenseInfo, Info } from './info';
import type { OSMReader } from '.';
import type { PrimitiveBlock } from './primitive';
import type { Pbf as Protobuf } from '../../readers/protobuf';
import type { Metadata } from './primitive';
import type { BBox, VectorFeature, VectorPoint } from '../../geometry';
/**
* Merge an associated relation if it exists
* @param feature - the node vector feature
* @param reader - the OSM reader
*/
export declare function mergeRelationIfExists(feature: VectorFeature<Metadata>, reader: OSMReader): Promise<void>;
/**
* Node class
* contains a single node.
*/
export declare class Node {
#private;
primitiveBlock: PrimitiveBlock;
reader: OSMReader;
id: number;
info?: Info;
lat: number;
lon: number;
/**
* @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);
/**
* Create a node from a dense representation
* @param id - the node id
* @param info - the node info
* @param keys - list of keys
* @param vals - list of values
* @param lat - the latitude
* @param lon - the longitude
* @param pb - the primitive block to access keys and values
* @param reader - the OSM reader
* @returns - the node
*/
static fromDense(id: number, info: Info | undefined, keys: number[], vals: number[], lat: number, lon: number, pb: PrimitiveBlock, reader: OSMReader): Node;
/**
* Check if the node is filterable
* @returns - true if the node is filterable
*/
isFilterable(): boolean;
/**
* Get the properties of the node
* @returns - the properties
*/
properties(): Record<string, string>;
/**
* Gain access to the nodes geometry
* @returns - the vector feature
*/
toVectorGeometry(): VectorPoint;
/**
* Convert the node to a vector feature
* @returns - the vector feature
*/
toVectorFeature(): VectorFeature<Metadata>;
/** @returns - the bounding box for this node */
buildBBox(): BBox;
}
/**
* Used to densly represent a sequence of nodes that do not have any tags.
* We represent these nodes columnwise as five columns: ID's, lats, and
* lons, all delta coded. When metadata is not omitted,
* We encode keys & vals for all nodes as a single array of integers
* containing key-stringid and val-stringid, using a stringid of 0 as a
* delimiter between nodes.
* ( (<keyid> <valid>)* '0' )*
*/
export declare class DenseNodes {
#private;
primitiveBlock: PrimitiveBlock;
reader: OSMReader;
ids: number[];
denseinfo?: DenseInfo;
lats: number[];
lons: number[];
keysVals: number[];
/**
* @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);
/**
* Access the nodes in this block
* @returns - the nodes in this block
*/
nodes(): Node[];
}
//# sourceMappingURL=node.d.ts.map