From f0885e7917f78886db7661e6279c0f3f0e419b82 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Sun, 8 Dec 2024 21:48:09 -0500 Subject: [PATCH 1/6] Simplification for transport lines --- .github/workflows/chartpress.yaml | 2 +- .../config/layers/transport_lines.json | 97 +++++++++++++++++-- 2 files changed, 92 insertions(+), 7 deletions(-) diff --git a/.github/workflows/chartpress.yaml b/.github/workflows/chartpress.yaml index 2e4292d5..84fd49f1 100644 --- a/.github/workflows/chartpress.yaml +++ b/.github/workflows/chartpress.yaml @@ -5,7 +5,7 @@ on: - 'main' - 'staging' - 'development' - - 'imposm/routes' + - 'transport_lines' jobs: build: runs-on: ubuntu-20.04 diff --git a/images/tiler-imposm/config/layers/transport_lines.json b/images/tiler-imposm/config/layers/transport_lines.json index 79d2e3cd..8242a146 100644 --- a/images/tiler-imposm/config/layers/transport_lines.json +++ b/images/tiler-imposm/config/layers/transport_lines.json @@ -8,15 +8,55 @@ ] }, "generalized_tables": { - "transport_lines_gen0": { - "source": "transport_lines_gen1", - "sql_filter": null, + "transport_lines_z5": { + "source": "transport_lines_z6", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction') AND tunnel = 0 AND bridge = 0", + "tolerance": 1000.0 + }, + "transport_lines_z6": { + "source": "transport_lines_z7", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link')", + "tolerance": 500.0 + }, + "transport_lines_z7": { + "source": "transport_lines_z8", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed')", "tolerance": 200.0 }, - "transport_lines_gen1": { - "source": "transport_lines", - "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link') OR class IN('railway', 'route')", + "transport_lines_z8": { + "source": "transport_lines_z9", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed')", + "tolerance": 100.0 + }, + "transport_lines_z9": { + "source": "transport_lines_z10", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed')", "tolerance": 50.0 + }, + "transport_lines_z10": { + "source": "transport_lines_z11", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed')", + "tolerance": 25.0 + }, + "transport_lines_z11": { + "source": "transport_lines_z12", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'type', 'tram', 'funicular', 'monorail')", + "tolerance": 10.0 + }, + "transport_lines_z12": { + "source": "transport_lines_z13", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified')", + "tolerance": 5.0 + }, + "transport_lines_z13": { + "source": "transport_lines_z14_20", + "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified')", + "tolerance": 2.0 + }, + "transport_lines_z14_20": { + "source": "transport_lines", + "sql_filter": "(type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified', 'subway', 'track', 'living_street', 'footway', 'cycleway', 'path', 'pier', 'steps', 'pedestrian', 'ferry') OR class IN ('railway', 'route'))", + "tolerance": 0.0 } }, "tables": { @@ -91,6 +131,51 @@ "type": "hstore_tags", "name": "tags", "key": null + }, + { + "type": "string", + "name": "start_date", + "key": "start_date" + }, + { + "type": "string", + "name": "end_date", + "key": "end_date" + }, + { + "type": "string", + "name": "electrified", + "key": "electrified" + }, + { + "type": "string", + "name": "highspeed", + "key": "highspeed" + }, + { + "type": "string", + "name": "usage", + "key": "usage" + }, + { + "type": "string", + "name": "railway", + "key": "railway" + }, + { + "type": "string", + "name": "aeroway", + "key": "aeroway" + }, + { + "type": "string", + "name": "highway", + "key": "highway" + }, + { + "type": "string", + "name": "route", + "key": "route" } ], "type": "linestring", From 587d63d9eb48bb59f07a66b9a7ace9f193b98b44 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Mon, 9 Dec 2024 06:40:43 -0500 Subject: [PATCH 2/6] Update layers for admin, water and transport --- compose/tiler.yml | 16 +- .../config/layers/admin_areas.json | 8 +- .../config/layers/transport_lines.json | 25 +- .../config/layers/water_areas.json | 8 +- .../config/layers/water_lines.json | 15 +- .../config/providers/transport_lines.toml | 281 ++++++++++-------- .../providers/transport_lines.zoom.toml | 38 ++- .../config/providers/water_lines.toml | 12 +- .../config/providers/water_lines.zoom.toml | 16 +- 9 files changed, 238 insertions(+), 181 deletions(-) diff --git a/compose/tiler.yml b/compose/tiler.yml index b96d1e08..cd84ea41 100644 --- a/compose/tiler.yml +++ b/compose/tiler.yml @@ -7,7 +7,7 @@ services: ports: - "5432:5432" volumes: - - ../data/tiler-db-data:/var/lib/postgresql/data + - ../data/tiler-db-data2:/var/lib/postgresql/data env_file: - ../envs/.env.tiler restart: always @@ -17,12 +17,12 @@ services: context: ../images/tiler-imposm dockerfile: Dockerfile volumes: - - ../data/tiler-imposm-data:/mnt/data + - ../data/tiler-imposm-data2:/mnt/data - ../images/tiler-imposm:/app command: - sh - -c - - "sleep 60 && ./start.sh" + - "sleep 20 && ./start.sh" env_file: - ../envs/.env.tiler tiler: @@ -38,12 +38,4 @@ services: env_file: - ../envs/.env.tiler restart: always - tilercache: - image: ohm-tiler-cache:v1 - build: - context: ../images/tiler-cache - dockerfile: Dockerfile - volumes: - - ../data/tiler-cache-data:/mnt/data - - ../images/tiler-cache:/app - + \ No newline at end of file diff --git a/images/tiler-imposm/config/layers/admin_areas.json b/images/tiler-imposm/config/layers/admin_areas.json index 50cf8bb9..53665575 100644 --- a/images/tiler-imposm/config/layers/admin_areas.json +++ b/images/tiler-imposm/config/layers/admin_areas.json @@ -36,7 +36,7 @@ }, "admin_boundaries_lines_z6_7": { "source": "admin_areas", - "tolerance": 500, + "tolerance": 200, "geometry_transform": "ST_Boundary(geometry)", "geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')", "sql_filter": "admin_level IN (1,2,3,4,5,6)" @@ -49,7 +49,7 @@ }, "admin_boundaries_lines_z8_9": { "source": "admin_areas", - "tolerance": 200, + "tolerance": 100, "geometry_transform": "ST_Boundary(geometry)", "geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')", "sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9)" @@ -62,7 +62,7 @@ }, "admin_boundaries_lines_z10_12": { "source": "admin_areas", - "tolerance": 100, + "tolerance": 20, "geometry_transform": "ST_Boundary(geometry)", "geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')", "sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)" @@ -75,7 +75,7 @@ }, "admin_boundaries_lines_z13_15": { "source": "admin_areas", - "tolerance": 50, + "tolerance": 5, "geometry_transform": "ST_Boundary(geometry)", "geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')", "sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)" diff --git a/images/tiler-imposm/config/layers/transport_lines.json b/images/tiler-imposm/config/layers/transport_lines.json index 8242a146..14d10bf0 100644 --- a/images/tiler-imposm/config/layers/transport_lines.json +++ b/images/tiler-imposm/config/layers/transport_lines.json @@ -11,52 +11,51 @@ "transport_lines_z5": { "source": "transport_lines_z6", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction') AND tunnel = 0 AND bridge = 0", - "tolerance": 1000.0 + "tolerance": 1000 }, "transport_lines_z6": { "source": "transport_lines_z7", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link')", - "tolerance": 500.0 + "tolerance": 200 }, "transport_lines_z7": { "source": "transport_lines_z8", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed')", - "tolerance": 200.0 + "tolerance": 150 }, "transport_lines_z8": { "source": "transport_lines_z9", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed')", - "tolerance": 100.0 + "tolerance": 100 }, "transport_lines_z9": { "source": "transport_lines_z10", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed')", - "tolerance": 50.0 + "tolerance": 50 }, "transport_lines_z10": { "source": "transport_lines_z11", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed')", - "tolerance": 25.0 + "tolerance": 20 }, "transport_lines_z11": { "source": "transport_lines_z12", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'type', 'tram', 'funicular', 'monorail')", - "tolerance": 10.0 + "tolerance": 15 }, "transport_lines_z12": { "source": "transport_lines_z13", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified')", - "tolerance": 5.0 + "tolerance": 10 }, - "transport_lines_z13": { + "transport_lines_z13_15": { "source": "transport_lines_z14_20", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified')", - "tolerance": 2.0 + "tolerance": 5 }, - "transport_lines_z14_20": { + "transport_lines_z16_20": { "source": "transport_lines", - "sql_filter": "(type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified', 'subway', 'track', 'living_street', 'footway', 'cycleway', 'path', 'pier', 'steps', 'pedestrian', 'ferry') OR class IN ('railway', 'route'))", - "tolerance": 0.0 + "sql_filter": "(type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified', 'subway', 'track', 'living_street', 'footway', 'cycleway', 'path', 'pier', 'steps', 'pedestrian', 'ferry') OR class IN ('railway', 'route'))" } }, "tables": { diff --git a/images/tiler-imposm/config/layers/water_areas.json b/images/tiler-imposm/config/layers/water_areas.json index ccf50ab6..ec519585 100644 --- a/images/tiler-imposm/config/layers/water_areas.json +++ b/images/tiler-imposm/config/layers/water_areas.json @@ -25,7 +25,7 @@ "water_areas_z6_7": { "source": "water_areas", "sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 1000000", - "tolerance": 500 + "tolerance": 200 }, "water_areas_centroid_z6_7": { "source": "water_areas", @@ -36,7 +36,7 @@ "water_areas_z8_9": { "source": "water_areas", "sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 10000", - "tolerance": 200 + "tolerance": 100 }, "water_areas_centroid_z8_9": { "source": "water_areas", @@ -47,7 +47,7 @@ "water_areas_z10_12": { "source": "water_areas", "sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank')", - "tolerance": 10 + "tolerance": 20 }, "water_areas_centroid_z10_12": { "source": "water_areas", @@ -58,7 +58,7 @@ "water_areas_z13_15": { "source": "water_areas", "sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock')", - "tolerance": 1 + "tolerance": 5 }, "water_areas_centroid_z13_15": { "source": "water_areas", diff --git a/images/tiler-imposm/config/layers/water_lines.json b/images/tiler-imposm/config/layers/water_lines.json index af674bc2..c14d74de 100644 --- a/images/tiler-imposm/config/layers/water_lines.json +++ b/images/tiler-imposm/config/layers/water_lines.json @@ -11,22 +11,21 @@ "water_lines_z8_9": { "source": "water_lines", "sql_filter": "type IN ('river', 'canal')", - "tolerance": 1000 + "tolerance": 100 }, - "water_lines_z10_11": { + "water_lines_z10_12": { "source": "water_lines", "sql_filter": "type IN ('river', 'canal', 'cliff', 'dam')", - "tolerance": 100 + "tolerance": 20 }, - "water_lines_z12_14": { + "water_lines_z13_15": { "source": "water_lines", "sql_filter": "type IN ('river', 'canal', 'cliff', 'dam', 'stream')", - "tolerance": 10 + "tolerance": 5 }, - "water_lines_z15_20": { + "water_lines_z16_20": { "source": "water_lines", - "sql_filter": "type IN ('river', 'canal', 'cliff', 'dam', 'stream', 'ditch', 'drain')", - "tolerance": 0 + "sql_filter": "type IN ('river', 'canal', 'cliff', 'dam', 'stream', 'ditch', 'drain')" } }, "tables": { diff --git a/images/tiler-server/config/providers/transport_lines.toml b/images/tiler-server/config/providers/transport_lines.toml index 14ee8767..f4c6a25e 100644 --- a/images/tiler-server/config/providers/transport_lines.toml +++ b/images/tiler-server/config/providers/transport_lines.toml @@ -1,5 +1,5 @@ [[providers.layers]] -name = "transport_lines_gen_5" +name = "transport_lines_z5" geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" @@ -13,132 +13,170 @@ SELECT ref, service, name, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage, - 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, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines_gen0 + osm_transport_lines_z5 WHERE - type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction') - AND tunnel = 0 - AND bridge = 0 - AND geometry && !BBOX! + geometry && !BBOX! """ [[providers.layers]] -name = "transport_lines_gen_6" +name = "transport_lines_z6" geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - osm_id, + ABS(osm_id) AS osm_id, ref, class, type, service, name, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage, - 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, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines_gen1 + osm_transport_lines_z6 WHERE - type IN ( - 'motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', - 'primary', 'primary_link', 'secondary', 'secondary_link','tertiary', 'tertiary_link' - ) - AND geometry && !BBOX! + geometry && !BBOX! """ [[providers.layers]] -name = "transport_lines_gen_7" +name = "transport_lines_z7" geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - osm_id, + ABS(osm_id) AS osm_id, ref, class, type, service, name, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage, - 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, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines_gen1 + osm_transport_lines_z7 WHERE - type IN ( - 'motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', - 'primary', 'primary_link', 'secondary', 'secondary_link','tertiary', 'tertiary_link', - 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed' - ) - AND geometry && !BBOX! + geometry && !BBOX! """ [[providers.layers]] -name = "transport_lines_gen_8-10" +name = "transport_lines_z8" geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - osm_id, + ABS(osm_id) AS osm_id, ref, class, type, service, name, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage, - 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, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines_gen0 + osm_transport_lines_z8 WHERE - type IN ( - 'motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', - 'primary', 'primary_link', 'secondary', 'secondary_link','tertiary', 'tertiary_link', - 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed' + geometry && !BBOX! +""" - ) - AND geometry && !BBOX! +[[providers.layers]] +name = "transport_lines_z9" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + ref, + class, + type, + service, + name, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, + {{LENGUAGES}} +FROM + osm_transport_lines_z9 +WHERE + geometry && !BBOX! """ [[providers.layers]] -name = "transport_lines_gen_11" +name = "transport_lines_z10" geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, + ABS(osm_id) AS osm_id, + ref, + class, + type, + service, + name, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, + {{LENGUAGES}} +FROM + osm_transport_lines_z10 +WHERE + geometry && !BBOX! +""" + + +[[providers.layers]] +name = "transport_lines_z11" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, name, ref, class, @@ -148,36 +186,61 @@ SELECT access, service, ford, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage, - 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, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines + osm_transport_lines_z11 WHERE - type IN ( - 'motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', - 'primary', 'primary_link', 'secondary', 'secondary_link','tertiary', 'tertiary_link', - 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', - 'type', 'tram', 'funicular', 'monorail' - ) - AND geometry && !BBOX! + geometry && !BBOX! """ [[providers.layers]] -name = "transport_lines_gen_12-13" +name = "transport_lines_z12" geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, + ABS(osm_id) AS osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, + {{LENGUAGES}} +FROM + osm_transport_lines_z12 +WHERE + geometry && !BBOX! +""" + +[[providers.layers]] +name = "transport_lines_z13_15" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, name, ref, class, @@ -187,37 +250,29 @@ SELECT access, service, ford, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage, - 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, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines + osm_transport_lines_z13 WHERE - type IN ( - 'motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', - 'primary', 'primary_link', 'secondary', 'secondary_link','tertiary', 'tertiary_link', - 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', - 'tram', 'funicular', 'monorail', - 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified' - ) - AND geometry && !BBOX! + geometry && !BBOX! """ [[providers.layers]] -name = "transport_lines_gen_14-24" +name = "transport_lines_z16_20" geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, + ABS(osm_id) AS osm_id, name, ref, class, @@ -227,24 +282,16 @@ SELECT access, service, ford, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage, - 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, + electrified, + highspeed, + usage, + start_date, + AS end_date, + isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines + osm_transport_lines_z14_20 WHERE - type IN ( - 'motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', - 'primary', 'primary_link', 'secondary', 'secondary_link','tertiary', 'tertiary_link', - 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', - 'tram', 'funicular', 'monorail', - 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified', - 'subway','track','living_street','footway', 'cycleway', 'path', 'pier','steps','pedestrian','ferry' - ) - AND geometry && !BBOX! + geometry && !BBOX! """ diff --git a/images/tiler-server/config/providers/transport_lines.zoom.toml b/images/tiler-server/config/providers/transport_lines.zoom.toml index c301fd1b..593f63c0 100644 --- a/images/tiler-server/config/providers/transport_lines.zoom.toml +++ b/images/tiler-server/config/providers/transport_lines.zoom.toml @@ -1,41 +1,59 @@ [[maps.layers]] name = "transport_lines" -provider_layer = "osm.transport_lines_gen_5" +provider_layer = "osm.transport_lines_z5" min_zoom = 5 max_zoom = 5 [[maps.layers]] name = "transport_lines" -provider_layer = "osm.transport_lines_gen_6" +provider_layer = "osm.transport_lines_z6" min_zoom = 6 max_zoom = 6 [[maps.layers]] name = "transport_lines" -provider_layer = "osm.transport_lines_gen_7" +provider_layer = "osm.transport_lines_z7" min_zoom = 7 max_zoom = 7 [[maps.layers]] name = "transport_lines" -provider_layer = "osm.transport_lines_gen_8-10" +provider_layer = "osm.transport_lines_z8" min_zoom = 8 max_zoom = 10 [[maps.layers]] name = "transport_lines" -provider_layer = "osm.transport_lines_gen_11" +provider_layer = "osm.transport_lines_z9" +min_zoom = 9 +max_zoom = 9 + +[[maps.layers]] +name = "transport_lines" +provider_layer = "osm.transport_lines_z10" +min_zoom = 10 +max_zoom = 10 + +[[maps.layers]] +name = "transport_lines" +provider_layer = "osm.transport_lines_z11" min_zoom = 11 max_zoom = 11 [[maps.layers]] name = "transport_lines" -provider_layer = "osm.transport_lines_gen_12-13" +provider_layer = "osm.transport_lines_z12" min_zoom = 12 -max_zoom = 13 +max_zoom = 12 + +[[maps.layers]] +name = "transport_lines" +provider_layer = "osm.transport_lines_z13_15" +min_zoom = 13 +max_zoom = 15 [[maps.layers]] name = "transport_lines" -provider_layer = "osm.transport_lines_gen_14-24" -min_zoom = 14 -max_zoom = 24 +provider_layer = "osm.transport_lines_z16_20" +min_zoom = 16 +max_zoom = 20 diff --git a/images/tiler-server/config/providers/water_lines.toml b/images/tiler-server/config/providers/water_lines.toml index 5c511e11..387c030f 100644 --- a/images/tiler-server/config/providers/water_lines.toml +++ b/images/tiler-server/config/providers/water_lines.toml @@ -25,7 +25,7 @@ WHERE geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" -name = "water_lines_z10_11" +name = "water_lines_z10_12" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, @@ -39,7 +39,7 @@ SELECT isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_water_lines_z10_11 + osm_water_lines_z10_12 WHERE geometry && !BBOX! """ @@ -48,7 +48,7 @@ WHERE geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" -name = "water_lines_z12_14" +name = "water_lines_z13_15" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, @@ -62,7 +62,7 @@ SELECT isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_water_lines_z12_14 + osm_water_lines_z13_15 WHERE geometry && !BBOX! """ @@ -71,7 +71,7 @@ WHERE geometry_fieldname = "geometry" geometry_type = "linestring" id_fieldname = "osm_id" -name = "water_lines_z15_20" +name = "water_lines_z16_20" sql = """ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, @@ -85,7 +85,7 @@ SELECT isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_water_lines_z15_20 + osm_water_lines_z16_20 WHERE geometry && !BBOX! """ diff --git a/images/tiler-server/config/providers/water_lines.zoom.toml b/images/tiler-server/config/providers/water_lines.zoom.toml index 1549e745..f695fdf9 100644 --- a/images/tiler-server/config/providers/water_lines.zoom.toml +++ b/images/tiler-server/config/providers/water_lines.zoom.toml @@ -6,18 +6,20 @@ max_zoom = 9 [[maps.layers]] name = "water_lines" -provider_layer = "osm.water_lines_z10_11" +provider_layer = "osm.water_lines_z10_12" min_zoom = 10 -max_zoom = 11 +max_zoom = 12 [[maps.layers]] name = "water_lines" -provider_layer = "osm.water_lines_z12_14" -min_zoom = 12 -max_zoom = 14 +provider_layer = "osm.water_lines_z13_15" +min_zoom = 13 +max_zoom = 15 [[maps.layers]] name = "water_lines" -provider_layer = "osm.water_lines_z15_20" -min_zoom = 15 +provider_layer = "osm.water_lines_z16_20" +min_zoom = 16 max_zoom = 20 + + From 2856c2c226aa8fb05d36ca644e826e597d52cc44 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Mon, 9 Dec 2024 07:36:45 -0500 Subject: [PATCH 3/6] Fix ref to transport_lines_z13_15 --- images/tiler-imposm/config/layers/transport_lines.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/tiler-imposm/config/layers/transport_lines.json b/images/tiler-imposm/config/layers/transport_lines.json index 14d10bf0..401b1230 100644 --- a/images/tiler-imposm/config/layers/transport_lines.json +++ b/images/tiler-imposm/config/layers/transport_lines.json @@ -49,7 +49,7 @@ "tolerance": 10 }, "transport_lines_z13_15": { - "source": "transport_lines_z14_20", + "source": "transport_lines_z16_20", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified')", "tolerance": 5 }, From 53bd0328b4bc61c72cd14bd3f36c38c9ee54fb93 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Mon, 9 Dec 2024 11:55:47 -0500 Subject: [PATCH 4/6] Update ref for transport_lines_z12 --- images/tiler-imposm/config/layers/transport_lines.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/tiler-imposm/config/layers/transport_lines.json b/images/tiler-imposm/config/layers/transport_lines.json index 401b1230..6465dc30 100644 --- a/images/tiler-imposm/config/layers/transport_lines.json +++ b/images/tiler-imposm/config/layers/transport_lines.json @@ -44,7 +44,7 @@ "tolerance": 15 }, "transport_lines_z12": { - "source": "transport_lines_z13", + "source": "transport_lines_z13_15", "sql_filter": "type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'construction', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'miniature', 'narrow_gauge', 'dismantled', 'abandoned', 'disused', 'razed', 'rail', 'light_rail', 'preserved', 'proposed', 'tram', 'funicular', 'monorail', 'taxiway', 'runway', 'raceway', 'residential', 'service', 'unclassified')", "tolerance": 10 }, From 0f4c894b956957a7c0327ddcfbac8f7bd540053d Mon Sep 17 00:00:00 2001 From: Rub21 Date: Mon, 9 Dec 2024 19:19:34 -0500 Subject: [PATCH 5/6] Fix transport lines layers --- .../config/providers/transport_lines.toml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/images/tiler-server/config/providers/transport_lines.toml b/images/tiler-server/config/providers/transport_lines.toml index f4c6a25e..a4040008 100644 --- a/images/tiler-server/config/providers/transport_lines.toml +++ b/images/tiler-server/config/providers/transport_lines.toml @@ -17,7 +17,7 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} @@ -45,7 +45,7 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} @@ -73,7 +73,7 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} @@ -101,7 +101,7 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} @@ -129,7 +129,7 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} @@ -157,7 +157,7 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} @@ -190,7 +190,7 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} @@ -222,7 +222,7 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} @@ -254,12 +254,12 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines_z13 + osm_transport_lines_z13_15 WHERE geometry && !BBOX! """ @@ -286,12 +286,12 @@ SELECT highspeed, usage, start_date, - AS end_date, + end_date, isodatetodecimaldate(pad_date(start_date, 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(end_date, 'end'), FALSE) AS end_decdate, {{LENGUAGES}} FROM - osm_transport_lines_z14_20 + osm_transport_lines_z16_20 WHERE geometry && !BBOX! """ From 483bb97d08a0c68b0517a69c930488a17395eceb Mon Sep 17 00:00:00 2001 From: Rub21 Date: Mon, 9 Dec 2024 19:34:14 -0500 Subject: [PATCH 6/6] Setting for staging/production db --- values.staging.template.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/values.staging.template.yaml b/values.staging.template.yaml index 5347d7e0..ea7a91b9 100644 --- a/values.staging.template.yaml +++ b/values.staging.template.yaml @@ -388,7 +388,7 @@ osm-seed: enabled: true env: POSTGRES_HOST: {{STAGING_TILER_DB_HOST}} - POSTGRES_DB: tiler_osm_staging # Kuberntes existing db called, tiler-osm + POSTGRES_DB: tiler_osm_production # Kuberntes existing db called, tiler-osm POSTGRES_USER: postgres POSTGRES_PASSWORD: {{STAGING_TILER_DB_PASSWORD}} POSTGRES_PORT: 5432 @@ -483,9 +483,9 @@ osm-seed: enabled: true env: TILER_IMPORT_FROM: osm - TILER_IMPORT_PBF_URL: https://s3.amazonaws.com/planet.openhistoricalmap.org/planet/planet-241202_0001.osm.pbf + TILER_IMPORT_PBF_URL: https://s3.amazonaws.com/planet.openhistoricalmap.org/planet/planet-241205_0002.osm.pbf REPLICATION_URL: http://s3.amazonaws.com/planet.openhistoricalmap.org/replication/minute/ - SEQUENCE_NUMBER: "1666000" + SEQUENCE_NUMBER: "1671000" OVERWRITE_STATE: false UPLOAD_EXPIRED_FILES: true IMPORT_NATURAL_EARTH: true @@ -496,8 +496,8 @@ osm-seed: accessMode: ReadWriteOnce mountPath: /mnt/data # In case cloudProvider: aws - AWS_ElasticBlockStore_volumeID: vol-01ae847c1263755b0 - AWS_ElasticBlockStore_size: 30Gi + AWS_ElasticBlockStore_volumeID: vol-08f7652f6ea25bc36 + AWS_ElasticBlockStore_size: 50Gi resources: enabled: false requests: @@ -515,7 +515,7 @@ osm-seed: # ==================================================================================================== tilerServer: - enabled: true + enabled: false nodeSelector: enabled: true label_key: nodegroup_type