osm2geojson-lite
Version:
a lightweight yet faster osm (either in xml or in json formats) to geojson convertor - 4x faster than xmldom + osmtogeojson in most situations - implemented in pure JavaScript without any 3rd party dependency
61 lines (60 loc) • 1.91 kB
TypeScript
import { Way } from './osmobjs';
export declare function purgeProps(obj: {
[k: string]: any;
}, blacklist: string[]): {
[k: string]: any;
};
export declare function mergeProps(obj1: {
[k: string]: any;
}, obj2: {
[k: string]: any;
}): {
[k: string]: any;
};
export declare function addPropToFeature(f: {
[k: string]: any;
}, k: string, v: any): void;
export declare function addPropToFeatures(fs: Array<{
[k: string]: any;
}>, k: string, v: any): void;
export declare const first: <T>(a: T[]) => T;
export declare const last: <T>(a: T[]) => T;
export declare const coordsToKey: <T>(a: T[]) => string;
export declare function addToMap<T>(m: {
[k: string]: T[];
}, k: string, v: T): void;
export declare function removeFromMap<T>(m: {
[k: string]: T[];
}, k: string, v: T): void;
export declare function getFirstFromMap<T>(m: {
[k: string]: T[];
}, k: string): T | null;
export declare const isRing: (a: number[][]) => boolean;
export declare const ringDirection: (a: number[][], xIdx?: number, yIdx?: number) => string;
export declare const ptInsidePolygon: (pt: number[], polygon: number[][], xIdx?: number, yIdx?: number) => boolean;
export declare const strToFloat: (el: any[] | string) => any;
export declare class LateBinder {
private container;
private valueFunc;
private ctx;
private args;
constructor(container: any[] | {
[k: string]: any;
}, valueFunc: (...args: any[]) => any, ctx: any, args: any[]);
bind(): void;
}
export declare class RefElements extends Map {
private binders;
constructor();
add(k: string, v: any): void;
addBinder(binder: LateBinder): void;
bindAll(): void;
}
export declare class WayCollection extends Array {
private firstMap;
private lastMap;
constructor();
addWay(way: Way): void;
toStrings(): number[][][];
toRings(direction: string): number[][][];
}