Comparing version 2.1.0 to 2.2.0
@@ -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 |
@@ -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 @@ |
{ | ||
"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() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32967
806