![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
tiny-osmpbf
Advanced tools
A lightweight parsing library for the osm.pbf format used for OpenStreetMap raw data. Written in pure javascript. Works in nodejs and the browser.
Contrary to other osm pbf parsing libraries, tiny-osmpbf isn't purely optimized for speed, but mainly towards ease-of-use and small code footprint (it's less than 16kB minified and gzipped).
This is mainly achived by using two great alternatives to the typical go-to libraries for parsing pbf and decompressing zlib deflated data, namely mapbox's pbf library and tiny-inflate (a port of Joergen Ibsen's tiny inflate for C).
The second main difference is the synchronous API, which makes it easier to use the library (e.g. when integrating it into existing synchronous workflows). This comes at the cost of having to load the whole osmpbf input data into memory, so keep that in mind in case you're planning to parse larger files.
install via npm install --save tiny-osmpbf
Then
var tinyosmpbf = require('tiny-osmpbf');
var dataBuffer = … // e.g. from fs.readFileSync(…)
var osmData = tinyosmpbf(dataBuffer);
result = tinyosmpbf(dataBuffer [, handler])
dataBuffer
– the pbf data to be parsedhandler
– a callback function that is called for each parsed osm element (node, way and relation), optionalresult
– an object in JSON format containing both the metadata and osm elements from the parsed pbf file (if a custom handler is defined, the osm elements are not included here again)The returned data is in the OSM-JSON format used by the Overpass API. For example:
{
"version": 0.6,
"generator": "Overpass API prototype",
"osm3s": {
"timestamp_osm_base": "2016-05-01T00:00:00Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [
{
"type": "node",
"id": 251429,
"lat": 51.0326209,
"lon": -0.9538873,
"tags": {},
"version": 3,
"timestamp": "2010-10-31T20:48:14Z",
"changeset": 6246399,
"uid": 4745,
"user": "Philip"
},
…
{
"type": "way",
"id": 666,
"nodes": [
251714,
…
],
"tags": {
"designation": "public_bridleway",
"highway": "path"
},
"version": 10,
"timestamp": "2016-03-20T14:37:06Z",
"changeset": 37956794,
"uid": 873940,
"user": "Mike Baggaley"
}
]
}
FAQs
smallest osm.pbf parser
The npm package tiny-osmpbf receives a total of 3,138 weekly downloads. As such, tiny-osmpbf popularity was classified as popular.
We found that tiny-osmpbf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.