From: Roman Bazalevsky Date: Thu, 31 Jul 2014 12:02:26 +0000 (+0400) Subject: Forced max zoom option X-Git-Url: https://git.rvb.name/pyrungps.git/commitdiff_plain/4d541b78fc22b46067e94c71f8bc52e2b7e4e22d?hp=5c18c71d0182aeb1424dba1dcc54fb23929ef85c Forced max zoom option --- 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()