From fd16ade7cb754a27aa01734e86eac1ea9f01e7c0 Mon Sep 17 00:00:00 2001 From: sdirollo Date: Mon, 28 Aug 2023 17:41:18 +0200 Subject: [PATCH] try reduce connection pg --- tiles/config.toml.template | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tiles/config.toml.template b/tiles/config.toml.template index 93df227..a2bf691 100644 --- a/tiles/config.toml.template +++ b/tiles/config.toml.template @@ -25,6 +25,23 @@ srid = 3857 fid_field = "id" buffer_size = 10 simplify = true + # Queries for different zoom levels: + [[tileset.layer.query]] + minzoom = 0 + maxzoom = 2 + sql = """ + SELECT id, name, admin_level, zone_type, geometry + FROM $TABLE_SPACE.zones + WHERE geometry && !bbox! AND admin_level <= 2 + """ + [[tileset.layer.query]] + minzoom = 3 + maxzoom = 20 + sql = """ + SELECT id, name, admin_level, zone_type, geometry + FROM $TABLE_SPACE.zones + WHERE geometry && !bbox! + """ [cache.file] base = "/tmp/mvtcache" @@ -32,4 +49,4 @@ base = "/tmp/mvtcache" [webserver] bind = "0.0.0.0" port = 6767 -threads = 1 +threads = 4