Skip to content

Commit

Permalink
Merge pull request #277 from OpenHistoricalMap/compose/tiler
Browse files Browse the repository at this point in the history
Simplifying coastlines
  • Loading branch information
Rub21 authored Mar 12, 2024
2 parents 5b0902e + c982c94 commit 13ad3cf
Showing 1 changed file with 94 additions and 13 deletions.
107 changes: 94 additions & 13 deletions images/tiler-server/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
max_zoom = 20

0 comments on commit 13ad3cf

Please sign in to comment.