aaronlidman / taghistory

:chart_with_upwards_trend: History of OSM tag usage

Home Page:http://taghistory.raifer.tech/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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

About

:chart_with_upwards_trend: History of OSM tag usage

http://taghistory.raifer.tech/

License:MIT License


Languages

Language:HTML 74.5%Language:C++ 25.5%