From 9e62546774ad95d52df43d074a0c71f4d1e28cad Mon Sep 17 00:00:00 2001 From: Komzpa Date: Thu, 29 Sep 2011 10:35:00 +0200 Subject: [PATCH] lowzoom optimizations --- src/komap.py | 8 +++++--- src/libkomapnik.py | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/komap.py b/src/komap.py index c05aa6c..4ff713f 100644 --- a/src/komap.py +++ b/src/komap.py @@ -305,7 +305,8 @@ if options.renderer == "mapnik": opacity=relaxedFloat(entry["style"].get("casing-opacity", entry["style"].get("opacity","1"))), linecap=entry["style"].get("casing-linecap", entry["style"].get("linecap","butt")), linejoin=entry["style"].get("casing-linejoin", entry["style"].get("linejoin", "round")), - dashes=entry["style"].get("casing-dashes",entry["style"].get("dashes", ""))) + dashes=entry["style"].get("casing-dashes",entry["style"].get("dashes", "")), + zoom=zoom) sql.add(entry["sql"]) itags.update(entry["chooser"].get_interesting_tags(entry["type"], zoom)) @@ -375,7 +376,8 @@ if options.renderer == "mapnik": opacity=relaxedFloat(entry["style"].get("opacity", "1")), linecap=entry["style"].get("linecap", "round"), linejoin=entry["style"].get("linejoin", "round"), - dashes=entry["style"].get("dashes", "")) + dashes=entry["style"].get("dashes", ""), + zoom=zoom) if entry["style"].get("dashes", ""): there_are_dashed_lines = True #print "dashes!!!" @@ -614,7 +616,7 @@ if options.renderer == "mapnik": order = "order by" else: order += ", " - if zoom >= 10: + if zoom >= 11 or zoom < 5: sqlz = """select %s, ST_PointOnSurface(ST_Buffer(way,0)) as way from planet_osm_%s where (%s) and (%s) and (way_area > %s) and way && ST_Expand(!bbox!,3000) %s way_area desc diff --git a/src/libkomapnik.py b/src/libkomapnik.py index 3106492..73f5a8e 100644 --- a/src/libkomapnik.py +++ b/src/libkomapnik.py @@ -83,7 +83,7 @@ def xml_pointsymbolizer(path="", width="", height="", opacity=1, overlap="false" path, width, height, opacity, overlap) -def xml_linesymbolizer(color="#000000", width="1", opacity="1", linecap="butt", linejoin="round", dashes=""): +def xml_linesymbolizer(color="#000000", width="1", opacity="1", linecap="butt", linejoin="round", dashes="", zoom=200): color = nicecolor(color) linecap = {"none":"butt",}.get(linecap.lower(), linecap) @@ -92,8 +92,8 @@ def xml_linesymbolizer(color="#000000", width="1", opacity="1", linecap="butt", else: dashes = "" rasterizer = "" - #if float(width) < 4 and not dashes: - # rasterizer = ' rasterizer="fast"' + if float(width) < 4 and not dashes and zoom < 6: + rasterizer = ' rasterizer="fast"' return """