From 2581297c47cb4e587870c7be75cb1e116d702e74 Mon Sep 17 00:00:00 2001 From: MaksVasilev Date: Tue, 22 Apr 2014 15:10:13 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D0=BD=D0=B8=D1=82=D1=8C=20Marker?= =?UTF-8?q?sSymbolizer=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20LinePatter?= =?UTF-8?q?nSymbolizer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/komap.py | 4 ++-- src/libkomapnik.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/komap.py b/src/komap.py index abc8e50..3165954 100755 --- a/src/komap.py +++ b/src/komap.py @@ -526,11 +526,11 @@ if options.renderer == "mapnik": os.makedirs(icons_path + "komap/") if not os.path.exists(icons_path + "komap/" + fname): im.save(icons_path + "komap/" + fname, "PNG") - xml += xml_linepatternsymbolizer("komap/" + fname) + xml += xml_linepatternsymbolizer("komap/" + fname, entry["style"].get("spacing","0"), entry["style"].get("max-error","0.25"), entry["style"].get("allow-overlap","false")) except: print >> sys.stderr, "Error writing to ", icons_path + "komap/" + fname else: - xml += xml_linepatternsymbolizer(entry["style"]["pattern-image"]) + xml += xml_linepatternsymbolizer(entry["style"]["pattern-image"], entry["style"].get("spacing","0"), entry["style"].get("max-error","0.25"), entry["style"].get("allow-overlap","false")) sql.add(entry["sql"]) itags.update(entry["chooser"].get_interesting_tags(entry["type"], zoom)) xml += xml_rule_end() diff --git a/src/libkomapnik.py b/src/libkomapnik.py index 79e2394..c16ece7 100644 --- a/src/libkomapnik.py +++ b/src/libkomapnik.py @@ -88,7 +88,7 @@ def xml_pointsymbolizer(path="", width="", height="", opacity=1, overlap="false" if height: height = ' height="%s" ' % height return """ - """\ + """\ % (os.path.join(icons_path, path), width, height, opacity, overlap) @@ -129,9 +129,10 @@ def xml_polygonpatternsymbolizer(file=""): """ % (os.path.join(icons_path, file)) -def xml_linepatternsymbolizer(file=""): +def xml_linepatternsymbolizer(file="", spacing="0", max_error="0.25", allow_overlap="false"): + return """ - """ % (os.path.join(icons_path, file)) + """ % (os.path.join(icons_path, file), spacing, float(max_error), allow_overlap) def xml_textsymbolizer(