commented back postgis joining of ways with dashes

This commit is contained in:
Komzpa 2011-07-22 17:05:37 +03:00
parent 5863006f46
commit f8609c2d61
2 changed files with 17 additions and 17 deletions

View file

@ -383,21 +383,21 @@ if options.renderer == "mapnik":
oitags = itags
itags = add_numerics_to_itags(itags)
### FIXME: Performance degrades painfully on large lines ST_Union. Gotta find workaround :(
if layer_type == "polygon" and there_are_dashed_lines:
itags = ", ".join(itags)
oitags = '"'+ "\", \"".join(oitags) +'"'
sqlz = """select %s, ST_LineMerge(ST_Union(way)) as way from
(SELECT %s, ST_Boundary(way) as way from planet_osm_polygon where (%s) and way && !bbox! and ST_IsValid(way) ) tex
group by %s
"""%(itags,oitags,sql,oitags)
#elif layer_type == "line" and there_are_dashed_lines:
# sqlz = """select %s, ST_Union(way) as way from (SELECT * from planet_osm_line where way && !bbox! #and (%s)) as tex
# group by %s
# """%(itags,sql,oitags)
mfile.write(xml_layer("postgis-process", layer_type, itags, sqlz ))
else:
mfile.write(xml_layer("postgis", layer_type, itags, sql ))
#### FIXME: Performance degrades painfully on large lines ST_Union. Gotta find workaround :(
#if layer_type == "polygon" and there_are_dashed_lines:
#itags = ", ".join(itags)
#oitags = '"'+ "\", \"".join(oitags) +'"'
#sqlz = """select %s, ST_LineMerge(ST_Union(way)) as way from
#(SELECT %s, ST_Boundary(way) as way from planet_osm_polygon where (%s) and way && !bbox! and ST_IsValid(way) ) tex
#group by %s
#"""%(itags,oitags,sql,oitags)
##elif layer_type == "line" and there_are_dashed_lines:
## sqlz = """select %s, ST_Union(way) as way from (SELECT * from planet_osm_line where way && !bbox! #and (%s)) as tex
## group by %s
## """%(itags,sql,oitags)
#mfile.write(xml_layer("postgis-process", layer_type, itags, sqlz ))
#else:
mfile.write(xml_layer("postgis", layer_type, itags, sql ))
else:
xml_nolayer()
for layer_type, entry_types in [("point", ("node", "point")),("line",("way", "line")), ("polygon",("way","area"))]:

View file

@ -161,7 +161,7 @@ area|z5-[natural=water],
area|z10-[landuse=reservoir],
{fill-color: #C4D4F5; color: #C4D4F5; width:.1; z-index:9;}
area|z9-[natural=water]{text:name; text-offset:1; font-size:10; font-family: DejaVu Serif Italic; text-color:#285fd1; text-allow-overlap: false;text-halo-radius: 1; text-halo-color: #ffffff; }
area|z9-[natural=water]{text:name; text-offset:1; font-size:10; font-family: DejaVu Serif Italic; text-color:#285fd1; text-allow-overlap: false }
/*
text - из какого поля брать текст
text-offset - на сколько сдвинуть текст
@ -814,7 +814,7 @@ shields!!!!
way|z10-[waterway=stream], way|z9-[waterway=river], way|z13-[waterway=canal]
{text:name; font-size:9; font-family: DejaVu Sans Oblique; text-color:#547bd1; text-halo-radius:1; text-halo-color:#ffffff; text-position: line}
{text:name; font-size:9; font-family: DejaVu Sans Oblique; text-color:#547bd1; text-position: line}
node|z-3[place=continent]
{text:name; text-offset:-10; font-size:10; font-family: DejaVu Sans ExtraLight; text-halo-radius:1; text-color:#202020;text-halo-color:#ffffff;z-index:-1;-x-mapnik-min-distance:0}