Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

osm2json

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osm2json - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

6

CHANGELOG.md

@@ -5,2 +5,6 @@ # Change Log

## [2.2.0] - 2017-09-08
### Added
- Ability to parse multiple docs [#3](https://github.com/digidem/osm2json/pull/3)
## [2.1.0] - 2016-08-23

@@ -33,2 +37,4 @@ ### Added

[2.2.0]: https://github.com/digidem/osm2json/compare/v2.1.0...v2.2.0
[2.1.0]: https://github.com/digidem/osm2json/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/digidem/osm2json/compare/v1.2.0...v2.0.0

@@ -35,0 +41,0 @@ [1.2.0]: https://github.com/digidem/osm2json/compare/v1.1.0...v1.2.0

5

lib/osm2json.js

@@ -40,3 +40,3 @@ /**

attributes: ['id', 'user', 'uid', 'created_at', 'closed_at', 'open',
'min_lat', 'min_lon', 'max_lat', 'max_lon', 'comments_count'],
'min_lat', 'min_lon', 'max_lat', 'max_lon', 'comments_count'],
children: ['tag']

@@ -98,2 +98,5 @@ },

Transform.call(this, { readableObjectMode: true })
// seed the parser so it can handle multiple roots
this.parser.write('<root>')
}

@@ -100,0 +103,0 @@

2

package.json
{
"name": "osm2json",
"version": "2.1.0",
"version": "2.2.0",
"description": "Converts an OSM XML file to OSM JSON objects as a transform stream",

@@ -5,0 +5,0 @@ "main": "lib/osm2json.js",

@@ -119,1 +119,20 @@ var test = require('tape')

})
test('multiple documents', function (t) {
var expected = require('./output_osmChange.json').concat([
{ action: 'delete', changeset: 42, id: 12, lat: 1, lon: 2, type: 'node', version: 1, ifUnused: true },
{ action: 'delete', changeset: 42, id: 34, lat: 3, lon: 4, type: 'node', version: 1 }
])
var parser = new Osm2Json()
var rs1 = fs.readFileSync(path.join(__dirname, 'osmChange.xml'))
var rs2 = fs.readFileSync(path.join(__dirname, 'osmChange_ifunused.xml'))
parser.pipe(concat(function (data) {
t.deepEqual(data, expected)
t.end()
}))
parser.write(rs1)
parser.write(rs2)
parser.end()
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc