OSHDB

From OpenStreetMap Wiki
(Redirected from User:Kiddie/OSHDB)
Jump to navigation Jump to search
HeiGIT.svg

HeiGITOpenrouteserviceOhsome

Ohsome APIOSHDBOhsome DashboardOhsomeHeXOhsome quality analyst

The OSHDB is a high-performance data analysis framework for analysing OpenStreetMap's full-history data. Developed by the Big Spatial Data Analytics team at HeiGIT - Heidelberg Institute for Geoinformation Technology.

OSHDB
OshdbData.JPG
Author: HeiGIT
License: GNU Lesser General Public License v3
Platform: Data analysis framework
Version: 1.2.1
Source code: https://github.com/GIScience/oshdb
Programming language: Java

General Information

The OSHDB has been designed for efficient storage of and access to OpenStreetMap history data. In order to ensure the scalability of the system, it is build on a partitioning schema which allows distributed data storage and parallel execution of computations. The OSHDB API provides an interface to the OSHDB in the Java programming language. You can find the OSHDB on GitHub.

What can you do with the OSHDB API?

With the OSHDB API it is possible to use the map-reduce programming model to analyse the data in parallel.

You can

  • specify a query region
  • choose a query time span
  • filter for OSM types and tags
  • specify how to aggregate the data (for example by timestamp)
  • map the result: generate a single result for each data object, or a (possibly empty) list of results for each data object and automatically flatten the results of several data objects into a single long list
  • filter the result (for example only months with more than 5 unique users)
  • reduce (aggregate) the results of the map phase across the whole compute cluster (for example count or sum)

In the following short example you see how to count monthly unique users, that edited highways of type way in the region of Heidelberg in a given time period.

OSHDBDatabase oshdb = new OSHDBH2("path/to/osm-history-extract.oshdb");
SortedMap<OSHDBTimestamp, Integer> numberOfUsersEditingHighways = OSMContributionView.on(oshdb)
    .areaOfInterest(OSHDBBoundingBox.bboxWgs84Coordinates(8.6319923, 49.3822610, 8.7327575, 49.4421242))
    .timestamps("2013-01-01", "2013-12-01", Interval.MONTHLY)
    .filter("type:way and highway=*")
    .map(contribution -> contribution.getContributorUserId())
    .aggregateByTimestamp()
    .countUniq();
date unique users
2013-01-01T00:00:00Z 27
2013-02-01T00:00:00Z 13
2013-03-01T00:00:00Z 14
2013-04-01T00:00:00Z 18
2013-05-01T00:00:00Z 26
2013-06-01T00:00:00Z 25
2013-07-01T00:00:00Z 18
2013-08-01T00:00:00Z 15
2013-09-01T00:00:00Z 12
2013-10-01T00:00:00Z 18
2013-11-01T00:00:00Z 21

For further examples go to this tutorial or view these blog posts.

Publications and Presentations

Papers related to the OSHDB:

State of the Map talks about the OSHDB: