From e7e2097acfdee64770de39bafdb083a2977438f2 Mon Sep 17 00:00:00 2001 From: Komzpa Date: Fri, 16 Sep 2011 01:06:40 +0300 Subject: [PATCH] fast rasterizer for thin lines; fix capitals --- src/libkomapnik.py | 12 ++++++++---- src/styles/osmosnimki-hybrid.mapcss | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/libkomapnik.py b/src/libkomapnik.py index 61f5954..9275325 100644 --- a/src/libkomapnik.py +++ b/src/libkomapnik.py @@ -86,19 +86,23 @@ def xml_pointsymbolizer(path="", width="", height="", opacity=1, overlap="false" def xml_linesymbolizer(color="#000000", width="1", opacity="1", linecap="butt", linejoin="round", dashes=""): color = nicecolor(color) linecap = {"none":"butt",}.get(linecap.lower(), linecap) + dashes = "" if dashes: dashes = '%s'%(dashes) - else: - dashes = "" + rasterizer = "" + if float(width) < 2: + rasterizer = ' rasterizer="fast"' + + return """ - + %s %s %s %s %s %s - """%(color, float(width), float(opacity), linejoin, linecap, dashes) + """%(rasterizer, color, float(width), float(opacity), linejoin, linecap, dashes) def xml_polygonsymbolizer(color="#000000", opacity="1"): diff --git a/src/styles/osmosnimki-hybrid.mapcss b/src/styles/osmosnimki-hybrid.mapcss index 79933ce..1ba7814 100644 --- a/src/styles/osmosnimki-hybrid.mapcss +++ b/src/styles/osmosnimki-hybrid.mapcss @@ -716,8 +716,8 @@ node|z10-[aeroway=aerodrome] node|z3-6[capital=yes][population>5000000] { icon-image: adm_5.png;allow-overlap:true} -node|z3[capital=yes][population>5000000] {text-offset:4; text:name; font-size:8; font-family: DejaVu Sans Bold; text-halo-radius:1; text-color:#ffffff;text-halo-color:#4D0000; text-allow-overlap: false; -x-mapnik-min-distance:0; text-align: left;} -node|z4-6[capital=yes][population>5000000] {text-offset:6; text:name; font-size:10; font-family: DejaVu Sans Bold; text-halo-radius:1; text-color:#ffffff;text-halo-color:#4D0000; text-allow-overlap: false; -x-mapnik-min-distance:0; text-align: left;} +node|z3[capital=yes][population>5000000] {text-offset:4; text:name; font-size:8; font-family: DejaVu Sans Bold; text-halo-radius:1; text-color:#ffffff;text-halo-color:#4D0000; text-allow-overlap: true; -x-mapnik-min-distance:0; text-align: left;} +node|z4-6[capital=yes][population>5000000] {text-offset:6; text:name; font-size:10; font-family: DejaVu Sans Bold; text-halo-radius:1; text-color:#ffffff;text-halo-color:#4D0000; text-allow-overlap: true; -x-mapnik-min-distance:0; text-align: left;} node|z4-5[place][population<100000][capital][admin_level<5] { icon-image:adm_4.png; text-offset:5; text:name; font-size: 7; font-family: DejaVu Sans Bold; text-halo-radius:1; text-color:#ffffff;text-halo-color:#4D0000; text-allow-overlap: false; -x-mapnik-min-distance:0;}