Skip to content
Browse files

Improved documentation, added icon files, added test appl…

  • Loading branch information...
MichaelVL committed Sep 13, 2015
1 parent f871891 commit 18d302b1453aeeb3966a8346cb183e712feea2a6
Showing with 369 additions and 5 deletions.
  1. +15 −5
  2. +108 −0
  3. BIN html/favicon.png
  4. BIN html/josm-icon.png
  5. +246 −0 icon.svg
@@ -51,18 +51,16 @@ Geographical changes in the changeset, green are added objects, blue changed and


0. Download a region polygon from
0. Download a region polygon from e.g.
0. Change polygon filename in config.json to your chosen region
0. Run the backend as below
0. Run the main tracker as below
0. Inspect the files in the local html directory (can be customised also through the config.json file)
0. Optional - serve the html directory through a web-server.

``` -lDEBUG

The tracker python script tracks OpenStreetMap minutely diffs and optionally
filters them through a bounding-box polygon (country-based polygons can be found
on Changesets found to be within the area of
@@ -78,8 +76,20 @@ the OpenStreetMap API servers!
Configuration is provided through the config.json file -- especially the paths
for the backends should be configured.

### Components

- The main script, tracks OpenStreetMap minutely diffs
- Diff filter, filters a minutely diff through a region polygon and the analyse remaining changesets. Keeping this in a separate process improces control of memory consumption.
- The class, which contain the main analysis code. Can be used from a command line through

### Dependencies

- Python shapely and tilezone libraries: python-shapepy python-tz
- Python OSM API: pip install osmapi

### Links

* [Danish edits as seen through OSM Analytic Difference Engine]

* [Show Me The Way]( [source](
* [Show Me The Way - a more visial live service](
@@ -0,0 +1,108 @@

import sys, getopt
from osmapi import OsmApi
import pprint
import json
import OsmChangeset

def main(argv):
debug = False
meta = False
changes = False
history = False
summary = False
geojson = None
bbox = False
bounds = None
csetid = None
opts, args = getopt.getopt(argv, "dg:i:mchsb:B")
except getopt.GetoptError:
print "..."
for opt, arg in opts:
if opt == '-d':
debug = True
if opt == '-m':
meta = True
if opt == '-h':
history = True
if opt == '-s':
summary = True
if opt == '-c':
changes = True
if opt == '-g':
geojson = arg
if opt == '-B':
bbox = True
if opt == '-b':
bounds = arg
if opt == '-i':
csetid = int(arg)

cset = OsmChangeset.Changeset(csetid)
cset.apidebug = debug


if changes or history or summary or geojson:


if meta:
if debug:
print '== Changeset info ======='
if bbox:
if debug:
print '== Changeset bbox ======='
print '[[{},{}],[{},{}]]'.format(cset.meta['min_lat'], cset.meta['min_lon'],
cset.meta['max_lat'], cset.meta['max_lon'])
if bounds:
if debug:
print '== Changeset bounds ======='
b = '[[{},{}],[{},{}]]'.format(cset.meta['min_lat'], cset.meta['min_lon'],
cset.meta['max_lat'], cset.meta['max_lon'])
if bounds=='-':
with open(bounds, 'w') as f:
if changes:
if debug:
print '== Changes ======='
if history:
if debug:
print '== History ======'
if summary:
if debug:
print '== Summary ======'
if debug:
print '== Diffs ======'
if geojson:
if debug:
print '== GeoJsonDiff ======'
if geojson=='-':
with open(geojson, 'w') as f:
json.dump(cset.getGeoJsonDiff(), f)

if __name__ == "__main__":

sys.path.insert(0, '/home/mvl/workspace/osm-updated/osmapi/osmapi/')

print "Unexpected error:", sys.exc_info()[0]
BIN +2.45 KB html/favicon.png
Binary file not shown.
BIN +1.52 KB html/josm-icon.png
Binary file not shown.
Oops, something went wrong.

0 comments on commit 18d302b

Please sign in to comment.
You can’t perform that action at this time.