do simplifications only on lowzoom
This commit is contained in:
parent
e41fbf2f6e
commit
a4c5b30262
1 changed files with 7 additions and 4 deletions
|
@ -305,8 +305,11 @@ def xml_layer(type="postgis", geom="point", interesting_tags = "*", sql = "true"
|
|||
|
||||
|
||||
if type == "postgis":
|
||||
if zoom >= 5:
|
||||
sql = 'way && !bbox! and '+ sql
|
||||
waystring = 'way'
|
||||
if zoom < 10:
|
||||
waystring = "ST_Simplify(way, %s) as way"%(pixel_size_at_zoom(zoom,0.6))
|
||||
if zoom >= 5:
|
||||
sql = 'way && !bbox! and '+ sql
|
||||
interesting_tags = list(interesting_tags)
|
||||
if '"' not in "".join(interesting_tags) and "->" not in "".join(interesting_tags):
|
||||
interesting_tags = "\", \"".join(interesting_tags)
|
||||
|
@ -319,7 +322,7 @@ def xml_layer(type="postgis", geom="point", interesting_tags = "*", sql = "true"
|
|||
%s
|
||||
<Datasource>
|
||||
<Parameter name="table">
|
||||
(select %s, ST_Simplify(way, %s) as way
|
||||
(select %s, %s
|
||||
from %s%s
|
||||
where %s
|
||||
) as text
|
||||
|
@ -335,7 +338,7 @@ def xml_layer(type="postgis", geom="point", interesting_tags = "*", sql = "true"
|
|||
<Parameter name="estimate_extent">false</Parameter>
|
||||
<Parameter name="extent">-20037508.342789244, -20037508.342780735, 20037508.342789244, 20037508.342780709</Parameter>
|
||||
</Datasource>
|
||||
</Layer>"""%(layer_id, db_proj, subs, interesting_tags, 0.6*pixel_size_at_zoom(zoom), table_prefix, geom, sql, intersection_SQL, db_user, db_name, db_srid, table_prefix, geom)
|
||||
</Layer>"""%(layer_id, db_proj, subs, interesting_tags, waystring, table_prefix, geom, sql, intersection_SQL, db_user, db_name, db_srid, table_prefix, geom)
|
||||
elif type == "postgis-process":
|
||||
return """
|
||||
<Layer name="l%s" status="on" srs="%s">
|
||||
|
|
Loading…
Add table
Reference in a new issue