OpenStreetMap logo OpenStreetMap

OSM Analytic Tracker (OSMAT)

Posted by Cascafico on 18 September 2017 in Italian (Italiano). Last updated on 25 March 2019.

Mini-abstract

Tracking vandalisms is often not an easy task. To accomplish this activity I hardly find useful digging in the history of OSM changesets.

Instead OSMAT features a clean list of create/modifiy/deletes and tag changes; the latter one is particularly useful to track “advanced vandalism”.

OSMAT focuses on fast detection, so don’t expect to configure it on a national base, since rows will start to scroll too fast for spotting problems. For the same reason, OSMAT relies on minimal base of mappers and (quoting its wiki) “Improve[s] team spirit of a regional OSM team/task-force”.

The following installation procedure has been brought live on a OrangePi PC single-board computer. Here you can find a regional live instance for Friuli Venezia Giulia Italy.

Docker installation

OSMAT deployment is Docker based, so refer to Davide’s Docker installation
UPDATE: as from 2019-03-20 installation command quoted at the above link doesn’t work anymore for my debian jessie armhf. Please, use the following:
$ sudo curl -sSL https://github.com/moby/moby/raw/v1.13.1/hack/install.sh | sh

OSMAT download

Then download OSMAT sources:
$ git clone https://github.com/MichaelVL/osm-analytic-tracker.git

Check docker service

$ sudo service docker status
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled)
Active: active (running) since Sat 2017-09-16 11:40:37 CEST; 2 days ago

OSMAT configure

Once you got docker up and running (I had to upgrade linux kernel > 3.10 for my Jessie Orange Pi) and before compiling container, you have to configure active region.

Default available regions are the ones defined by Geofabrik. For instance, navigate to nord-est, take note of .poly link (nowadays is https://download.geofabrik.de/europe/italy/nord-est.poly) and edit configuration file:

$ cd osm-analytic-tracker
$ vi config.json
You’ll need to replace 3 occourences of default “denmark.poly” with your poly (for instance “nord-est.poly”, without any trailing URL).

Optionally, here you can also adjust:

  • map zoom level and time horizon, just search for “map_scale”: “6”
  • logging interval, search for “horizon_hours”: “48”

Compile container

Once you’re done with region & zoom configuration, set your device OS (mine is Armbian, which I’ve found Raspian compatible) commenting one of the following lines :
$ vi Dockerfile
#FROM debian:jessie
FROM resin/rpi-raspbian

then compile container:
$ sudo docker build -t osm-analytic-tracker .

Run

Then choose which port to listen (mine is 8889) and run it!
$ docker run -d –restart=always –name=osmat-container -p 8889:80 osm-analytic-tracker

[optional] Customizing

If you need a particular Area Of Interest, I’ve found easier to add a line in default regions list:

  1. Build a polygon: use JOSM opendata plugin to easily build and save a .poly which will be your AOI.
  2. Publish myAOI.poly somewere in internet
  3. Edit docker/regions.txt adding (or replacing) geofabrik URI’s with your URI, for instance:
    $ cd docker
    $ vi regions.txt
    http://bpi.uk.to/osm/regions/myAOI.poly
    https://download.geofabrik.de/asia/myanmar.poly
    https://download.geofabrik.de/asia/japan.poly
    https://download.geofabrik.de/asia/vietnam.poly
    [snip]
  4. Stop, remove and re-run container:
    $ docker stop osmat-container
    $ docker rm osmat-container
    $ docker run -d –restart=always –name=osmat-container -p 8889:80 osm-analytic-tracker

Try it

Go to http:127:0.0.1:8889 and wait for some changeset :-)

If you don’t see any changeset, at least you should see the map centered in your AOI and read in the upper right corner “Lag” around 1-5 minutes. Just wait for the next OSM changeset.

Discussion

Comment from Hjart on 20 September 2017 at 06:13

I have been watching the authors own instance at https://osm.expandable.dk/ (which also acts as a running demo) covering the country Denmark almost daily for nearly 2 years now and have found it immensely usefull for keeping track of activity and spotting mistakes. Quite a few times I’ve been able to correct mistakes (mostly done by newbies) within as little as 5 minutes. Actual vandalism doesn’t happen very often, but of course I’ve been able to quickly discover and revert a few cases.

Comment from Geonick on 22 October 2017 at 21:13

Added this tool in the OSM Wiki page. Feel free to open an own wiki page there: https://wiki.openstreetmap.org/wiki/Quality_assurance#OSMAT

Log in to leave a comment