diff --git a/src/libkomapnik.py b/src/libkomapnik.py
index e1fdc01..b2cec59 100644
--- a/src/libkomapnik.py
+++ b/src/libkomapnik.py
@@ -329,13 +329,12 @@ def xml_layer(type="postgis", geom="point", interesting_tags = "*", sql = "true"
else:
interesting_tags = ", ".join(interesting_tags)
-
return """
%s
- (select %s, way
+ (select %s, ST_Simplify(way, %s)
from %s%s
where %s
) as text
@@ -351,7 +350,7 @@ def xml_layer(type="postgis", geom="point", interesting_tags = "*", sql = "true"
false
-20037508.342789244, -20037508.342780735, 20037508.342789244, 20037508.342780709
- """%(layer_id, db_proj, subs, interesting_tags, table_prefix, geom, sql, intersection_SQL, db_user, db_name, db_srid, table_prefix, geom)
+ """%(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)
elif type == "postgis-process":
return """