X-Git-Url: https://git.rvb.name/pyrungps.git/blobdiff_plain/0f58e0f39a33de394b4792feb55701a3c13d6e5b..331c723308cf84bd49197db16718a17cbaff18b3:/render_tiles.py?ds=sidebyside 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__":