Index: /tools/fetch_bigmap_leiden.py
===================================================================
--- /tools/fetch_bigmap_leiden.py	(revision 14314)
+++ /tools/fetch_bigmap_leiden.py	(revision 14314)
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# Generated by BigMap 2. Permalink: http://bigmap.osmz.ru/bigmap.php?xmin=33568&xmax=33599&ymin=21592&ymax=21615&zoom=16&scale=256&tiles=mapnik
+
+import io, urllib2, datetime, time, re, random
+from PIL import Image, ImageDraw
+# ^^^^^^ install "python-pillow" package | pip install Pillow | easy_install Pillow
+
+(zoom, xmin, ymin, xmax, ymax) = (16, 33568, 21592, 33599, 21615)
+layers = ["http://tile.openstreetmap.org/!z/!x/!y.png"]
+attribution = 'Map data (c) OpenStreetMap'
+xsize = xmax - xmin + 1
+ysize = ymax - ymin + 1
+
+resultImage = Image.new("RGBA", (xsize * 256, ysize * 256), (0,0,0,0))
+counter = 0
+for x in range(xmin, xmax+1):
+	for y in range(ymin, ymax+1):
+		for layer in layers:
+			url = layer.replace("!x", str(x)).replace("!y", str(y)).replace("!z", str(zoom))
+			match = re.search("{([a-z0-9]+)}", url)
+			if match:
+				url = url.replace(match.group(0), random.choice(match.group(1)))
+			print url, "... ";
+			try:
+				req = urllib2.Request(url, headers={'User-Agent': 'BigMap/2.0'})
+				tile = urllib2.urlopen(req).read()
+			except Exception, e:
+				print "Error", e
+				continue;
+			image = Image.open(io.BytesIO(tile))
+			resultImage.paste(image, ((x-xmin)*256, (y-ymin)*256), image.convert("RGBA"))
+			counter += 1
+			if counter == 10:
+				time.sleep(2);
+				counter = 0
+
+draw = ImageDraw.Draw(resultImage)
+draw.text((5, ysize*256-15), attribution, (0,0,0))
+del draw
+
+now = datetime.datetime.now()
+outputFileName = "map%02d-%02d%02d%02d-%02d%02d.png" % (zoom, now.year % 100, now.month, now.day, now.hour, now.minute)
+resultImage.save(outputFileName)
Index: /tools/fetch_bigmap_region.py
===================================================================
--- /tools/fetch_bigmap_region.py	(revision 14314)
+++ /tools/fetch_bigmap_region.py	(revision 14314)
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# Generated by BigMap 2. Permalink: http://bigmap.osmz.ru/bigmap.php?xmin=8379&xmax=8417&ymin=5390&ymax=5416&zoom=14&scale=64&tiles=mapnik
+
+import io, urllib2, datetime, time, re, random
+from PIL import Image, ImageDraw
+# ^^^^^^ install "python-pillow" package | pip install Pillow | easy_install Pillow
+
+(zoom, xmin, ymin, xmax, ymax) = (14, 8379, 5390, 8417, 5416)
+layers = ["http://tile.openstreetmap.org/!z/!x/!y.png"]
+attribution = 'Map data (c) OpenStreetMap'
+xsize = xmax - xmin + 1
+ysize = ymax - ymin + 1
+
+resultImage = Image.new("RGBA", (xsize * 256, ysize * 256), (0,0,0,0))
+counter = 0
+for x in range(xmin, xmax+1):
+	for y in range(ymin, ymax+1):
+		for layer in layers:
+			url = layer.replace("!x", str(x)).replace("!y", str(y)).replace("!z", str(zoom))
+			match = re.search("{([a-z0-9]+)}", url)
+			if match:
+				url = url.replace(match.group(0), random.choice(match.group(1)))
+			print url, "... ";
+			try:
+				req = urllib2.Request(url, headers={'User-Agent': 'BigMap/2.0'})
+				tile = urllib2.urlopen(req).read()
+			except Exception, e:
+				print "Error", e
+				continue;
+			image = Image.open(io.BytesIO(tile))
+			resultImage.paste(image, ((x-xmin)*256, (y-ymin)*256), image.convert("RGBA"))
+			counter += 1
+			if counter == 10:
+				time.sleep(2);
+				counter = 0
+
+draw = ImageDraw.Draw(resultImage)
+draw.text((5, ysize*256-15), attribution, (0,0,0))
+del draw
+
+now = datetime.datetime.now()
+outputFileName = "map%02d-%02d%02d%02d-%02d%02d.png" % (zoom, now.year % 100, now.month, now.day, now.hour, now.minute)
+resultImage.save(outputFileName)
Index: /tools/make_nodemap_png.py
===================================================================
--- /tools/make_nodemap_png.py	(revision 14314)
+++ /tools/make_nodemap_png.py	(revision 14314)
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+#
+# Quick to generate large (A1 size) image of node locations
+#
+import io, urllib2, datetime, time, re, random
+import math
+from PIL import Image, ImageDraw
+
+import make_network_kml
+
+def num2deg(xtile, ytile, zoom):
+  n = 2.0 ** zoom
+  lon_deg = xtile / n * 360.0 - 180.0
+  lat_rad = math.atan(math.sinh(math.pi * (1 - 2 * ytile / n)))
+  lat_deg = math.degrees(lat_rad)
+  return (lat_deg, lon_deg)
+
+## bigmap_leiden
+#(zoom, xmin, ymin, xmax, ymax) = (16, 33568, 21592, 33599, 21615)
+# bigmap_region
+(zoom, xmin, ymin, xmax, ymax) = (14, 8379, 5390, 8417, 5416)
+
+
+(lat_nw, lon_nw) = num2deg(xmin, ymin, zoom)
+(lat_se, lon_se) = num2deg(xmax + 1, ymax + 1, zoom)
+
+delta_lat = lat_nw - lat_se
+delta_lon = lon_nw - lon_se
+print (lat_nw, lon_nw)
+print (lat_se, lon_se)
+
+xpixels = (xmax - xmin + 1) * 256
+ypixels = (ymax - ymin + 1) * 256
+print (xpixels, ypixels)
+
+
+debug=False
+
+# Input data
+poel, link_type, link_data, link_status, hosts = make_network_kml.get_graph_data(debug)
+
+# Input image
+#resultImage = Image.open("map16-190204-2154.png")
+resultImage = Image.open("map14-190204-2329.png")
+draw = ImageDraw.Draw(resultImage)
+
+coord = {}
+# Draw nodes
+for nodename, datadump in hosts.iteritems():
+    lat_y = (lat_nw - float(datadump['latitude'])) / delta_lat * ypixels
+    lon_x = (lon_nw - float(datadump['longitude'])) / delta_lon * xpixels
+    coord[nodename] = (lon_x, lat_y)
+    r = 20
+    draw.ellipse((lon_x - r, lat_y - r, lon_x + r, lat_y + r), fill = 'blue', outline ='blue')
+
+# Draw links
+for addr,leden in poel.iteritems():
+  for index,lid in enumerate(leden[:-1]):
+    for buur in leden[index + 1:]:
+        x1, y1 = coord[hosts[buur]['nodename']]
+        x2, y2 = coord[hosts[lid]['nodename']]
+        draw.line((x1, y1, x2, y2), fill = 'green', width = 5)
+
+del draw
+
+now = datetime.datetime.now()
+outputFileName = "foo.png"
+resultImage.save(outputFileName)
