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
26 lines (25 loc) • 1.1 kB
TypeScript
import type { FeatureCollection, GeometryObject } from 'geojson';
interface IOptions {
/**
* When it's set to `true`, the returned geojson will include all elements that meet the specified conditions in `FeatureCollection` format;
* otherwise, only the bare geometry of the first `relation` element will be returned.
* @default false
*/
completeFeature?: boolean;
/**
* When it's set to `true`, the returned geojson will include all elements with tags (i.e., tagged)
* until `suppressWay` changes its behavior a bit; otherwise only the unreferenced ones get returned.
* @default false
*/
renderTagged?: boolean;
/**
* When it's set to `true`, the returned `FeatureCollection` will exclude all referenced `way`s even though they are tagged;
* otherwise the features of those `way`s will be included in the resulted result as well.
* @default true
*/
excludeWay?: boolean;
}
declare function osm2geojson(osm: string | {
[k: string]: any;
}, opts?: IOptions): FeatureCollection<GeometryObject>;
export = osm2geojson;