Giter Club home page Giter Club logo

osm-fetch's Introduction

osm-fetch

Build Status

Fetch XML representing a single version of a single feature from OpenStreetMap. All references required to complete the feature are included. The appropriate versions of references are selected based on the timestamp of the desired version of the requested feature. If no version number is specified, the most recent data available is retrieved.

Install

$ npm install -g osm-fetch

Usage

Usage: osm-fetch [OPTIONS] <type> <id> [version]

Options:
 -s, --shallow	Fetch XML for the most recent version and do not resolve member relations
 -t, --timestamp	Find references that existed at the requested time (in ms).

Examples:
  # Fetch the most recent version of relation 2453564
  $ osm-fetch relation 2453564

  # Fetch version 1 of relation 2453564
  $ osm-fetch relation 2453564 --version 1

  # Fetch relation 2453564 at 2012-10-05T04:00:00Z
  $ osm-fetch relation 2453564 --timestamp 1349409600000

  # Shallow fetch of the most recent version of relation 2453564
  $ osm-fetch relation 2453564 --shallow

Shallow mode

Specifying the --shallow flag will always fetch the most current version, and if the feature is a relation, any member relations will not have their members resolved. This mode offers no configurability, but is much faster because it only requires a single request against the OpenStreetMap API. Generally, this will provide enough data to build the most current geometry of a particular feature.

Also note that --shallow mode is incompatible with the --creation flag.

osm-fetch's People

Contributors

rclark avatar tmcw avatar

Stargazers

 avatar  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-fetch's Issues

Implement predictable error objects

Currently error objects are lazily slapped with what are sometimes irrelevant HTTP statusCode properties. The errors returned should be application-specific, and differentiate the various scenarios that can be encountered.

The "right" version of references

Are looking at older versions of features, references get icky. Imagine:

  • you change a tag to create v3 of a way
  • you change 6 of that way's nodes
  • you change another tag to create v4 of the way

What is the geometry of the way at v3? It has actually had two distinct geometries. You could find the creation-time geometry by finding the versions of nodes that existed at v3's timestamp, or you could find the ending geometry by finding the versions of the nodes that existed just prior to v4's timestamp.

Currently this lib finds the creation-time references. However, for many use-cases, the last-known state of the feature at a particular version may be what's really desired.

cc @mikelmaron @emilymcafee

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.