Gathering detailed insights and metrics for @osmcha/osm-adiff-parser
Gathering detailed insights and metrics for @osmcha/osm-adiff-parser
Gathering detailed insights and metrics for @osmcha/osm-adiff-parser
Gathering detailed insights and metrics for @osmcha/osm-adiff-parser
Parse OSM augmented diffs and create JSON representation of changesets
npm install @osmcha/osm-adiff-parser
Typescript
Module System
Node Version
NPM Version
71.1
Supply Chain
99.3
Quality
79.9
Maintenance
100
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
448
Last Day
2
Last Week
8
Last Month
34
Last Year
448
BSD-3-Clause License
40 Commits
1 Watchers
1 Branches
3 Contributors
Updated on Mar 31, 2025
Minified
Minified + Gzipped
Latest Version
3.1.0
Package Id
@osmcha/osm-adiff-parser@3.1.0
Unpacked Size
12.66 kB
Size
3.99 kB
File Count
6
NPM Version
10.8.2
Node Version
22.7.0
Published on
Mar 31, 2025
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
60%
8
Compared to previous week
Last Month
-42.4%
34
Compared to previous month
Last Year
0%
448
Compared to previous year
Parses OSM augmented diff XML and returns a plain JS object representing the diff.
npm install @osmcha/osm-adiff-parser
1import parser from 'osm-adiff-parser'; 2let adiff = await parser(augmentedDiffXmlString);
Input (an augmented diff of a simple changeset which added a couple of tags to an existing node)
1<osm version="0.6" generator="Overpass API not used, but achavi detects it at the start of string; OSMExpress/python/examples/augmented_diff.py"> 2 <note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note> 3 <action type="modify"> 4 <old> 5 <node id="2523603738" version="2" user="TheRomanP" uid="3844185" timestamp="2024-06-05T13:51:12Z" changeset="152289357" lon="-121.2881568" lat="47.6647943"> 6 <tag k="highway" v="trailhead" /> 7 </node> 8 </old> 9 <new> 10 <node id="2523603738" version="3" timestamp="2024-08-20T21:36:16Z" uid="8794039" user="jake-low" changeset="155530622" lat="47.6647943" lon="-121.2881568"> 11 <tag k="highway" v="trailhead" /> 12 <tag k="name" v="Necklace Valley Trailhead" /> 13 <tag k="operator" v="US Forest Service" /> 14 <tag k="website" v="https://www.fs.usda.gov/recarea/mbs/recarea/?recid=80228" /> 15 </node> 16 </new> 17 </action> 18</osm>
Output
1{ 2 "actions": [ 3 { 4 "type": "modify", 5 "old": { 6 "type": "node", 7 "id": 2523603738, 8 "version": 2, 9 "user": "TheRomanP", 10 "uid": 3844185, 11 "timestamp": "2024-06-05T13:51:12Z", 12 "changeset": 152289357, 13 "lon": -121.2881568, 14 "lat": 47.6647943, 15 "tags": { 16 "highway": "trailhead" 17 } 18 }, 19 "new": { 20 "type": "node", 21 "id": 2523603738, 22 "version": 3, 23 "timestamp": "2024-08-20T21:36:16Z", 24 "uid": 8794039, 25 "user": "jake-low", 26 "changeset": 155530622, 27 "lat": 47.6647943, 28 "lon": -121.2881568, 29 "tags": { 30 "highway": "trailhead", 31 "name": "Necklace Valley Trailhead", 32 "operator": "US Forest Service", 33 "website": "https://www.fs.usda.gov/recarea/mbs/recarea/?recid=80228" 34 } 35 } 36 } 37 ], 38 "note": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL." 39}
This package also provides a CLI tool which reads augmented diff XML from stdin and writes the parsed representation to stdout as JSON.
$ osm-adiff-parser --help
osm-adiff-parser v3.1.0
Convert OSM augmented diff XML to a JSON representation
Usage:
osm-adiff-parser [options] < input.xml > output.json
Options:
-h, --help Show this help message
-v, --version Show version number
This package is a fork of mapbox/osm-adiff-parser which is no longer maintained. Version 2.0.0 of @osmcha/osm-adiff-parser
contains breaking API changes compared to version 1.1.0 of osm-adiff-parser
. See the CHANGELOG for more details.
No vulnerabilities found.
No security vulnerabilities found.