The ohsomeNow stats API offers a REST service to retrieve up-to-date and global scale overview statistics on mapping activity in OpenStreetMap (OSM).
The ohsomeNow stats API builds upon a ClickHouse DB which contains all OSM edits for which a changeset hashtag has been used. The REST service allows you to get insights into the number of contributors, total map edits, added buildings and added road length for a given time range and OSM changesets hashtag filter. Additional topic statistics, e.g. the length of added waterways, or the amount of added healthcare facilities. You can use the REST service to report mapping statistics for any time range starting from 2009-04-21 when the OSM-API version 0.6 introduced changesets.
Check out the API documentation get in contact with us in case you are planning to embed the API in your services or websites.
The core features are:
stats
endpoint provides mapping activity statistics summarized into a single line for a
single or multiple OSM changeset hashtags.mostUsedHashtags
in your chosen time-interval. The list is sorted by the
number of distinct OSM contributors per hashtag./stats/{hashtag}/country
endpoint to get insights into contributors and edits per OSM
changeset hashtags for all countries./stats/{hashtag}/interval
endpoint.Features for HOT Tasking Manager statistics:
hotosm-project-*
).For details about the ohsomeNow stats website check GIScience/ohsome-now-stats-frontend.
The service can be run directly on the OS or within a docker image
The service can be run on every machine with a Java Runtime (JDK 17 or higher.)
To do so run the following start script (on *nix systems):
./gradlew bootRun
or (on Windows systems):
./gradlew.bat bootRun
Once the system has started, the API documentation including links to endpoints is available here:
http://localhost:8080/doc.html
In order to run the service and a development database with dummy data within a Docker environment, run the following commands:
docker compose up -d
If you want to only run a development database in Docker and run the API natively (i.e. with gradle), run the following commands:
# start dev database
docker compose up -d clickhouse-database
# run API using the gradle wrapper
./gradlew bootRun
This relies on the Dockerfile, in this repository.
Note: The database credentials will be injected into the dockerized app via environment variables (soon). The Docker
database setup currently relies on an empty password set in secrets.properties
(see above).
These steps are achieved by the following 2 plugins:
This plugin is used to:
-SNAPSHOT
postfix)The plugin is run locally via the command line:
./gradlew release
The version scheme defaults can be overridden interactively if neccessary.
This plugin publishes all release and snapshot artifacts to the respective Artifactory maven repos.
Please note: