
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
osm2geojson-ultra
Advanced tools
a faster & more complete OSM & Overpass (either in xml or in json formats) to geojson convertor - 4x faster than xmldom + osmtogeojson in most situations - implemented in TypeScript with txml for XML parsing
A faster & more complete convertor for OSM & Overpass data in XML or JSON formats to GeoJSON - much faster (the more complex the data source is, the more performance advantages it posesses) than osmtogeojson in most situations and faster than osm2geojson-lite - implemented in TypeScript using txml to parse XML.
This project was forked from osm2geojson-lite to add support for more overpass geometry output types and to use a different XML parser.
local
convert
, and
make
out center;
outputid
, type
, and other non-tag properties are prefixed with @
)elementId
optionInstallation:
$ npm install osm2geojson-ultra
Usage:
import osm2geojson from 'osm2geojson-ultra';
let geojson = osm2geojson(osm, opts);
<script type="module">
import osm2geojson from 'https://esm.sh/osm2geojson-ultra';
let geojson = osm2geojson(osm, opts);
</script>
osm2geojson(osm, opts)
Converts OSM data (XML/JSON) to GeoJSON.
osm
: the OSM XML data in String, or OSM/Overpass JSON as object or in Stringopts?
: optional, the options object, right now supports below properties/fields:
elementId
: the default value is undefined
. When undefined, all tagged elements are
returned. When it is set to an OSM element ID in the form of type/id, eg: "way/123"
then a
only that feature is returned.osmtogeojson
by the one of this library$ cd test
$ npm run bench
==========xml processing performance results==========
---processing zhucheng.osm---
-> 41ms was taken for 100 rounds
---processing hebei.osm---
-> 372ms was taken for 100 rounds
---processing tokyodo.osm---
-> 882ms was taken for 100 rounds
---processing usa.osm---
-> 10778ms was taken for 100 rounds
==========json processing performance results==========
---processing zhucheng.json---
-> 8ms was taken for 100 rounds
---processing hebei.json---
-> 105ms was taken for 100 rounds
---processing tokyodo.json---
-> 322ms was taken for 100 rounds
---processing usa.json---
-> 5464ms was taken for 100 rounds
==========xml processing performance results==========
---processing zhucheng.osm---
-> 55ms was taken for 100 rounds
---processing hebei.osm---
-> 554ms was taken for 100 rounds
---processing tokyodo.osm---
-> 1188ms was taken for 100 rounds
---processing usa.osm---
-> 12770ms was taken for 100 rounds
==========json processing performance results==========
---processing zhucheng.json---
-> 7ms was taken for 100 rounds
---processing hebei.json---
-> 104ms was taken for 100 rounds
---processing tokyodo.json---
-> 320ms was taken for 100 rounds
---processing usa.json---
-> 5554ms was taken for 100 rounds
==========xml processing performance results==========
---processing zhucheng.osm---
-> 179ms was taken for 100 rounds
---processing hebei.osm---
-> 3488ms was taken for 100 rounds
---processing tokyodo.osm---
-> 4255ms was taken for 100 rounds
---processing usa.osm---
-> 39755ms was taken for 100 rounds
==========json processing performance results==========
---processing zhucheng.json---
-> 34ms was taken for 100 rounds
---processing hebei.json---
-> 2086ms was taken for 100 rounds
---processing tokyodo.json---
-> 1040ms was taken for 100 rounds
---processing usa.json---
-> 11273ms was taken for 100 rounds
You can copy the converted results to geojsonlint for the correctness validation. Up until now, osm2geojson-lite
behaves pretty well with all the samples (also quite representative) in the data
subfolers under test
and bench
directories, which also outperforms osmtogeojson
.
The client side example shipped along with this package, index.html
- due to CORS limitation, the direct post to geojsonlint is blocked, so there's a "copy to clipboard" button for you to ease the validation.
ES 2019
MIT
FAQs
a faster & more complete OSM & Overpass (either in xml or in json formats) to geojson convertor - 4x faster than xmldom + osmtogeojson in most situations - implemented in TypeScript with txml for XML parsing
We found that osm2geojson-ultra demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.