From 331c723308cf84bd49197db16718a17cbaff18b3 Mon Sep 17 00:00:00 2001 From: Roman Bazalevsky Date: Sun, 31 Jan 2016 23:12:08 +0300 Subject: [PATCH 1/1] =?utf8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?utf8?q?=20=D0=BF=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA=20=D0=BE=D0=B1?= =?utf8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B8=20=D0=B0=D1=80=D0=B3?= =?utf8?q?=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=BE=D0=B2=20(=D0=BF=D0=B0=D1=80?= =?utf8?q?=D0=B0=D0=BC=D0=B5=D1=82=D1=80=20--zoom=20=D1=81=D0=B4=D0=B5?= =?utf8?q?=D0=BB=D0=B0=D0=BD=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=8F=D0=B7=D0=B0?= =?utf8?q?=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=BC=20=D0=B2=D0=BE=20?= =?utf8?q?=D0=B2=D1=81=D0=B5=D1=85=20=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD?= =?utf8?q?=D1=82=D0=B0=D1=85=20=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- render_tiles.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/render_tiles.py b/render_tiles.py index 18432d3..e229ead 100644 --- a/render_tiles.py +++ b/render_tiles.py @@ -37,7 +37,7 @@ def queue_tiles(db,minlat,minlon,maxlat,maxlon,forced_max_zoom=None): minx,miny=deg2num(minlat,minlon,maxzoom) maxx,maxy=deg2num(maxlat,maxlon,maxzoom) print maxzoom,':',minx,'-',maxx,'/',miny,'-',maxy - if (maxx-minx>32) or (maxy-miny>24) or (maxzoom==16): + if (maxx-minx>16) or (maxy-miny>12) or (maxzoom==16): break else: maxzoom=maxzoom+1 @@ -98,18 +98,21 @@ def main(): db=options.directory+'/gpx.db' map=options.map zoom=options.zoom + if not zoom: + zoom=12 force=(options.force=='on') - if zoom: - if len(args)==1: - filename,=args - print "Rendering file: "+filename+"\n" - queue_render(db,filename) - else: - minlat,minlon,maxlat,maxlon=args - queue_tiles(db,float(minlat),float(minlon),float(maxlat),float(maxlon),int(zoom)) + if len(args)==1: + filename,=args + print "Rendering file: "+filename+"\n" + queue_render(db,filename) + else: + minlat,minlon,maxlat,maxlon=args + print "Rendering region "+minlat+'..'+maxlat+' / '+minlon+'..'+maxlon+"\n" + queue_tiles(db,float(minlat),float(minlon),float(maxlat),float(maxlon),int(zoom)) if map: + print "Processing map "+map+"\n" process_queue(db,map,force) if __name__ == "__main__": -- 2.34.1