Giter Club home page Giter Club logo

osm-adiff-parser's Introduction

osm-adiff-parser

Parsers OSM augmented diff (.osc) and returns elements grouped by changeset ID. Based on the parser in planet-stream.

Setup

  • npm install osm-adiff-parser

Usage

var parser = require('osm-adiff-parser');

// to filter certain changesets

parser(xml, ['46613588', '46613589'], function(err,data) {
    console.log(data);
});

// to get all changesets

parser(xml, null, function(err,data) {
    console.log(data);
});

osm-adiff-parser's People

Contributors

ajithranka avatar geohacker avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osm-adiff-parser's Issues

Ways are assigned to incorrect changesets when their nodes move

When a node (501609671) associated with a way (41113036) is moved, the way appears in Overpass's augmented diff output as though it changed (which its geometry did), e.g.

<action type="modify">
<old>
  <way id="41113036" version="1" timestamp="2009-09-19T10:30:53Z" changeset="2532203" uid="110076" us
    <bounds minlat="41.8432372" minlon="12.6208508" maxlat="41.8432812" maxlon="12.6210011"/>
    <nd ref="501609670" lat="41.8432812" lon="12.6210011"/>
    <nd ref="501609671" lat="41.8432372" lon="12.6208508"/>
    <tag k="highway" v="service"/>
  </way>
</old>
<new>
  <way id="41113036" version="1" timestamp="2009-09-19T10:30:53Z" changeset="2532203" uid="110076" us
    <bounds minlat="41.8432288" minlon="12.6208433" maxlat="41.8432812" maxlon="12.6210011"/>
    <nd ref="501609670" lat="41.8432812" lon="12.6210011"/>
    <nd ref="501609671" lat="41.8432288" lon="12.6208433"/>
    <tag k="highway" v="service"/>
  </way>
</new>
</action>

However, the only changeset visible in this fragment (2532203) is the changeset in which the way was originally created. As a result, osm-adiff-parser credits the original changeset (2532203) with the modification rather than the changeset which actually modified the geometry (54135745, per http://www.openstreetmap.org/node/501609671).

The clue here that the way shouldn't be credited to its original changeset is that version didn't change. Given that, it becomes necessary to look through the current augmented diff for entries corresponding to any of the referenced ways and use the associated changeset id as the target.

This is touched on indirectly by drolbr/Overpass-API#407. Addressing the problem upstream would likely involve including some indicator about which component was modified such as additional metadata for each nd ref (version, changeset, timestamp, etc.).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.