From c982c94f9891fb14bfa63f56ca942b5684385351 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Tue, 12 Mar 2024 18:38:21 -0500 Subject: [PATCH] Simplifying coastlines --- images/tiler-server/config/config.toml | 107 ++++++++++++++++++++++--- 1 file changed, 94 insertions(+), 13 deletions(-) diff --git a/images/tiler-server/config/config.toml b/images/tiler-server/config/config.toml index ad1a1f91..645662b3 100644 --- a/images/tiler-server/config/config.toml +++ b/images/tiler-server/config/config.toml @@ -30,15 +30,57 @@ user = "${POSTGRES_USER}" password = "${POSTGRES_PASSWORD}" # srid = 3857 max_connections = 40 + # Land + [[providers.layers]] + name = "land_0-2" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 750),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_3-5" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 300),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_6-7" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 150),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_8-9" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 75),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" [[providers.layers]] - name = "land_0-20" + name = "land_10-12" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(wkb_geometry,!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 30),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" - # #Water + [[providers.layers]] + name = "land_13-15" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 5),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_16-20" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + # Water [[providers.layers]] name = "water_areas" geometry_fieldname = "geometry" @@ -89,14 +131,6 @@ max_connections = 40 sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, ABS(osm_id) as osm_id, name, type, tags->'bridge' as bridge, tags->'surface' as surface, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_lines_gen1 WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') AND geometry && !BBOX!" # Admin boundaries - # Zoom levels 0-2,Tolerance=500 => ~1000 meters - # Zoom levels 3-5,Tolerance=200=> ~500 meters - # Zoom levels 6-7,Tolerance=100=> ~200 meters - # Zoom levels 8-9,Tolerance=50=> ~100 meters - # Zoom levels 10-12,Tolerance=20=> ~50 meters - # Zoom levels 13-15,Tolerance=5=> ~20 meters - # Zoom levels 16-20,Tolerance=1=> ~5 meters - [[providers.layers]] name = "admin_boundaries_0-2" geometry_fieldname = "geometry" @@ -331,12 +365,58 @@ name = "osm" attribution = "OpenStreetMap" # map attribution center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part of the TileJSON spec + # Zoom levels 0-2,Tolerance=500 => ~1000 meters + # Zoom levels 3-5,Tolerance=200=> ~500 meters + # Zoom levels 6-7,Tolerance=100=> ~200 meters + # Zoom levels 8-9,Tolerance=50=> ~100 meters + # Zoom levels 10-12,Tolerance=20=> ~50 meters + # Zoom levels 13-15,Tolerance=5=> ~20 meters + # Zoom levels 16-20,Tolerance=1=> ~5 meters + + # Land [[maps.layers]] name = "land" - provider_layer = "osm.land_0-20" + provider_layer = "osm.land_0-2" min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_6-7" + min_zoom = 6 + max_zoom = 7 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_8-9" + min_zoom = 8 + max_zoom = 9 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_10-12" + min_zoom = 10 + max_zoom = 12 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_13-15" + min_zoom = 13 + max_zoom = 15 + + [[maps.layers]] + name = "land" + provider_layer = "osm.land_16-20" + min_zoom = 16 max_zoom = 20 + # Admin boundaries [[maps.layers]] name = "land_ohm" provider_layer = "osm.admin_boundaries_0-2" @@ -589,4 +669,5 @@ center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part name = "transport_associated_streets" provider_layer = "osm.transport_associated_streets" min_zoom = 7 - max_zoom = 20 \ No newline at end of file + max_zoom = 20 + \ No newline at end of file