Giter Club home page Giter Club logo

osm-meta-util's Introduction

OSM-Meta-util

A tool to download and process OSM Metadata. This data contains the most recent annotations around a commit to OSM. Specifically, commit text, username, bounding box, creation date and number of edits. The data is downloaded from the planet repository, which contains minutely changesets to OSM.

Once installed the tool can be used to pipe in compressed XML data between two dates and output it in JSON. OSM Meta Util can also be used in polling mode and continuously download the latest data every minute.

A joint project built by Development Seed and the American Red Cross.

Installing

Clone the repo or download it as a zip. npm install the dependencies.

Running

Require osm-meta-util in your node app.

var MetaUtil = require('osm-meta-util');

The MetaUtil constructor builds a Node Stream, so you can pipe it into stream transformers or into process.stdout

There are a few ways of using the utility:

1. Downloading between two dates

The files are named in numerical order since February 28th, 2012. They're incremented every minute. You need the file name related to the start and end date. For example, 001181708 refers to http://planet.osm.org/replication/changesets/001/181/708.osm.gz, created on 2015-02-10 20:56.

var MetaUtil = require('osm-meta-util');
// Getting historical metadata, specify a start & end
var meta = MetaUtil({
     'delay': 1000,
     'start': '001181708', //2015-02-10 20:56
     'end': '001181721' //2015-02-10 21:09
 }).pipe(process.stdout)

2. Continuously

// Live Mode! Updates every minute
var meta = MetaUtil().pipe(process.stdout)

3. Using as a command line utility

MetaUtil({
    'start': process.argv[2],
    'end': process.argv[3],
    'delay': process.argv[4]
}).pipe(process.stdout)

Use it in combination with jq

node app 001181708 001181721 1000 | jq -c '{user:.user, date: .closed_at}'

osm-meta-util's People

Contributors

kamicut avatar mikelmaron avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

osm-meta-util's Issues

Calculate replication file from data

osm-meta-util takes a start and end files and iterates, to process a timespan of replication files from planet. To determine those files, need to manually check which files correspond to the time period of interest. This could be calculated by taking the difference between our timestamp, and the timestamp of the very first replication file, determine the number of (minutely,hourly,daily) intervals, and format that as a path.

See files under http://planet.openstreetmap.org/replication/

cc @Rub21

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.