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)
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
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()