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

@osmcha/osmchange-parser

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@osmcha/osmchange-parser

Parse OpenStreetMap OsmChange XML documents

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

osmchange-parser

Parse OpenStreetMap OsmChange XML documents into plain JavaScript objects.

Installation

npm install @osmcha/osmchange-parser

Usage

import parseOsmChangeXML from "@osmcha/osmchange-parser";
let changeset = await parseOsmChangeXML(xmlString);

Example input & output

Input:

<?xml version="1.0" encoding="UTF-8"?>
<osmChange version="0.6" generator="openstreetmap-cgimap 2.0.1 (1848 spike-07.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
 <modify>
  <node id="2523603738" visible="true" version="3" changeset="155530622" timestamp="2024-08-20T21:36:16Z" user="jake-low" uid="8794039" lat="47.6647943" lon="-121.2881568">
   <tag k="highway" v="trailhead"/>
   <tag k="name" v="Necklace Valley Trailhead"/>
   <tag k="operator" v="US Forest Service"/>
   <tag k="website" v="https://www.fs.usda.gov/recarea/mbs/recarea/?recid=80228"/>
  </node>
 </modify>
</osmChange>

Output:

{
  "version": "0.6",
  "generator": "openstreetmap-cgimap 2.0.1 (1848 spike-07.openstreetmap.org)",
  "copyright": "OpenStreetMap and contributors",
  "attribution": "http://www.openstreetmap.org/copyright",
  "license": "http://opendatacommons.org/licenses/odbl/1-0/",
  "modify": [
    {
      "id": 2523603738,
      "visible": true,
      "version": 3,
      "changeset": 155530622,
      "timestamp": "2024-08-20T21:36:16Z",
      "user": "jake-low",
      "uid": 8794039,
      "lat": 47.6647943,
      "lon": -121.2881568,
      "type": "node",
      "tags": {
        "highway": "trailhead",
        "name": "Necklace Valley Trailhead",
        "operator": "US Forest Service",
        "website": "https://www.fs.usda.gov/recarea/mbs/recarea/?recid=80228"
      }
    }
  ]
}

Keywords

FAQs

Package last updated on 09 Sep 2024

Did you know?

Socket

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.

Install

Related posts

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