From 4d541b78fc22b46067e94c71f8bc52e2b7e4e22d Mon Sep 17 00:00:00 2001 From: Roman Bazalevsky Date: Thu, 31 Jul 2014 16:02:26 +0400 Subject: [PATCH] Forced max zoom option --- render_tiles.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/render_tiles.py b/render_tiles.py index f181cbe..5ce33f1 100644 --- a/render_tiles.py +++ b/render_tiles.py @@ -14,7 +14,7 @@ def queue_render(db,filename): minlat,minlon,maxlat,maxlon=cur.fetchone() queue_tiles(db,minlat,minlon,maxlat,maxlon) -def queue_tiles(db,minlat,minlon,maxlat,maxlon): +def queue_tiles(db,minlat,minlon,maxlat,maxlon,forced_max_zoom=None): conn = sqlite3.connect(db) @@ -35,7 +35,13 @@ def queue_tiles(db,minlat,minlon,maxlat,maxlon): if miny>maxy: miny,maxy = maxy,miny - for zoom in range(9,16): + minzoom=9 + if forced_max_zoom: + maxzoom=forced_max_zoom + else: + maxzoom=16 + + for zoom in range(minzoom,maxzoom+1): n = 2 ** zoom @@ -48,9 +54,10 @@ def queue_tiles(db,minlat,minlon,maxlat,maxlon): print zoom,minxt,maxxt,minyt,maxyt ins.execute('insert into render_queue(zoom,minx,maxx,miny,maxy) values(?,?,?,?,?)',(zoom,minxt,maxxt,minyt,maxyt)) - if (maxxt-minxt>16) or (maxyt-minyt>12): - conn.commit() - break + if not forced_max_zoom: + if (maxxt-minxt>16) or (maxyt-minyt>12): + conn.commit() + break conn.commit() -- 2.34.1