After rounds of refactoring and feature enhancement, this package has been upgraded to osm2geojson-lite. Important changes include: 1) support the conversion from OSM/Overpass JSON; 2) support the exportation of any unreferenced geographic elements. From now on, the author's maintenance efforts will be shifted to this new package with richer features, so if applicable please stay with me by migrating your projects to
$ npm install xml2geojson-lite
const xml2geojson = ;let geojson = ;
let geojson = ;
Converts OSM XML data to GeoJSON.
osm_xml: the OSM XML data, in String.
opts?: optional - the options object, right now only supports allFeatures option, when it is set to
true, it will return a comprehensive GeoJSON object as
FeatureCollectionrather than a bare
Please fasten your seat-belt before run the test script (node test.js)
- No 3rd party dependency
Written in 2018 by tibetty email@example.com