Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.
Kris Carle edited this page Dec 2, 2016 · 12 revisions

Info on backend APIs used by this website.

OSM-Stats

Leaderboards and User stats/badges

https://github.com/loggingroads/osm-stats/blob/master/documentation/API.md

Examples:

Since osmstats has all of OSM, to get top-level summary stats for just our project we need to use the data in the "logging-roads" hashtag, here is some example code:

request.get('http://osmstats.redcross.org/hashtags/logging-roads', function(res){
var data = res.body;
var users = data.users.length;
var edits = data.times.length;
var roads = data.totals.roads;
});

Animated Map

Code at: https://github.com/loggingroads/logging-roads-animation-map

The map can be used in an iframe, see page source at current loggingroads.org

Optional URL Params

Example: http://map.loggingroads.org/#/?hideLogo=true&hideUI=true

  • hideUI - hides the map navigation buttons default: false
  • disableScroll - disables scroll/mouse wheel from zooming the map, useful if the map is not full screen default: false
  • hideLogo - default: false
  • disableInteraction - disables all map interaction default: false
  • disableScenes - disables scene animation, will just stay at first scene default: false
  • showLngLat - overlay lat/lon on top of map, mainly for debugging default: false
  • disableButtons - hides the pause button default: false
  • showResume - shows a resume button to continue scenes after user is finished interacting with the map default: false

Tasking Manager

Logging Roads fork of the HOT OSM Tasking Manager

API Documentation: https://github.com/hotosm/osm-tasking-manager2/wiki/API

Notes:

  • Terminology - they call the top level task a "project" and each grid square a "task" In most cases we are querying tasking manager "projects" Once the user is inside tasking manager the will lock a grid square to activate a TM task.
  • We are in the process of updating the Logging Roads fork of tasking manager so there is a change the API will change slightly... should be resolved soon

Examples:

To-Fix

Logging Roads fork of the OSM to-fix project

Get list of tasks

List of tasks installed in to-fix

(Note: this may change, need to move it behind a reverse proxy instead of using the non standard port)

URL: http://loggingroads.org:8000/tasks

Example Response:

{
  data: [
  {
    task: "loggingroadstartdates",
    attributes: {
      owner: "[null]",
      title: "",
      updated: "1443828633",
      description: ""
    }
  }
  ]
}

Get stats for task

Completion stats for a to-fix task

Totals

URL: http://loggingroads.org:8000/count/loggingroadstartdates

Summary for date range

URL: http://loggingroads.org:8000/track_stats/loggingroadstartdates/from:2015-10-03/to:2016-06-14

Clone this wiki locally