lowzoom optimizations

This commit is contained in:
Komzpa 2011-09-29 10:35:00 +02:00
parent f84414efa0
commit 9e62546774
2 changed files with 8 additions and 6 deletions

View file

@ -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 &amp;&amp; ST_Expand(!bbox!,3000) %s way_area desc

View file

@ -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 """
<LineSymbolizer %s>