Giter Club home page Giter Club logo

taghistory's Introduction

OSM Tag Usage Analysis

Generates graphs of the usage of arbitrary OSM tags over time (with daily granularity) by number of OSM objects. Read more about OSM tags and this tool in my blog article.

Warning: The output is (currently) only given in terms of numbers (counts) of OSM objects! Similarly to some of the statistics produced by taginfo, it is subject to the same limitations, most notably the effect that one cannot directly compare the number of tags used for different linear and polygonal features such as roads, land cover, etc. because such features are typically divided up into many OSM objects of different sizes. For example, an existing road may be divided up into two pieces when a new turn restrictions is added, resulting in that the count of each of the tags used on the road (even obsolete ones) is increased by one in the OSM database. That means that one needs to pay close attention when comparing tags that are typically used on such features, even when one's comparing subtags that are typically used on the same kind of parent object (e.g. different values of the highway tag).

Technicalities

A simple osmium script (see /backend/) scans through a planet history dump and aggregates daily net differences of all used tags by osm object type (node/way/relation). This takes care of created and deleted objects as well as tag modifications in between different versions of an object.

This data is then stored into an sqlite database and is exposed by a simple REST API.

API

Taghistory's own API is quite limited and currently not updated regularly. Please consider using an alternative like the Taginfo chronology API or the ohsome API instead.

Data returned from the taghistory API described below is available under the terms of the ODbL 1.0 license and copyright © OpenStreetMap contributors.

GET /<type>/<key>/<value>[?format=<format>]

Gets the osm object count history for the given tag (key, value) of the given OSM object type (type). type can be *** to search for any object type.

Returns a JSON array of objects containing date, delta and count fields indicating the net change (delta) of the respective tag usage on a particular date. count contains a running cummulative sum of the object counts for convenience.

The optional GET-parameter format can be one of json (default value if omitted, see the example below) or csv for a downloadable csv file.

Example: http://taghistory.raifer.tech/relation/amenity/drinking_water

[
  {"date":"2010-08-03T00:00:00.000Z","delta":1,"count":1},
  {"date":"2010-08-28T00:00:00.000Z","delta":3,"count":4},
  …,
  {"date":"2014-10-28T00:00:00.000Z","delta":-3,"count":0}
]

GET /<type>/<key>[?format=<format>]

Same as above, but matches any tag with the given key.

todos

  • implement regular (e.g. daily) data updates
  • for linear and polygonal objects: use length or area as a metric instead of object count

see also

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.