From 51be526cdedb6e396637ccd6a6209725381f45e2 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Thu, 4 Jul 2024 11:36:36 -0500 Subject: [PATCH 1/7] Update Tiler containers --- compose/tiler.yml | 22 ++++++------- images/tiler-db/Dockerfile | 12 +++---- images/tiler-db/config/initdb_db.sh | 24 +++++--------- images/tiler-server/Dockerfile | 49 +++++++---------------------- 4 files changed, 33 insertions(+), 74 deletions(-) diff --git a/compose/tiler.yml b/compose/tiler.yml index 11d15502..11bf5686 100644 --- a/compose/tiler.yml +++ b/compose/tiler.yml @@ -1,4 +1,4 @@ -version: '3.8' +# version: '3.8' services: # ###################################################### # ### Tiler DB @@ -8,16 +8,16 @@ services: build: context: ../images/tiler-db dockerfile: Dockerfile - # ports: - # - "5433:5432" + ports: + - "5432:5432" volumes: - ../data/tiler-db-data:/var/lib/postgresql/data env_file: - ../envs/.env.tiler-db restart: always - # ###################################################### - # ### Tiler imposm for importing data - # ###################################################### + # # ###################################################### + # # ### Tiler imposm for importing data + # # ###################################################### tiler-imposm: image: osmseed-tiler-imposm:v1 build: @@ -26,12 +26,10 @@ services: volumes: - ../data/tiler-imposm-data:/mnt/data # - ../images/tiler-imposm:/osm - depends_on: - - tiler-db command: - sh - -c - - "sleep 60 && ./start.sh" + - "./start.sh" env_file: - ../envs/.env.tiler-db - ../envs/.env.tiler-imposm @@ -41,9 +39,9 @@ services: timeout: 10s retries: 3 restart: always - # ###################################################### - # ### Tiler server - # ###################################################### + # # ###################################################### + # # ### Tiler server + # # ###################################################### tiler-server: image: osmseed-tiler-server:v1 build: diff --git a/images/tiler-db/Dockerfile b/images/tiler-db/Dockerfile index fb664dd3..a1fccb72 100644 --- a/images/tiler-db/Dockerfile +++ b/images/tiler-db/Dockerfile @@ -1,11 +1,7 @@ -FROM mdillon/postgis:9.5 -RUN rm /etc/apt/sources.list.d/pgdg.list -RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list -RUN sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list -RUN sed -i '/stretch-updates/d' /etc/apt/sources.list -RUN apt-get update && apt-get -y install apt-transport-https -RUN echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main 9.5" /etc/apt/sources.list.d/pgdg.list -RUN apt-get update && apt-get install -y git ca-certificates +FROM postgis/postgis:14-3.4 +RUN apt-get update +RUN apt-get install -y git ca-certificates + COPY ./config/docker-entrypoint.sh /usr/local/bin/ RUN mkdir -p /docker-entrypoint-initdb.d COPY ./config/initdb_db.sh /docker-entrypoint-initdb.d/postgis.sh diff --git a/images/tiler-db/config/initdb_db.sh b/images/tiler-db/config/initdb_db.sh index 0f9d1ad1..0a4be078 100644 --- a/images/tiler-db/config/initdb_db.sh +++ b/images/tiler-db/config/initdb_db.sh @@ -1,20 +1,10 @@ #!/bin/sh set -e -# Create the 'template_postgis' template db -"${psql[@]}" <<- 'EOSQL' -CREATE DATABASE template_postgis; -UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'; -EOSQL - -# Load PostGIS into both template_database and $POSTGRES_DB -for DB in template_postgis "$POSTGRES_DB"; do - echo "Loading PostGIS extensions into $DB" - "${psql[@]}" --dbname="$DB" <<-'EOSQL' - CREATE EXTENSION IF NOT EXISTS postgis; - CREATE EXTENSION IF NOT EXISTS postgis_topology; - CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; - CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder; - CREATE EXTENSION IF NOT EXISTS hstore; -EOSQL -done \ No newline at end of file +# Add hstore into the DB +for DB in template_postgis "$POSTGRES_DB" "${@}"; do + echo "Updating extensions '$DB'" + psql --dbname="$DB" -c " + CREATE EXTENSION IF NOT EXISTS hstore; + " +done diff --git a/images/tiler-server/Dockerfile b/images/tiler-server/Dockerfile index 64255bff..c68da01c 100644 --- a/images/tiler-server/Dockerfile +++ b/images/tiler-server/Dockerfile @@ -1,47 +1,22 @@ -FROM golang:1.14.1-alpine3.11 AS build -ENV VERSION="v0.8.1" -RUN apk update -RUN apk add musl-dev=1.1.24-r3 \ - gcc \ - bash \ - git \ - postgresql \ - postgresql-contrib - -RUN mkdir -p /go/src/github.com/go-spatial/tegola -RUN git clone https://github.com/go-spatial/tegola.git /go/src/github.com/go-spatial/tegola -RUN cd /go/src/github.com/go-spatial/tegola && git checkout v0.13.0 -RUN cd /go/src/github.com/go-spatial/tegola/cmd/tegola \ - && go build -gcflags "-N -l" -o /opt/tegola \ - && chmod a+x /opt/tegola -RUN ln -s /opt/tegola /usr/bin/tegola +FROM gospatial/tegola:v0.20.0 -RUN apk add --update \ - python3 \ - py-pip \ - py-cffi \ - py-cryptography \ - && pip install --upgrade pip \ - && apk add --virtual build-deps \ +RUN apk --no-cache add \ gcc \ libffi-dev \ - python3-dev \ + python3 \ + py3-pip \ + py3-cffi \ + py3-cryptography \ linux-headers \ musl-dev \ openssl-dev \ - curl - -# Install aws-cli and gsutil -RUN pip3 install awscli -RUN curl -sSL https://sdk.cloud.google.com | bash -RUN ln -f -s /root/google-cloud-sdk/bin/gsutil /usr/bin/gsutil - -RUN pip3 install mercantile \ - && apk del build-deps \ - && rm -rf /var/cache/apk/* \ - && apk --purge -v del py-pip + bash \ + git \ + postgresql-client \ + coreutils \ + jq -RUN apk add --update coreutils jq && rm -rf /var/cache/apk/* +RUN pip install --upgrade pip && pip3 install awscli mercantile # Volumen VOLUME /mnt/data From 683d49676d9292fc0655e23bef6933e8e2e0cadf Mon Sep 17 00:00:00 2001 From: Rub21 Date: Thu, 4 Jul 2024 12:33:42 -0500 Subject: [PATCH 2/7] Update config for tiler server --- compose/tiler.yml | 8 +- envs/.env.tiler-imposm.example | 4 +- images/tiler-server/Dockerfile | 4 + images/tiler-server/config/config.toml | 217 ++++++++++++++++++++----- images/tiler-server/start.sh | 1 + 5 files changed, 190 insertions(+), 44 deletions(-) diff --git a/compose/tiler.yml b/compose/tiler.yml index 11bf5686..da8b16e8 100644 --- a/compose/tiler.yml +++ b/compose/tiler.yml @@ -55,10 +55,10 @@ services: - tiler-imposm ports: - "9090:9090" - command: - - sh - - -c - - "./start.sh & ./expire-watcher.sh" + # command: + # - sh + # - -c + # - "./start.sh & ./expire-watcher.sh" env_file: - ../envs/.env.tiler-db - ../envs/.env.tiler-server diff --git a/envs/.env.tiler-imposm.example b/envs/.env.tiler-imposm.example index f92de1b4..707ed23d 100644 --- a/envs/.env.tiler-imposm.example +++ b/envs/.env.tiler-imposm.example @@ -7,4 +7,6 @@ TILER_IMPORT_FROM=osm TILER_IMPORT_PBF_URL=https://download.geofabrik.de/europe/monaco-latest.osm.pbf SEQUENCE_NUMBER=4768 REPLICATION_URL=https://download.openstreetmap.fr/replication/europe/monaco/minute/ -OVERWRITE_STATE=false \ No newline at end of file +OVERWRITE_STATE=false +IMPORT_NATURAL_EARTH=true +IMPORT_OSM_LAND=true diff --git a/images/tiler-server/Dockerfile b/images/tiler-server/Dockerfile index c68da01c..e94bab73 100644 --- a/images/tiler-server/Dockerfile +++ b/images/tiler-server/Dockerfile @@ -18,6 +18,9 @@ RUN apk --no-cache add \ RUN pip install --upgrade pip && pip3 install awscli mercantile + +RUN ln -s /opt/tegola /usr/bin/tegola + # Volumen VOLUME /mnt/data # Copy config and exec files @@ -29,4 +32,5 @@ COPY ./seed-by-diffs.sh . COPY ./tile_cache_downloader.sh . COPY ./rm_tegola_ps.sh . +ENTRYPOINT ["/bin/bash", "-c"] CMD ./start.sh & ./tile_cache_downloader.sh & ./expire-watcher.sh & ./rm_tegola_ps.sh diff --git a/images/tiler-server/config/config.toml b/images/tiler-server/config/config.toml index 3b8faa16..56da2027 100644 --- a/images/tiler-server/config/config.toml +++ b/images/tiler-server/config/config.toml @@ -14,13 +14,16 @@ aws_secret_access_key = "${TILER_CACHE_AWS_SECRET_ACCESS_KEY}" # OpenStreetMap (OSM) [[providers]] +# name = "osm" +# type = "postgis" +# host = "${POSTGRES_HOST}" +# port = 5432 +# database = "${POSTGRES_DB}" +# user = "${POSTGRES_USER}" +# password = "${POSTGRES_PASSWORD}" name = "osm" type = "postgis" -host = "${POSTGRES_HOST}" -port = 5432 -database = "${POSTGRES_DB}" -user = "${POSTGRES_USER}" -password = "${POSTGRES_PASSWORD}" +uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" srid = 3857 max_connections = 40 @@ -28,185 +31,321 @@ max_connections = 40 name = "land_8-20" geometry_fieldname = "geometry" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid + FROM land_polygons + WHERE wkb_geometry && !BBOX! + """ # Water [[providers.layers]] name = "water_areas" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area FROM osm_water_areas WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, tags->'name:ar' as name_ar, type, area + FROM osm_water_areas + WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') + AND geometry && !BBOX! + """ [[providers.layers]] name = "water_areas_gen0" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area FROM osm_water_areas_gen0 WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 1000000000 AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area + FROM osm_water_areas_gen0 + WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 1000000000 + AND geometry && !BBOX! + """ [[providers.layers]] name = "water_areas_gen0_6" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area FROM osm_water_areas_gen0 WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 100000000 AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area + FROM osm_water_areas_gen0 + WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 100000000 + AND geometry && !BBOX! + """ [[providers.layers]] name = "water_areas_gen1" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area FROM osm_water_areas_gen1 WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 1000 AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area + FROM osm_water_areas_gen1 + WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 1000 + AND geometry && !BBOX! + """ [[providers.layers]] name = "water_lines" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type FROM osm_water_lines WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam') AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type + FROM osm_water_lines + WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam') + AND geometry && !BBOX! + """ [[providers.layers]] name = "water_lines_gen0" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type FROM osm_water_lines_gen0 WHERE type IN ('river', 'canal') AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type + FROM osm_water_lines_gen0 + WHERE type IN ('river', 'canal') + AND geometry && !BBOX! + """ [[providers.layers]] name = "water_lines_gen1" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type FROM osm_water_lines_gen1 WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam') AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type + FROM osm_water_lines_gen1 + WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam') + AND geometry && !BBOX! + """ [[providers.layers]] name = "admin_boundaries_8-12" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, admin_level, name, type FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8) AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, admin_level, name, type + FROM osm_admin_areas + WHERE admin_level IN (1,2,3,4,5,6,7,8) + AND geometry && !BBOX! + """ [[providers.layers]] name = "admin_boundaries_13-20" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, admin_level, name, type FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, admin_level, name, type + FROM osm_admin_areas + WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! + """ # Land Use [[providers.layers]] name = "landuse_areas" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area FROM osm_landuse_areas WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area + FROM osm_landuse_areas + WHERE geometry && !BBOX! + """ [[providers.layers]] name = "landuse_areas_gen0" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area FROM osm_landuse_areas_gen0 WHERE type IN ('forest','wood','nature reserve', 'nature_reserve', 'military') AND area > 1000000000 AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area + FROM osm_landuse_areas_gen0 + WHERE type IN ('forest','wood','nature reserve', 'nature_reserve', 'military') + AND area > 1000000000 + AND geometry && !BBOX! + """ [[providers.layers]] name = "landuse_areas_gen0_6" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area FROM osm_landuse_areas_gen0 WHERE type IN ('forest','wood','nature reserve', 'nature_reserve', 'military') AND area > 100000000 AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area + FROM osm_landuse_areas_gen0 + WHERE type IN ('forest','wood','nature reserve', 'nature_reserve', 'military') + AND area > 100000000 + AND geometry && !BBOX! + """ [[providers.layers]] name = "landuse_areas_gen1" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area FROM osm_landuse_areas_gen1 WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area + FROM osm_landuse_areas_gen1 + WHERE geometry && !BBOX! + """ # Transport [[providers.layers]] name = "transport_points" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type FROM osm_transport_points WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type + FROM osm_transport_points + WHERE geometry && !BBOX! + """ [[providers.layers]] name = "transport_areas" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type FROM osm_transport_areas WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type + FROM osm_transport_areas + WHERE geometry && !BBOX! + """ [[providers.layers]] name = "transport_lines_gen0" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, type, tunnel, bridge, ref FROM osm_transport_lines_gen0 WHERE type IN ('motorway','trunk','motorway_link','trunk_link','primary') AND tunnel = 0 AND bridge = 0 AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, type, tunnel, bridge, ref + FROM osm_transport_lines_gen0 + WHERE type IN ('motorway','trunk','motorway_link','trunk_link','primary') + AND tunnel = 0 + AND bridge = 0 + AND geometry && !BBOX! + """ [[providers.layers]] name = "transport_lines_gen1" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, ref, class, type FROM osm_transport_lines_gen1 WHERE type IN ('motorway', 'trunk', 'primary', 'primary_link', 'secondary', 'motorway_link', 'trunk_link') AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, ref, class, type + FROM osm_transport_lines_gen1 + WHERE type IN ('motorway', 'trunk', 'primary', 'primary_link', 'secondary', 'motorway_link', 'trunk_link') + AND geometry && !BBOX! + """ [[providers.layers]] name = "transport_lines_11-12" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service FROM osm_transport_lines WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'taxiway', 'runway', 'apron') AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service + FROM osm_transport_lines + WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'taxiway', 'runway', 'apron') + AND geometry && !BBOX! + """ [[providers.layers]] name = "transport_lines_13" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service FROM osm_transport_lines WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'residential', 'taxiway', 'runway', 'apron') AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service + FROM osm_transport_lines + WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'residential', 'taxiway', 'runway', 'apron') + AND geometry && !BBOX! + """ [[providers.layers]] name = "transport_lines_14-20" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service FROM osm_transport_lines WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service + FROM osm_transport_lines + WHERE geometry && !BBOX! + """ # Amenities [[providers.layers]] name = "amenity_areas" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type FROM osm_amenity_areas WHERE geometry && !BBOX!" - + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type + FROM osm_amenity_areas + WHERE geometry && !BBOX! + """ + [[providers.layers]] name = "amenity_points" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type FROM osm_amenity_points WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type + FROM osm_amenity_points + WHERE geometry && !BBOX! + """ # Other (Man Made, Historic, Military, Power, Barrier etc) [[providers.layers]] name = "other_points" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type FROM osm_other_points WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type + FROM osm_other_points + WHERE geometry && !BBOX! + """ [[providers.layers]] name = "other_lines" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type FROM osm_other_lines WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type + FROM osm_other_lines + WHERE geometry && !BBOX! + """ [[providers.layers]] name = "other_areas" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type FROM osm_other_areas WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type + FROM osm_other_areas + WHERE geometry && !BBOX! + """ [[providers.layers]] name = "other_areas_filter" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type FROM osm_other_areas WHERE area > 1000000 AND geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type + FROM osm_other_areas + WHERE area > 1000000 + AND geometry && !BBOX! + """ # Buildings [[providers.layers]] name = "buildings" geometry_fieldname = "geometry" id_fieldname = "osm_id" - sql = "SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, nullif(as_numeric(height),-1) AS height, type FROM osm_buildings WHERE geometry && !BBOX!" + sql = """ + SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, nullif(as_numeric(height),-1) AS height, type + FROM osm_buildings + WHERE geometry && !BBOX! + """ # Natural Earth [[providers]] name = "ne" type = "postgis" -host = "${POSTGRES_HOST}" -port = 5432 -database = "${POSTGRES_DB}" -user = "${POSTGRES_USER}" -password = "${POSTGRES_PASSWORD}" +# host = "${POSTGRES_HOST}" +# port = 5432 +# database = "${POSTGRES_DB}" +# user = "${POSTGRES_USER}" +# password = "${POSTGRES_PASSWORD}" +uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" srid = 3857 max_connections = 40 diff --git a/images/tiler-server/start.sh b/images/tiler-server/start.sh index d7ea9bd5..2ff78049 100755 --- a/images/tiler-server/start.sh +++ b/images/tiler-server/start.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash flag=true +mkdir -p $TILER_CACHE_BASEPATH while "$flag" = true; do pg_isready -h $POSTGRES_HOST -p 5432 >/dev/null 2>&2 || continue flag=false From fe7d797138163139ed0e8d2e08e6e7d35a4fe261 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Fri, 5 Jul 2024 10:08:08 -0500 Subject: [PATCH 3/7] Split provider layers --- .gitignore | 3 +- compose/tiler.yml | 10 +- images/tiler-server/build_config.py | 38 + .../tiler-server/config/config.template.toml | 208 +++ images/tiler-server/config/config.toml | 1625 ++++++++++++----- .../providers/admin_boundaries_areas.toml | 146 ++ .../admin_boundaries_areas.zoom.toml | 42 + .../config/providers/amenity_areas.toml | 17 + .../config/providers/amenity_points.toml | 18 + .../config/providers/buildings.toml | 19 + .../tiler-server/config/providers/land.toml | 57 + .../config/providers/land.zoom.toml | 43 + .../config/providers/landuse_areas.toml | 84 + .../config/providers/landuse_areas.zoom.toml | 23 + .../config/providers/landuse_lines.toml | 19 + .../config/providers/landuse_lines.zoom.toml | 5 + .../config/providers/landuse_points.toml | 19 + .../config/providers/landuse_points.zoom.toml | 5 + .../config/providers/other_areas.toml | 78 + .../config/providers/other_areas.zoom.toml | 24 + .../config/providers/other_lines.toml | 19 + .../config/providers/other_points.toml | 21 + .../config/providers/place_areas.toml | 18 + .../config/providers/place_points copy.toml | 19 + .../config/providers/place_points.toml | 19 + .../config/providers/transport_areas.toml | 19 + .../transport_associated_streets.toml | 24 + .../config/providers/transport_lines.toml | 160 ++ .../providers/transport_lines.zoom.toml | 29 + .../config/providers/transport_points.toml | 19 + .../config/providers/water_areas.toml | 140 ++ .../config/providers/water_areas.zoom.toml | 41 + .../config/providers/water_areas_ne.toml | 20 + .../config/providers/water_lines.toml | 121 ++ .../config/providers/water_lines.zoom.toml | 35 + 35 files changed, 2737 insertions(+), 450 deletions(-) create mode 100644 images/tiler-server/build_config.py create mode 100644 images/tiler-server/config/config.template.toml create mode 100644 images/tiler-server/config/providers/admin_boundaries_areas.toml create mode 100644 images/tiler-server/config/providers/admin_boundaries_areas.zoom.toml create mode 100644 images/tiler-server/config/providers/amenity_areas.toml create mode 100644 images/tiler-server/config/providers/amenity_points.toml create mode 100644 images/tiler-server/config/providers/buildings.toml create mode 100644 images/tiler-server/config/providers/land.toml create mode 100644 images/tiler-server/config/providers/land.zoom.toml create mode 100644 images/tiler-server/config/providers/landuse_areas.toml create mode 100644 images/tiler-server/config/providers/landuse_areas.zoom.toml create mode 100644 images/tiler-server/config/providers/landuse_lines.toml create mode 100644 images/tiler-server/config/providers/landuse_lines.zoom.toml create mode 100644 images/tiler-server/config/providers/landuse_points.toml create mode 100644 images/tiler-server/config/providers/landuse_points.zoom.toml create mode 100644 images/tiler-server/config/providers/other_areas.toml create mode 100644 images/tiler-server/config/providers/other_areas.zoom.toml create mode 100644 images/tiler-server/config/providers/other_lines.toml create mode 100644 images/tiler-server/config/providers/other_points.toml create mode 100644 images/tiler-server/config/providers/place_areas.toml create mode 100644 images/tiler-server/config/providers/place_points copy.toml create mode 100644 images/tiler-server/config/providers/place_points.toml create mode 100644 images/tiler-server/config/providers/transport_areas.toml create mode 100644 images/tiler-server/config/providers/transport_associated_streets.toml create mode 100644 images/tiler-server/config/providers/transport_lines.toml create mode 100644 images/tiler-server/config/providers/transport_lines.zoom.toml create mode 100644 images/tiler-server/config/providers/transport_points.toml create mode 100644 images/tiler-server/config/providers/water_areas.toml create mode 100644 images/tiler-server/config/providers/water_areas.zoom.toml create mode 100644 images/tiler-server/config/providers/water_areas_ne.toml create mode 100644 images/tiler-server/config/providers/water_lines.toml create mode 100644 images/tiler-server/config/providers/water_lines.zoom.toml diff --git a/.gitignore b/.gitignore index 4c32d0b3..950167dc 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,5 @@ overpass-api-db/ data/*/ !data/README.md images/changeset-replication-job/config.yaml -values_copy.yaml \ No newline at end of file +values_copy.yaml +images/tiler-server/tegola-cache/ \ No newline at end of file diff --git a/compose/tiler.yml b/compose/tiler.yml index da8b16e8..5f676b40 100644 --- a/compose/tiler.yml +++ b/compose/tiler.yml @@ -48,17 +48,17 @@ services: context: ../images/tiler-server dockerfile: Dockerfile volumes: - - ../data/tiler-server-data:/mnt/data + - ../images/tiler-server:/app - ../data/tiler-imposm-data:/mnt/data/imposm depends_on: - tiler-db - tiler-imposm ports: - "9090:9090" - # command: - # - sh - # - -c - # - "./start.sh & ./expire-watcher.sh" + command: + - sh + - -c + - "./start.sh" env_file: - ../envs/.env.tiler-db - ../envs/.env.tiler-server diff --git a/images/tiler-server/build_config.py b/images/tiler-server/build_config.py new file mode 100644 index 00000000..5377696a --- /dev/null +++ b/images/tiler-server/build_config.py @@ -0,0 +1,38 @@ +import os +import argparse +parser = argparse.ArgumentParser(description='Merge TOML files into a configuration file.') +parser.add_argument('--template', default='config/config.template.toml', help='Path to the configuration template file.') +parser.add_argument('--providers', default='config/providers', help='Directory containing provider TOML files.') +parser.add_argument('--output', default='config/config.toml', help='Output configuration file path.') +args = parser.parse_args() + +config_template_file = args.template +providers_dir = args.providers +output_file_path = args.output +toml_files = [file for file in os.listdir(providers_dir) if file.endswith(".toml")] + +# Read TOML files +new_configs = {} +for toml_file in toml_files: + dir_toml_file = os.path.join(providers_dir, toml_file) + with open(dir_toml_file, "r") as file: + new_configs[dir_toml_file] = file.read() + +with open(config_template_file, "r") as main_file: + content = main_file.read() + +# Replace the content of main.toml with the content read from other TOML files +for toml_file, toml_file_content in new_configs.items(): + print(f"Copy {toml_file} to config.toml") + section_header = "[['{}']]".format(toml_file.replace("config/", "")) + indentation_level = content.find(section_header) + if indentation_level != -1: + # Find the appropriate number of tabs or spaces for indentation + preceding_newline = content.rfind('\n', 0, indentation_level) + indentation = content[preceding_newline + 1:indentation_level] + toml_file_content = f"###### From {toml_file} \n" + toml_file_content + new_values=toml_file_content.replace("\n", "\n" + indentation) + content = content.replace(section_header, new_values) + +with open(output_file_path, "w") as output_file: + output_file.write(content) diff --git a/images/tiler-server/config/config.template.toml b/images/tiler-server/config/config.template.toml new file mode 100644 index 00000000..80ed7ef1 --- /dev/null +++ b/images/tiler-server/config/config.template.toml @@ -0,0 +1,208 @@ +[webserver] +port = ":${TILER_SERVER_PORT}" + + [webserver.headers] + Access-Control-Allow-Origin = "*" + +# Tegola offers three tile caching strategies: "file", "redis", and "s3" +[cache] +type = "${TILER_CACHE_TYPE}" +basepath ="${TILER_CACHE_BASEPATH}" +max_zoom = "${TILER_CACHE_MAX_ZOOM}" + +bucket = "${TILER_CACHE_BUCKET}" +region = "${TILER_CACHE_REGION}" +aws_access_key_id = "${TILER_CACHE_AWS_ACCESS_KEY_ID}" +aws_secret_access_key = "${TILER_CACHE_AWS_SECRET_ACCESS_KEY}" + +# metrics +[observer] +type = "prometheus" + +# OpenStreetMap (OSM) +[[providers]] +name = "osm" +type = "mvt_postgis" +uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" +# srid = 3857 +max_connections = 200 + ###### Land providers + [['providers/land.toml']] + + ###### Water areas and lines + [['providers/water_areas.toml']] + + [['providers/water_lines.toml']] + + ###### Water areas NE + [['providers/water_areas_ne.toml']] + + ###### Admin boundaries providers + [['providers/admin_boundaries_areas.toml']] + + ###### Land use areas + [['providers/landuse_areas.toml']] + + ###### Land use lines and points + [['providers/landuse_lines.toml']] + [['providers/landuse_points.toml']] + + ###### Transport lines, points and areas from ways + [['providers/transport_points.toml']] + [['providers/transport_lines.toml']] + [['providers/transport_areas.toml']] + + ###### Amenities areas and points + [['providers/amenity_areas.toml']] + [['providers/amenity_points.toml']] + + ###### Place points and areas + [['providers/place_points.toml']] + [['providers/place_areas.toml']] + + ###### Other (Man Made, Historic, Military, Power, Barrier etc) + [['providers/other_points.toml']] + [['providers/other_lines.toml']] + [['providers/other_areas.toml']] + + ###### Buildings + [['providers/buildings.toml']] + + ###### transport_associated_streets + [['providers/transport_associated_streets.toml']] + +# Natural Earth (ne) +[[providers]] +name = "ne" +type = "mvt_postgis" +uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" + +# srid = 3857 +max_connections = 200 + ###### Water lands ne + [['providers/water_areas_ne.toml']] + +[[maps]] +name = "osm" +attribution = "OpenStreetMap" +center = [-74.275329586789, -12.153492567373, 8.0] + ###### Land + [['providers/land.zoom.toml']] + + ##### Admin boundaries display zooms + [['providers/admin_boundaries_areas.zoom.toml']] + + ###### Land Use + [['providers/landuse_areas.zoom.toml']] + [['providers/landuse_lines.zoom.toml']] + [['providers/landuse_points.zoom.toml']] + + ###### Water areas/lines + [['providers/water_areas.zoom.toml']] + [['providers/water_lines.zoom.toml']] + + # Transport Lines (Roads, Rail, Aviation) + [['providers/transport_lines.zoom.toml']] + [['providers/route_lines.zoom.toml']] + + ###### admin_boundaries_maritime + [['providers/admin_boundaries_maritime.zoom.toml']] + + # Transport Areas + [[maps.layers]] + name = "transport_areas" + provider_layer = "osm.transport_areas" + min_zoom = 12 + max_zoom = 20 + + # Transport Points + [[maps.layers]] + name = "transport_points" + provider_layer = "osm.transport_points" + min_zoom = 14 + max_zoom = 20 + + # Amenity Areas + [[maps.layers]] + name = "amenity_areas" + provider_layer = "osm.amenity_areas" + min_zoom = 14 + max_zoom = 20 + + + + # Amenity Points + [[maps.layers]] + name = "amenity_points" + provider_layer = "osm.amenity_points" + min_zoom = 14 + max_zoom = 20 + + # Place Points + [[maps.layers]] + name = "place_points" + provider_layer = "osm.place_points" + min_zoom = 1 + max_zoom = 20 + + # Place areas + [[maps.layers]] + name = "place_areas" + provider_layer = "osm.place_areas" + min_zoom = 14 + max_zoom = 20 + + # Other Points + [[maps.layers]] + name = "other_points" + provider_layer = "osm.other_points" + min_zoom = 14 + max_zoom = 20 + + # Other Lines + [[maps.layers]] + name = "other_lines" + provider_layer = "osm.other_lines" + min_zoom = 14 + max_zoom = 20 + + # Other Areas + [['providers/other_areas.zoom.toml']] + + # Buildings + [[maps.layers]] + name = "buildings" + provider_layer = "osm.buildings" + min_zoom = 14 + max_zoom = 20 + + + [[maps.layers]] + name = "transport_associated_streets" + provider_layer = "osm.transport_associated_streets" + min_zoom = 7 + max_zoom = 20 + + +[[maps]] +name = "ne" +attribution = "Natural Earth" +center = [-74.275329586789, -12.153492567373, 8.0] + # Water lakes Natural Earth + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.ne_water_lakes_0-2" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.ne_water_lakes_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.ne_water_lakes_6-8" + min_zoom = 6 + max_zoom = 8 diff --git a/images/tiler-server/config/config.toml b/images/tiler-server/config/config.toml index 56da2027..23f63719 100644 --- a/images/tiler-server/config/config.toml +++ b/images/tiler-server/config/config.toml @@ -1,6 +1,9 @@ [webserver] port = ":${TILER_SERVER_PORT}" + [webserver.headers] + Access-Control-Allow-Origin = "*" + # Tegola offers three tile caching strategies: "file", "redis", and "s3" [cache] type = "${TILER_CACHE_TYPE}" @@ -12,727 +15,1399 @@ region = "${TILER_CACHE_REGION}" aws_access_key_id = "${TILER_CACHE_AWS_ACCESS_KEY_ID}" aws_secret_access_key = "${TILER_CACHE_AWS_SECRET_ACCESS_KEY}" -# OpenStreetMap (OSM) +# metrics +[observer] +type = "prometheus" + +# OpenStreetMap (OSM) [[providers]] -# name = "osm" -# type = "postgis" -# host = "${POSTGRES_HOST}" -# port = 5432 -# database = "${POSTGRES_DB}" -# user = "${POSTGRES_USER}" -# password = "${POSTGRES_PASSWORD}" name = "osm" -type = "postgis" +type = "mvt_postgis" uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" -srid = 3857 -max_connections = 40 - +# srid = 3857 +max_connections = 200 + ###### Land providers + ###### From config/providers/land.toml + # Simplification for geometries + # 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 = "land_8-20" + name = "land_0-2" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = """ - SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid - FROM land_polygons - WHERE wkb_geometry && !BBOX! - """ + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!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, 200),!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, 70),!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, 30),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_10-12" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 10),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[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 + ###### Water areas and lines + ###### From config/providers/water_areas.toml [[providers.layers]] - name = "water_areas" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "osm_id" + name = "water_areas_gen0_0-2" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, tags->'name:ar' as name_ar, type, area - FROM osm_water_areas - WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 10000), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area + FROM + osm_water_areas_gen0 + WHERE + type IN ('water', 'riverbank') + AND area > 100000000 + AND geometry && !BBOX! """ - + [[providers.layers]] - name = "water_areas_gen0" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "osm_id" + name = "water_areas_gen0_3-5" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area - FROM osm_water_areas_gen0 - WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') - AND area > 1000000000 - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1000), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area + FROM + osm_water_areas_gen0 + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 50000000 + AND geometry && !BBOX! """ - + + # Water bodies > 1,000,000 sqm [[providers.layers]] - name = "water_areas_gen0_6" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "osm_id" + name = "water_areas_gen0_6-7" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area - FROM osm_water_areas_gen0 - WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') - AND area > 100000000 - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area + FROM + osm_water_areas_gen0 + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 1000000 + AND geometry && !BBOX! """ - + + # Water bodies > 10,000 sqm [[providers.layers]] - name = "water_areas_gen1" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "osm_id" + name = "water_areas_gen0_8-9" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type, area - FROM osm_water_areas_gen1 - WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') - AND area > 1000 - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area + FROM + osm_water_areas_gen0 + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 10000 + AND geometry && !BBOX! """ - + [[providers.layers]] - name = "water_lines" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "osm_id" + name = "water_areas_gen1_10-12" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type - FROM osm_water_lines - WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam') - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 50), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area + FROM + osm_water_areas_gen1 + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND geometry && !BBOX! """ - + [[providers.layers]] - name = "water_lines_gen0" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" + name = "water_areas_13-15" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type - FROM osm_water_lines_gen0 - WHERE type IN ('river', 'canal') - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 5), !BBOX!) AS geometry, + id, + osm_id, + name, + type, + area + FROM + osm_water_areas + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') + AND geometry && !BBOX! """ - + [[providers.layers]] - name = "water_lines_gen1" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" + name = "water_areas_16-20" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type - FROM osm_water_lines_gen1 - WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam') - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + area + FROM + osm_water_areas + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') + AND geometry && !BBOX! """ + + ###### From config/providers/water_lines.toml + # Simplification for geometries + [[providers.layers]] - name = "admin_boundaries_8-12" geometry_fieldname = "geometry" + geometry_type = "linestring" id_fieldname = "osm_id" + name = "water_lines_gen0_6-6" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, admin_level, name, type - FROM osm_admin_areas - WHERE admin_level IN (1,2,3,4,5,6,7,8) - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge + FROM + osm_water_lines_gen0 + WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! """ - + [[providers.layers]] - name = "admin_boundaries_13-20" geometry_fieldname = "geometry" + geometry_type = "linestring" id_fieldname = "osm_id" + name = "water_lines_gen0_7-7" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, admin_level, name, type - FROM osm_admin_areas - WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1000), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge + FROM + osm_water_lines_gen0 + WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! """ - - # Land Use + [[providers.layers]] - name = "landuse_areas" geometry_fieldname = "geometry" + geometry_type = "linestring" id_fieldname = "osm_id" + name = "water_lines_gen0_8-8" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area - FROM osm_landuse_areas - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge + FROM + osm_water_lines_gen0 + WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! """ - + [[providers.layers]] - name = "landuse_areas_gen0" geometry_fieldname = "geometry" + geometry_type = "linestring" id_fieldname = "osm_id" + name = "water_lines_gen0_9-9" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area - FROM osm_landuse_areas_gen0 - WHERE type IN ('forest','wood','nature reserve', 'nature_reserve', 'military') - AND area > 1000000000 - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge + FROM + osm_water_lines_gen0 + WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! """ - + + [[providers.layers]] - name = "landuse_areas_gen0_6" geometry_fieldname = "geometry" + geometry_type = "linestring" id_fieldname = "osm_id" + name = "water_lines_gen1_10-11" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area - FROM osm_landuse_areas_gen0 - WHERE type IN ('forest','wood','nature reserve', 'nature_reserve', 'military') - AND area > 100000000 - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 20), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge, + tags->'surface' AS surface + FROM + osm_water_lines_gen1 + WHERE + type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') + AND geometry && !BBOX! """ - + [[providers.layers]] - name = "landuse_areas_gen1" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "linestring" + id_fieldname = "id" + name = "water_lines" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type, area - FROM osm_landuse_areas_gen1 - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'bridge' AS bridge, + tags->'surface' AS surface, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date + FROM + osm_water_lines + WHERE + type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') + AND geometry && !BBOX! """ - # Transport + ###### Water areas NE + ###### From config/providers/water_areas_ne.toml [[providers.layers]] - name = "transport_points" + name = "ne_water_lakes_0-2" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1000),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "ne_water_lakes_3-5" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "ne_water_lakes_6-8" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 100),!BBOX!) AS geometry, name, ogc_fid FROM ne_10m_lakes WHERE wkb_geometry && !BBOX!" + + + ###### Admin boundaries providers + ###### From config/providers/admin_boundaries_areas.toml + # Layer configuration for admin boundaries 0-2 + [[providers.layers]] + name = "admin_boundaries_0-2" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type - FROM osm_transport_points - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type + FROM + osm_admin_areas + WHERE + admin_level IN (1,2) + AND geometry && !BBOX! """ - + + # Layer configuration for admin boundaries 3-5 [[providers.layers]] - name = "transport_areas" + name = "admin_boundaries_3-5" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type - FROM osm_transport_areas - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 200), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4) + AND geometry && !BBOX! """ - + + # Layer configuration for admin boundaries 6-7 [[providers.layers]] - name = "transport_lines_gen0" + name = "admin_boundaries_6-7" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, type, tunnel, bridge, ref - FROM osm_transport_lines_gen0 - WHERE type IN ('motorway','trunk','motorway_link','trunk_link','primary') - AND tunnel = 0 - AND bridge = 0 - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6) + AND geometry && !BBOX! """ - + + # Layer configuration for admin boundaries 8-9 [[providers.layers]] - name = "transport_lines_gen1" + name = "admin_boundaries_8-9" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, ref, class, type - FROM osm_transport_lines_gen1 - WHERE type IN ('motorway', 'trunk', 'primary', 'primary_link', 'secondary', 'motorway_link', 'trunk_link') - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 50), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6,7,8,9) + AND geometry && !BBOX! """ - + + # Layer configuration for admin boundaries 10-12 [[providers.layers]] - name = "transport_lines_11-12" + name = "admin_boundaries_10-12" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service - FROM osm_transport_lines - WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'taxiway', 'runway', 'apron') - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 20), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! """ - + + # Layer configuration for admin boundaries 13-15 [[providers.layers]] - name = "transport_lines_13" + name = "admin_boundaries_13-15" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service - FROM osm_transport_lines - WHERE type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'residential', 'taxiway', 'runway', 'apron') - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 5), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! """ - + + # Layer configuration for admin boundaries 16-20 [[providers.layers]] - name = "transport_lines_14-20" + name = "admin_boundaries_16-20" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, ref, class, type, tunnel, bridge, access, service - FROM osm_transport_lines - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! """ + - # Amenities + ###### Land use areas + ###### From config/providers/landuse_areas.toml + # Layer 50,000,000 [[providers.layers]] - name = "amenity_areas" + name = "landuse_areas_gen0_3-5" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "osm_id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type - FROM osm_amenity_areas - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area + FROM + osm_landuse_areas_gen0 + WHERE + type IN ('forest', 'wood', 'nature reserve', 'nature_reserve', 'military') + AND area > 50000000 + AND geometry && !BBOX! """ - + + # Layer 1,000,000 [[providers.layers]] - name = "amenity_points" + name = "landuse_areas_gen0_6-9" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "osm_id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, type - FROM osm_amenity_points - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area + FROM + osm_landuse_areas_gen0 + WHERE + type IN ('forest', 'wood', 'nature reserve', 'nature_reserve', 'military') + AND area > 1000000 + AND geometry && !BBOX! """ - - # Other (Man Made, Historic, Military, Power, Barrier etc) + + # Layer configuration for landuse areas gen1 [[providers.layers]] - name = "other_points" + name = "landuse_areas_gen1_10-12" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "osm_id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type - FROM osm_other_points - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area + FROM + osm_landuse_areas_gen1 + WHERE + geometry && !BBOX! """ - + # Layer configuration for landuse areas [[providers.layers]] - name = "other_lines" + name = "landuse_areas_13-20" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "multipolygon" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type - FROM osm_other_lines - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'wetland' AS wetland, + area + FROM + osm_landuse_areas + WHERE + geometry && !BBOX! """ + + ###### Land use lines and points + ###### From config/providers/landuse_lines.toml + # Layer configuration for landuse lines [[providers.layers]] - name = "other_areas" + name = "landuse_lines" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "linestring" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type - FROM osm_other_areas - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_landuse_lines + WHERE + geometry && !BBOX! """ - + + ###### From config/providers/landuse_points.toml + # Layer configuration for landuse points [[providers.layers]] - name = "other_areas_filter" + name = "landuse_points" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "point" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, class, type - FROM osm_other_areas - WHERE area > 1000000 - AND geometry && !BBOX! + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_landuse_points + WHERE + geometry && !BBOX! """ + - # Buildings + ###### Transport lines, points and areas from ways + ###### From config/providers/transport_points.toml + # Layer configuration for transport points [[providers.layers]] - name = "buildings" + name = "transport_points" geometry_fieldname = "geometry" - id_fieldname = "osm_id" + geometry_type = "point" + id_fieldname = "id" sql = """ - SELECT ST_AsBinary(geometry) AS geometry, osm_id, name, nullif(as_numeric(height),-1) AS height, type - FROM osm_buildings - WHERE geometry && !BBOX! + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_transport_points + WHERE + geometry && !BBOX! """ - -# Natural Earth -[[providers]] -name = "ne" -type = "postgis" -# host = "${POSTGRES_HOST}" -# port = 5432 -# database = "${POSTGRES_DB}" -# user = "${POSTGRES_USER}" -# password = "${POSTGRES_PASSWORD}" -uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" -srid = 3857 -max_connections = 40 - + + ###### From config/providers/transport_lines.toml + # Layer configuration for transport lines gen0 [[providers.layers]] - name = "ne_110m_populated_places" + name = "transport_lines_gen0" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, scalerank, labelrank, name, min_zoom, featurecla, rank_max FROM ne_110m_populated_places WHERE wkb_geometry && !BBOX!" - + geometry_type = "linestring" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + type, + tunnel, + bridge, + ref, + service, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage + FROM + osm_transport_lines_gen0 + WHERE + type IN ('motorway', 'trunk', 'motorway_link', 'trunk_link', 'primary') + AND tunnel = 0 + AND bridge = 0 + AND geometry && !BBOX! + """ + + # Layer configuration for transport lines gen1 [[providers.layers]] - name = "ne_50m_populated_places" + name = "transport_lines_gen1" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, scalerank, labelrank, name, min_zoom, featurecla, rank_max FROM ne_50m_populated_places WHERE wkb_geometry && !BBOX!" - + geometry_type = "linestring" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + ref, + class, + type, + service, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage + FROM + osm_transport_lines_gen1 + WHERE + type IN ( + 'motorway', 'trunk', 'primary', 'primary_link', 'secondary', + 'motorway_link', 'trunk_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', + 'funicular', 'taxiway', 'runway', 'proposed', 'construction', + 'disused', 'abandoned', 'razed', 'ferry' + ) + AND geometry && !BBOX! + """ + + # Layer configuration for transport lines 11-12 [[providers.layers]] - name = "ne_10m_populated_places" + name = "transport_lines_11-12" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, scalerank, labelrank, name, min_zoom, featurecla, rank_max FROM ne_10m_populated_places WHERE wkb_geometry && !BBOX!" - + geometry_type = "linestring" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage + FROM + osm_transport_lines + WHERE + type IN ( + 'motorway', 'motorway_link', 'trunk', 'trunk_link', + 'primary', 'primary_link', 'secondary', 'secondary_link', + 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', + 'funicular', 'taxiway', 'runway', 'proposed', 'construction', + 'disused', 'abandoned', 'razed', 'apron', 'ferry' + ) + AND geometry && !BBOX! + """ + + # Layer configuration for transport lines 13 [[providers.layers]] - name = "ne_10m_admin_0_label_points" + name = "transport_lines_13" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, sr_subunit, scalerank FROM ne_10m_admin_0_label_points WHERE wkb_geometry && !BBOX!" - + geometry_type = "linestring" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage + FROM + osm_transport_lines + WHERE + type IN ( + 'motorway', 'motorway_link', 'trunk', 'trunk_link', + 'primary', 'primary_link', 'secondary', 'secondary_link', + 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', + 'miniature', 'funicular', 'taxiway', 'runway', 'residential', + 'taxiway', 'runway', 'proposed', 'construction', 'disused', + 'abandoned', 'razed', 'apron', 'ferry' + ) + AND geometry && !BBOX! + """ + + # Layer configuration for transport lines 14-20 [[providers.layers]] - name = "ne_10m_admin_1_label_points" + name = "transport_lines_14-20" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, name, scalerank FROM ne_10m_admin_1_label_points WHERE wkb_geometry && !BBOX!" - + geometry_type = "linestring" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'usage' AS usage + FROM + osm_transport_lines + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/transport_areas.toml [[providers.layers]] - name = "ne_110m_admin_0_boundary_lines_land" + name = "transport_areas" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, min_zoom FROM ne_110m_admin_0_boundary_lines_land WHERE wkb_geometry && !BBOX!" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + area + FROM + osm_transport_areas + WHERE + geometry && !BBOX! + """ + + ###### Amenities areas and points + ###### From config/providers/amenity_areas.toml + # Layer configuration for amenity areas [[providers.layers]] - name = "ne_50m_admin_0_boundary_lines_land" + name = "amenity_areas" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, min_zoom FROM ne_50m_admin_0_boundary_lines_land WHERE wkb_geometry && !BBOX!" - + geometry_type = "multipolygon" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + name, + type + FROM + osm_amenity_areas + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/amenity_points.toml + # Layer configuration for amenity points [[providers.layers]] - name = "ne_10m_admin_0_boundary_lines_land" + name = "amenity_points" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, min_zoom FROM ne_10m_admin_0_boundary_lines_land WHERE wkb_geometry && !BBOX!" + geometry_type = "point" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type + FROM + osm_amenity_points + WHERE + geometry && !BBOX! + """ + + ###### Place points and areas + ###### From config/providers/place_points.toml + # Layer configuration for place points [[providers.layers]] - name = "ne_50m_admin_0_boundary_lines_disputed_areas" + name = "place_points" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, min_zoom FROM ne_50m_admin_0_boundary_lines_disputed_areas WHERE wkb_geometry && !BBOX!" - + geometry_type = "point" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'capital' AS capital + FROM + osm_place_points + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/place_areas.toml + # Layer configuration for place areas [[providers.layers]] - name = "ne_10m_admin_0_boundary_lines_disputed_areas" + name = "place_areas" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, min_zoom FROM ne_10m_admin_0_boundary_lines_disputed_areas WHERE wkb_geometry && !BBOX!" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type + FROM + osm_place_areas + WHERE + geometry && !BBOX! + """ + + ###### Other (Man Made, Historic, Military, Power, Barrier etc) + ###### From config/providers/other_points.toml + # Layer configuration for other points [[providers.layers]] - name = "ne_110m_admin_0_countries" + name = "other_points" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label FROM ne_110m_admin_0_countries WHERE wkb_geometry && !BBOX!" - + geometry_type = "point" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'artwork_type' AS artwork_type, + tags->'site_type' AS site_type + FROM + osm_other_points + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/other_lines.toml + # Layer configuration for other lines [[providers.layers]] - name = "ne_50m_admin_0_countries" + name = "other_lines" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label FROM ne_50m_admin_0_countries WHERE wkb_geometry && !BBOX!" - + geometry_type = "linestring" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_other_lines + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/other_areas.toml [[providers.layers]] - name = "ne_10m_admin_0_countries" + name = "other_areas_6-8" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label FROM ne_10m_admin_0_countries WHERE wkb_geometry && !BBOX!" - + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_other_areas + WHERE + area > 1000000 + AND geometry && !BBOX! + """ + [[providers.layers]] - name = "ne_110m_admin_1_states_provinces_lines" - geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom FROM ne_110m_admin_1_states_provinces_lines WHERE wkb_geometry && !BBOX!" - - [[providers.layers]] - name = "ne_50m_admin_1_states_provinces_lines" + name = "other_areas_9-11" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom FROM ne_50m_admin_1_states_provinces_lines WHERE wkb_geometry && !BBOX!" - + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_other_areas + WHERE + area > 100000 + AND geometry && !BBOX! + """ + [[providers.layers]] - name = "ne_10m_admin_1_states_provinces_lines" + name = "other_areas_12-14" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom, min_label FROM ne_10m_admin_1_states_provinces_lines WHERE wkb_geometry && !BBOX!" - + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_other_areas + WHERE + area > 10000 + AND geometry && !BBOX! + """ + [[providers.layers]] - name = "ne_110m_land" + name = "other_areas_15-20" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, min_zoom FROM ne_110m_land WHERE wkb_geometry && !BBOX!" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_other_areas + WHERE + geometry && !BBOX! + """ + ###### Buildings + ###### From config/providers/buildings.toml + # Layer configuration for buildings [[providers.layers]] - name = "ne_50m_land" + name = "buildings" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, min_zoom FROM ne_50m_land WHERE wkb_geometry && !BBOX!" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + nullif(as_numeric(height), -1) AS height, + type + FROM + osm_buildings + WHERE + geometry && !BBOX! + """ + + ###### transport_associated_streets + ###### From config/providers/transport_associated_streets.toml + # Layer configuration for transport associated streets [[providers.layers]] - name = "ne_10m_land" + name = "transport_associated_streets" geometry_fieldname = "geometry" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, min_zoom FROM ne_10m_land WHERE wkb_geometry && !BBOX!" + geometry_type = "LineString" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + r.id, + m.member, + r.osm_id, + m.name, + m.relname, + m.index, + r.type + FROM + osm_relations r, + osm_relation_members m + WHERE + r.osm_id = m.osm_id + AND r.type = 'associatedStreet' + AND geometry && !BBOX! + """ + + +# Natural Earth (ne) +[[providers]] +name = "ne" +type = "mvt_postgis" +uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" +# srid = 3857 +max_connections = 200 + ###### Water lands ne + ###### From config/providers/water_areas_ne.toml [[providers.layers]] - name = "ne_50m_admin_1_states_provinces_lakes" + name = "ne_water_lakes_0-2" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, featurecla, name, postal, min_zoom, min_label FROM ne_50m_admin_1_states_provinces_lakes WHERE wkb_geometry && !BBOX!" - + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1000),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + [[providers.layers]] - name = "ne_10m_roads_3" + name = "ne_water_lakes_3-5" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, name, min_zoom, min_label, type, label FROM ne_10m_roads WHERE min_zoom < 5 AND type <> 'Ferry Route' AND wkb_geometry && !BBOX!" - + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + [[providers.layers]] - name = "ne_10m_roads_5" + name = "ne_water_lakes_6-8" geometry_fieldname = "geometry" + geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsBinary(wkb_geometry) AS geometry, ogc_fid, name, min_zoom, min_label, type, label FROM ne_10m_roads WHERE min_zoom <= 7 AND type <> 'Ferry Route' AND wkb_geometry && !BBOX!" - + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 100),!BBOX!) AS geometry, name, ogc_fid FROM ne_10m_lakes WHERE wkb_geometry && !BBOX!" + [[maps]] name = "osm" -attribution = "OpenStreetMap" # map attribution -center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part of the TileJSON spec - +attribution = "OpenStreetMap" +center = [-74.275329586789, -12.153492567373, 8.0] + ###### Land + ###### From config/providers/land.zoom.toml [[maps.layers]] - name = "populated_places" - provider_layer = "ne.ne_110m_populated_places" + name = "land" + provider_layer = "osm.land_0-2" min_zoom = 0 max_zoom = 2 - + [[maps.layers]] - name = "populated_places" - provider_layer = "ne.ne_50m_populated_places" + name = "land" + provider_layer = "osm.land_3-5" min_zoom = 3 - max_zoom = 4 - - [[maps.layers]] - name = "populated_places" - provider_layer = "ne.ne_10m_populated_places" - min_zoom = 5 - max_zoom = 20 - - [[maps.layers]] - name = "country_lines" - provider_layer = "ne.ne_110m_admin_0_boundary_lines_land" - min_zoom = 0 - max_zoom = 2 - + max_zoom = 5 + [[maps.layers]] - name = "country_lines" - provider_layer = "ne.ne_50m_admin_0_boundary_lines_land" - dont_simplify = true - min_zoom = 3 - max_zoom = 4 - + name = "land" + provider_layer = "osm.land_6-7" + min_zoom = 6 + max_zoom = 7 + [[maps.layers]] - name = "country_lines" - provider_layer = "ne.ne_10m_admin_0_boundary_lines_land" - min_zoom = 5 - max_zoom = 10 - + name = "land" + provider_layer = "osm.land_8-9" + min_zoom = 8 + max_zoom = 9 + [[maps.layers]] - name = "country_lines_disputed" - provider_layer = "ne.ne_50m_admin_0_boundary_lines_disputed_areas" - min_zoom = 3 - max_zoom = 4 - + name = "land" + provider_layer = "osm.land_10-12" + min_zoom = 10 + max_zoom = 12 + [[maps.layers]] - name = "country_lines_disputed" - provider_layer = "ne.ne_10m_admin_0_boundary_lines_disputed_areas" - min_zoom = 5 - max_zoom = 10 - + name = "land" + provider_layer = "osm.land_13-15" + min_zoom = 13 + max_zoom = 15 + [[maps.layers]] - name = "country_label_points" - provider_layer = "ne.ne_10m_admin_0_label_points" - min_zoom = 3 + name = "land" + provider_layer = "osm.land_16-20" + min_zoom = 16 max_zoom = 20 + + + + ##### Admin boundaries display zooms + ###### From config/providers/admin_boundaries_areas.zoom.toml + # Admin Bounduaries Areas [[maps.layers]] - name = "country_polygons" - provider_layer = "ne.ne_110m_admin_0_countries" - min_zoom = 0 - max_zoom = 2 - - [[maps.layers]] - name = "country_polygons" - provider_layer = "ne.ne_50m_admin_0_countries" - min_zoom = 3 - max_zoom = 4 - - [[maps.layers]] - name = "country_polygons" - provider_layer = "ne.ne_10m_admin_0_countries" - min_zoom = 5 - max_zoom = 10 - - [[maps.layers]] - name = "state_lines" - provider_layer = "ne.ne_110m_admin_1_states_provinces_lines" + name = "land_osm" + provider_layer = "osm.admin_boundaries_0-2" min_zoom = 0 max_zoom = 2 - + [[maps.layers]] - name = "state_lines" - provider_layer = "ne.ne_50m_admin_1_states_provinces_lines" + name = "land_osm" + provider_layer = "osm.admin_boundaries_3-5" min_zoom = 3 - max_zoom = 4 - - [[maps.layers]] - name = "state_lines" - provider_layer = "ne.ne_10m_admin_1_states_provinces_lines" - min_zoom = 5 - max_zoom = 10 - - # Land Polygons - [[maps.layers]] - name = "land" - provider_layer = "ne.ne_110m_land" - min_zoom = 0 - max_zoom = 2 - - [[maps.layers]] - name = "land" - provider_layer = "ne.ne_50m_land" - min_zoom = 3 - max_zoom = 4 - + max_zoom = 5 + [[maps.layers]] - name = "land" - provider_layer = "ne.ne_10m_land" - min_zoom = 5 + name = "land_osm" + provider_layer = "osm.admin_boundaries_6-7" + min_zoom = 6 max_zoom = 7 - + [[maps.layers]] - name = "land" - provider_layer = "osm.land_8-20" - dont_simplify = true + name = "land_osm" + provider_layer = "osm.admin_boundaries_8-9" min_zoom = 8 - max_zoom = 20 - + max_zoom = 9 + [[maps.layers]] - name = "admin_lines" - provider_layer = "osm.admin_boundaries_8-12" - min_zoom = 8 + name = "land_osm" + provider_layer = "osm.admin_boundaries_10-12" + min_zoom = 10 max_zoom = 12 - + [[maps.layers]] - name = "admin_lines" - provider_layer = "osm.admin_boundaries_13-20" + name = "land_osm" + provider_layer = "osm.admin_boundaries_13-15" min_zoom = 13 - max_zoom = 20 - + max_zoom = 15 + [[maps.layers]] - name = "state_label_points" - provider_layer = "ne.ne_10m_admin_1_label_points" - min_zoom = 3 + name = "land_osm" + provider_layer = "osm.admin_boundaries_16-20" + min_zoom = 16 max_zoom = 20 - # Land Use + ###### Land Use + ###### From config/providers/landuse_areas.zoom.toml [[maps.layers]] name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen0" + provider_layer = "osm.landuse_areas_gen0_3-5" min_zoom = 3 max_zoom = 5 - + [[maps.layers]] name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen0_6" + provider_layer = "osm.landuse_areas_gen0_6-9" min_zoom = 6 max_zoom = 9 - + [[maps.layers]] name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen1" + provider_layer = "osm.landuse_areas_gen1_10-12" min_zoom = 10 max_zoom = 12 - + [[maps.layers]] name = "landuse_areas" - provider_layer = "osm.landuse_areas" + provider_layer = "osm.landuse_areas_13-20" min_zoom = 13 max_zoom = 20 + + ###### From config/providers/landuse_lines.zoom.toml + [[maps.layers]] + name = "landuse_lines" + provider_layer = "osm.landuse_lines" + min_zoom = 14 + max_zoom = 20 + ###### From config/providers/landuse_points.zoom.toml + [[maps.layers]] + name = "landuse_points" + provider_layer = "osm.landuse_points" + min_zoom = 6 + max_zoom = 20 - # Water Areas + ###### Water areas/lines + ###### From config/providers/water_areas.zoom.toml [[maps.layers]] name = "water_areas" - provider_layer = "osm.water_areas_gen0" + provider_layer = "osm.water_areas_gen0_0-2" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_gen0_3-5" min_zoom = 3 max_zoom = 5 - + [[maps.layers]] name = "water_areas" - provider_layer = "osm.water_areas_gen0_6" + provider_layer = "osm.water_areas_gen0_6-7" min_zoom = 6 + max_zoom = 7 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_gen0_8-9" + min_zoom = 8 max_zoom = 9 - + [[maps.layers]] name = "water_areas" - provider_layer = "osm.water_areas_gen1" + provider_layer = "osm.water_areas_gen1_10-12" min_zoom = 10 max_zoom = 12 - + [[maps.layers]] name = "water_areas" - provider_layer = "osm.water_areas" + provider_layer = "osm.water_areas_13-15" min_zoom = 13 + max_zoom = 15 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_16-20" + min_zoom = 16 max_zoom = 20 - - # Water Lines + ###### From config/providers/water_lines.zoom.toml + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines_gen0_6-6" + min_zoom = 6 + max_zoom = 6 + [[maps.layers]] name = "water_lines" - provider_layer = "osm.water_lines_gen0" + provider_layer = "osm.water_lines_gen0_7-7" + min_zoom = 7 + max_zoom = 7 + + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines_gen0_8-8" min_zoom = 8 - max_zoom = 12 - + max_zoom = 8 + [[maps.layers]] name = "water_lines" - provider_layer = "osm.water_lines_gen1" - min_zoom = 13 - max_zoom = 14 - + provider_layer = "osm.water_lines_gen0_9-9" + min_zoom = 9 + max_zoom = 9 + + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines_gen1_10-11" + min_zoom = 10 + max_zoom = 11 + [[maps.layers]] name = "water_lines" provider_layer = "osm.water_lines" - min_zoom = 15 + min_zoom = 12 max_zoom = 20 # Transport Lines (Roads, Rail, Aviation) - [[maps.layers]] - name = "transport_lines" - provider_layer = "ne.ne_10m_roads_3" - min_zoom = 3 - max_zoom = 4 - - [[maps.layers]] - name = "transport_lines" - provider_layer = "ne.ne_10m_roads_5" - min_zoom = 5 - max_zoom = 6 - + ###### From config/providers/transport_lines.zoom.toml [[maps.layers]] name = "transport_lines" provider_layer = "osm.transport_lines_gen0" - min_zoom = 7 - max_zoom = 8 - + min_zoom = 3 + max_zoom = 5 + [[maps.layers]] name = "transport_lines" provider_layer = "osm.transport_lines_gen1" - min_zoom = 9 + min_zoom = 6 max_zoom = 10 - + [[maps.layers]] name = "transport_lines" provider_layer = "osm.transport_lines_11-12" min_zoom = 11 max_zoom = 12 - + [[maps.layers]] name = "transport_lines" provider_layer = "osm.transport_lines_13" min_zoom = 13 max_zoom = 13 - + [[maps.layers]] name = "transport_lines" provider_layer = "osm.transport_lines_14-20" min_zoom = 14 max_zoom = 20 + [['providers/route_lines.zoom.toml']] + + ###### admin_boundaries_maritime + [['providers/admin_boundaries_maritime.zoom.toml']] # Transport Areas [[maps.layers]] @@ -755,6 +1430,8 @@ center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part min_zoom = 14 max_zoom = 20 + + # Amenity Points [[maps.layers]] name = "amenity_points" @@ -762,6 +1439,20 @@ center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part min_zoom = 14 max_zoom = 20 + # Place Points + [[maps.layers]] + name = "place_points" + provider_layer = "osm.place_points" + min_zoom = 1 + max_zoom = 20 + + # Place areas + [[maps.layers]] + name = "place_areas" + provider_layer = "osm.place_areas" + min_zoom = 14 + max_zoom = 20 + # Other Points [[maps.layers]] name = "other_points" @@ -776,22 +1467,68 @@ center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part min_zoom = 14 max_zoom = 20 + # Other Areas + ###### From config/providers/other_areas.zoom.toml # Other Areas [[maps.layers]] name = "other_areas" - provider_layer = "osm.other_areas_filter" + provider_layer = "osm.other_areas_6-8" min_zoom = 6 max_zoom = 8 - + [[maps.layers]] name = "other_areas" - provider_layer = "osm.other_areas" + provider_layer = "osm.other_areas_9-11" min_zoom = 9 + max_zoom = 11 + + [[maps.layers]] + name = "other_areas" + provider_layer = "osm.other_areas_12-14" + min_zoom = 12 + max_zoom = 14 + + [[maps.layers]] + name = "other_areas" + provider_layer = "osm.other_areas_15-20" + min_zoom = 15 max_zoom = 20 + # Buildings [[maps.layers]] name = "buildings" provider_layer = "osm.buildings" min_zoom = 14 - max_zoom = 20 \ No newline at end of file + max_zoom = 20 + + + [[maps.layers]] + name = "transport_associated_streets" + provider_layer = "osm.transport_associated_streets" + min_zoom = 7 + max_zoom = 20 + + +[[maps]] +name = "ne" +attribution = "Natural Earth" +center = [-74.275329586789, -12.153492567373, 8.0] + # Water lakes Natural Earth + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.ne_water_lakes_0-2" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.ne_water_lakes_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.ne_water_lakes_6-8" + min_zoom = 6 + max_zoom = 8 diff --git a/images/tiler-server/config/providers/admin_boundaries_areas.toml b/images/tiler-server/config/providers/admin_boundaries_areas.toml new file mode 100644 index 00000000..3c873114 --- /dev/null +++ b/images/tiler-server/config/providers/admin_boundaries_areas.toml @@ -0,0 +1,146 @@ +# Layer configuration for admin boundaries 0-2 +[[providers.layers]] +name = "admin_boundaries_0-2" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type +FROM + osm_admin_areas +WHERE + admin_level IN (1,2) + AND geometry && !BBOX! +""" + +# Layer configuration for admin boundaries 3-5 +[[providers.layers]] +name = "admin_boundaries_3-5" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 200), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type +FROM + osm_admin_areas +WHERE + admin_level IN (1,2,3,4) + AND geometry && !BBOX! +""" + +# Layer configuration for admin boundaries 6-7 +[[providers.layers]] +name = "admin_boundaries_6-7" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type +FROM + osm_admin_areas +WHERE + admin_level IN (1,2,3,4,5,6) + AND geometry && !BBOX! +""" + +# Layer configuration for admin boundaries 8-9 +[[providers.layers]] +name = "admin_boundaries_8-9" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 50), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type +FROM + osm_admin_areas +WHERE + admin_level IN (1,2,3,4,5,6,7,8,9) + AND geometry && !BBOX! +""" + +# Layer configuration for admin boundaries 10-12 +[[providers.layers]] +name = "admin_boundaries_10-12" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 20), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type +FROM + osm_admin_areas +WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! +""" + +# Layer configuration for admin boundaries 13-15 +[[providers.layers]] +name = "admin_boundaries_13-15" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 5), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type +FROM + osm_admin_areas +WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! +""" + +# Layer configuration for admin boundaries 16-20 +[[providers.layers]] +name = "admin_boundaries_16-20" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type +FROM + osm_admin_areas +WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/admin_boundaries_areas.zoom.toml b/images/tiler-server/config/providers/admin_boundaries_areas.zoom.toml new file mode 100644 index 00000000..efcc9758 --- /dev/null +++ b/images/tiler-server/config/providers/admin_boundaries_areas.zoom.toml @@ -0,0 +1,42 @@ +# Admin Bounduaries Areas +[[maps.layers]] +name = "land_osm" +provider_layer = "osm.admin_boundaries_0-2" +min_zoom = 0 +max_zoom = 2 + +[[maps.layers]] +name = "land_osm" +provider_layer = "osm.admin_boundaries_3-5" +min_zoom = 3 +max_zoom = 5 + +[[maps.layers]] +name = "land_osm" +provider_layer = "osm.admin_boundaries_6-7" +min_zoom = 6 +max_zoom = 7 + +[[maps.layers]] +name = "land_osm" +provider_layer = "osm.admin_boundaries_8-9" +min_zoom = 8 +max_zoom = 9 + +[[maps.layers]] +name = "land_osm" +provider_layer = "osm.admin_boundaries_10-12" +min_zoom = 10 +max_zoom = 12 + +[[maps.layers]] +name = "land_osm" +provider_layer = "osm.admin_boundaries_13-15" +min_zoom = 13 +max_zoom = 15 + +[[maps.layers]] +name = "land_osm" +provider_layer = "osm.admin_boundaries_16-20" +min_zoom = 16 +max_zoom = 20 \ No newline at end of file diff --git a/images/tiler-server/config/providers/amenity_areas.toml b/images/tiler-server/config/providers/amenity_areas.toml new file mode 100644 index 00000000..f4d1924d --- /dev/null +++ b/images/tiler-server/config/providers/amenity_areas.toml @@ -0,0 +1,17 @@ +# Layer configuration for amenity areas +[[providers.layers]] +name = "amenity_areas" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + name, + type +FROM + osm_amenity_areas +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/amenity_points.toml b/images/tiler-server/config/providers/amenity_points.toml new file mode 100644 index 00000000..7663a21e --- /dev/null +++ b/images/tiler-server/config/providers/amenity_points.toml @@ -0,0 +1,18 @@ +# Layer configuration for amenity points +[[providers.layers]] +name = "amenity_points" +geometry_fieldname = "geometry" +geometry_type = "point" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type +FROM + osm_amenity_points +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/buildings.toml b/images/tiler-server/config/providers/buildings.toml new file mode 100644 index 00000000..4944cd6f --- /dev/null +++ b/images/tiler-server/config/providers/buildings.toml @@ -0,0 +1,19 @@ +# Layer configuration for buildings +[[providers.layers]] +name = "buildings" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + nullif(as_numeric(height), -1) AS height, + type +FROM + osm_buildings +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/land.toml b/images/tiler-server/config/providers/land.toml new file mode 100644 index 00000000..ce3a4b56 --- /dev/null +++ b/images/tiler-server/config/providers/land.toml @@ -0,0 +1,57 @@ +# Simplification for geometries +# 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 = "land_0-2" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "ogc_fid" +sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!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, 200),!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, 70),!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, 30),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + +[[providers.layers]] +name = "land_10-12" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "ogc_fid" +sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 10),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + +[[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!" diff --git a/images/tiler-server/config/providers/land.zoom.toml b/images/tiler-server/config/providers/land.zoom.toml new file mode 100644 index 00000000..17ec984c --- /dev/null +++ b/images/tiler-server/config/providers/land.zoom.toml @@ -0,0 +1,43 @@ +[[maps.layers]] +name = "land" +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 + + diff --git a/images/tiler-server/config/providers/landuse_areas.toml b/images/tiler-server/config/providers/landuse_areas.toml new file mode 100644 index 00000000..43b98631 --- /dev/null +++ b/images/tiler-server/config/providers/landuse_areas.toml @@ -0,0 +1,84 @@ +# Layer 50,000,000 +[[providers.layers]] +name = "landuse_areas_gen0_3-5" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area +FROM + osm_landuse_areas_gen0 +WHERE + type IN ('forest', 'wood', 'nature reserve', 'nature_reserve', 'military') + AND area > 50000000 + AND geometry && !BBOX! +""" + +# Layer 1,000,000 +[[providers.layers]] +name = "landuse_areas_gen0_6-9" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area +FROM + osm_landuse_areas_gen0 +WHERE + type IN ('forest', 'wood', 'nature reserve', 'nature_reserve', 'military') + AND area > 1000000 + AND geometry && !BBOX! +""" + +# Layer configuration for landuse areas gen1 +[[providers.layers]] +name = "landuse_areas_gen1_10-12" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area +FROM + osm_landuse_areas_gen1 +WHERE + geometry && !BBOX! +""" +# Layer configuration for landuse areas +[[providers.layers]] +name = "landuse_areas_13-20" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'wetland' AS wetland, + area +FROM + osm_landuse_areas +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/landuse_areas.zoom.toml b/images/tiler-server/config/providers/landuse_areas.zoom.toml new file mode 100644 index 00000000..8a720542 --- /dev/null +++ b/images/tiler-server/config/providers/landuse_areas.zoom.toml @@ -0,0 +1,23 @@ +[[maps.layers]] +name = "landuse_areas" +provider_layer = "osm.landuse_areas_gen0_3-5" +min_zoom = 3 +max_zoom = 5 + +[[maps.layers]] +name = "landuse_areas" +provider_layer = "osm.landuse_areas_gen0_6-9" +min_zoom = 6 +max_zoom = 9 + +[[maps.layers]] +name = "landuse_areas" +provider_layer = "osm.landuse_areas_gen1_10-12" +min_zoom = 10 +max_zoom = 12 + +[[maps.layers]] +name = "landuse_areas" +provider_layer = "osm.landuse_areas_13-20" +min_zoom = 13 +max_zoom = 20 diff --git a/images/tiler-server/config/providers/landuse_lines.toml b/images/tiler-server/config/providers/landuse_lines.toml new file mode 100644 index 00000000..a70023ee --- /dev/null +++ b/images/tiler-server/config/providers/landuse_lines.toml @@ -0,0 +1,19 @@ +# Layer configuration for landuse lines +[[providers.layers]] +name = "landuse_lines" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type +FROM + osm_landuse_lines +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/landuse_lines.zoom.toml b/images/tiler-server/config/providers/landuse_lines.zoom.toml new file mode 100644 index 00000000..8a68b082 --- /dev/null +++ b/images/tiler-server/config/providers/landuse_lines.zoom.toml @@ -0,0 +1,5 @@ +[[maps.layers]] +name = "landuse_lines" +provider_layer = "osm.landuse_lines" +min_zoom = 14 +max_zoom = 20 \ No newline at end of file diff --git a/images/tiler-server/config/providers/landuse_points.toml b/images/tiler-server/config/providers/landuse_points.toml new file mode 100644 index 00000000..d3ae48d2 --- /dev/null +++ b/images/tiler-server/config/providers/landuse_points.toml @@ -0,0 +1,19 @@ +# Layer configuration for landuse points +[[providers.layers]] +name = "landuse_points" +geometry_fieldname = "geometry" +geometry_type = "point" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type +FROM + osm_landuse_points +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/landuse_points.zoom.toml b/images/tiler-server/config/providers/landuse_points.zoom.toml new file mode 100644 index 00000000..0bcb73dd --- /dev/null +++ b/images/tiler-server/config/providers/landuse_points.zoom.toml @@ -0,0 +1,5 @@ +[[maps.layers]] +name = "landuse_points" +provider_layer = "osm.landuse_points" +min_zoom = 6 +max_zoom = 20 \ No newline at end of file diff --git a/images/tiler-server/config/providers/other_areas.toml b/images/tiler-server/config/providers/other_areas.toml new file mode 100644 index 00000000..ddafd44c --- /dev/null +++ b/images/tiler-server/config/providers/other_areas.toml @@ -0,0 +1,78 @@ +[[providers.layers]] +name = "other_areas_6-8" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type +FROM + osm_other_areas +WHERE + area > 1000000 + AND geometry && !BBOX! +""" + +[[providers.layers]] +name = "other_areas_9-11" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type +FROM + osm_other_areas +WHERE + area > 100000 + AND geometry && !BBOX! +""" + +[[providers.layers]] +name = "other_areas_12-14" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type +FROM + osm_other_areas +WHERE + area > 10000 + AND geometry && !BBOX! +""" + +[[providers.layers]] +name = "other_areas_15-20" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type +FROM + osm_other_areas +WHERE + geometry && !BBOX! +""" \ No newline at end of file diff --git a/images/tiler-server/config/providers/other_areas.zoom.toml b/images/tiler-server/config/providers/other_areas.zoom.toml new file mode 100644 index 00000000..eb279446 --- /dev/null +++ b/images/tiler-server/config/providers/other_areas.zoom.toml @@ -0,0 +1,24 @@ +# Other Areas +[[maps.layers]] +name = "other_areas" +provider_layer = "osm.other_areas_6-8" +min_zoom = 6 +max_zoom = 8 + +[[maps.layers]] +name = "other_areas" +provider_layer = "osm.other_areas_9-11" +min_zoom = 9 +max_zoom = 11 + +[[maps.layers]] +name = "other_areas" +provider_layer = "osm.other_areas_12-14" +min_zoom = 12 +max_zoom = 14 + +[[maps.layers]] +name = "other_areas" +provider_layer = "osm.other_areas_15-20" +min_zoom = 15 +max_zoom = 20 diff --git a/images/tiler-server/config/providers/other_lines.toml b/images/tiler-server/config/providers/other_lines.toml new file mode 100644 index 00000000..1bbebed5 --- /dev/null +++ b/images/tiler-server/config/providers/other_lines.toml @@ -0,0 +1,19 @@ +# Layer configuration for other lines +[[providers.layers]] +name = "other_lines" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type +FROM + osm_other_lines +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/other_points.toml b/images/tiler-server/config/providers/other_points.toml new file mode 100644 index 00000000..7579017d --- /dev/null +++ b/images/tiler-server/config/providers/other_points.toml @@ -0,0 +1,21 @@ +# Layer configuration for other points +[[providers.layers]] +name = "other_points" +geometry_fieldname = "geometry" +geometry_type = "point" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'artwork_type' AS artwork_type, + tags->'site_type' AS site_type +FROM + osm_other_points +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/place_areas.toml b/images/tiler-server/config/providers/place_areas.toml new file mode 100644 index 00000000..b4fe21c1 --- /dev/null +++ b/images/tiler-server/config/providers/place_areas.toml @@ -0,0 +1,18 @@ +# Layer configuration for place areas +[[providers.layers]] +name = "place_areas" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type +FROM + osm_place_areas +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/place_points copy.toml b/images/tiler-server/config/providers/place_points copy.toml new file mode 100644 index 00000000..40695771 --- /dev/null +++ b/images/tiler-server/config/providers/place_points copy.toml @@ -0,0 +1,19 @@ +# Layer configuration for place points +[[providers.layers]] +name = "place_points" +geometry_fieldname = "geometry" +geometry_type = "point" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'capital' AS capital +FROM + osm_place_points +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/place_points.toml b/images/tiler-server/config/providers/place_points.toml new file mode 100644 index 00000000..40695771 --- /dev/null +++ b/images/tiler-server/config/providers/place_points.toml @@ -0,0 +1,19 @@ +# Layer configuration for place points +[[providers.layers]] +name = "place_points" +geometry_fieldname = "geometry" +geometry_type = "point" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'capital' AS capital +FROM + osm_place_points +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/transport_areas.toml b/images/tiler-server/config/providers/transport_areas.toml new file mode 100644 index 00000000..7c7df4b8 --- /dev/null +++ b/images/tiler-server/config/providers/transport_areas.toml @@ -0,0 +1,19 @@ +[[providers.layers]] +name = "transport_areas" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + area +FROM + osm_transport_areas +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/transport_associated_streets.toml b/images/tiler-server/config/providers/transport_associated_streets.toml new file mode 100644 index 00000000..7add6970 --- /dev/null +++ b/images/tiler-server/config/providers/transport_associated_streets.toml @@ -0,0 +1,24 @@ +# Layer configuration for transport associated streets +[[providers.layers]] +name = "transport_associated_streets" +geometry_fieldname = "geometry" +geometry_type = "LineString" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + r.id, + m.member, + r.osm_id, + m.name, + m.relname, + m.index, + r.type +FROM + osm_relations r, + osm_relation_members m +WHERE + r.osm_id = m.osm_id + AND r.type = 'associatedStreet' + AND geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/transport_lines.toml b/images/tiler-server/config/providers/transport_lines.toml new file mode 100644 index 00000000..a774f2f3 --- /dev/null +++ b/images/tiler-server/config/providers/transport_lines.toml @@ -0,0 +1,160 @@ +# Layer configuration for transport lines gen0 +[[providers.layers]] +name = "transport_lines_gen0" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + type, + tunnel, + bridge, + ref, + service, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage +FROM + osm_transport_lines_gen0 +WHERE + type IN ('motorway', 'trunk', 'motorway_link', 'trunk_link', 'primary') + AND tunnel = 0 + AND bridge = 0 + AND geometry && !BBOX! +""" + +# Layer configuration for transport lines gen1 +[[providers.layers]] +name = "transport_lines_gen1" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + ref, + class, + type, + service, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage +FROM + osm_transport_lines_gen1 +WHERE + type IN ( + 'motorway', 'trunk', 'primary', 'primary_link', 'secondary', + 'motorway_link', 'trunk_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', + 'funicular', 'taxiway', 'runway', 'proposed', 'construction', + 'disused', 'abandoned', 'razed', 'ferry' + ) + AND geometry && !BBOX! +""" + +# Layer configuration for transport lines 11-12 +[[providers.layers]] +name = "transport_lines_11-12" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage +FROM + osm_transport_lines +WHERE + type IN ( + 'motorway', 'motorway_link', 'trunk', 'trunk_link', + 'primary', 'primary_link', 'secondary', 'secondary_link', + 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', + 'funicular', 'taxiway', 'runway', 'proposed', 'construction', + 'disused', 'abandoned', 'razed', 'apron', 'ferry' + ) + AND geometry && !BBOX! +""" + +# Layer configuration for transport lines 13 +[[providers.layers]] +name = "transport_lines_13" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage +FROM + osm_transport_lines +WHERE + type IN ( + 'motorway', 'motorway_link', 'trunk', 'trunk_link', + 'primary', 'primary_link', 'secondary', 'secondary_link', + 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', + 'miniature', 'funicular', 'taxiway', 'runway', 'residential', + 'taxiway', 'runway', 'proposed', 'construction', 'disused', + 'abandoned', 'razed', 'apron', 'ferry' + ) + AND geometry && !BBOX! +""" + +# Layer configuration for transport lines 14-20 +[[providers.layers]] +name = "transport_lines_14-20" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'usage' AS usage +FROM + osm_transport_lines +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/transport_lines.zoom.toml b/images/tiler-server/config/providers/transport_lines.zoom.toml new file mode 100644 index 00000000..96a4d703 --- /dev/null +++ b/images/tiler-server/config/providers/transport_lines.zoom.toml @@ -0,0 +1,29 @@ +[[maps.layers]] +name = "transport_lines" +provider_layer = "osm.transport_lines_gen0" +min_zoom = 3 +max_zoom = 5 + +[[maps.layers]] +name = "transport_lines" +provider_layer = "osm.transport_lines_gen1" +min_zoom = 6 +max_zoom = 10 + +[[maps.layers]] +name = "transport_lines" +provider_layer = "osm.transport_lines_11-12" +min_zoom = 11 +max_zoom = 12 + +[[maps.layers]] +name = "transport_lines" +provider_layer = "osm.transport_lines_13" +min_zoom = 13 +max_zoom = 13 + +[[maps.layers]] +name = "transport_lines" +provider_layer = "osm.transport_lines_14-20" +min_zoom = 14 +max_zoom = 20 \ No newline at end of file diff --git a/images/tiler-server/config/providers/transport_points.toml b/images/tiler-server/config/providers/transport_points.toml new file mode 100644 index 00000000..195fa85e --- /dev/null +++ b/images/tiler-server/config/providers/transport_points.toml @@ -0,0 +1,19 @@ +# Layer configuration for transport points +[[providers.layers]] +name = "transport_points" +geometry_fieldname = "geometry" +geometry_type = "point" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type +FROM + osm_transport_points +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/water_areas.toml b/images/tiler-server/config/providers/water_areas.toml new file mode 100644 index 00000000..a30b8346 --- /dev/null +++ b/images/tiler-server/config/providers/water_areas.toml @@ -0,0 +1,140 @@ +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +name = "water_areas_gen0_0-2" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 10000), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area +FROM + osm_water_areas_gen0 +WHERE + type IN ('water', 'riverbank') + AND area > 100000000 + AND geometry && !BBOX! +""" + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +name = "water_areas_gen0_3-5" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1000), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area +FROM + osm_water_areas_gen0 +WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 50000000 + AND geometry && !BBOX! +""" + +# Water bodies > 1,000,000 sqm +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +name = "water_areas_gen0_6-7" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area +FROM + osm_water_areas_gen0 +WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 1000000 + AND geometry && !BBOX! +""" + +# Water bodies > 10,000 sqm +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +name = "water_areas_gen0_8-9" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area +FROM + osm_water_areas_gen0 +WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 10000 + AND geometry && !BBOX! +""" + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "osm_id" +name = "water_areas_gen1_10-12" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 50), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area +FROM + osm_water_areas_gen1 +WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND geometry && !BBOX! +""" + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +name = "water_areas_13-15" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 5), !BBOX!) AS geometry, + id, + osm_id, + name, + type, + area +FROM + osm_water_areas +WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') + AND geometry && !BBOX! +""" + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +name = "water_areas_16-20" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + area +FROM + osm_water_areas +WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') + AND geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/water_areas.zoom.toml b/images/tiler-server/config/providers/water_areas.zoom.toml new file mode 100644 index 00000000..127ffaae --- /dev/null +++ b/images/tiler-server/config/providers/water_areas.zoom.toml @@ -0,0 +1,41 @@ +[[maps.layers]] +name = "water_areas" +provider_layer = "osm.water_areas_gen0_0-2" +min_zoom = 0 +max_zoom = 2 + +[[maps.layers]] +name = "water_areas" +provider_layer = "osm.water_areas_gen0_3-5" +min_zoom = 3 +max_zoom = 5 + +[[maps.layers]] +name = "water_areas" +provider_layer = "osm.water_areas_gen0_6-7" +min_zoom = 6 +max_zoom = 7 + +[[maps.layers]] +name = "water_areas" +provider_layer = "osm.water_areas_gen0_8-9" +min_zoom = 8 +max_zoom = 9 + +[[maps.layers]] +name = "water_areas" +provider_layer = "osm.water_areas_gen1_10-12" +min_zoom = 10 +max_zoom = 12 + +[[maps.layers]] +name = "water_areas" +provider_layer = "osm.water_areas_13-15" +min_zoom = 13 +max_zoom = 15 + +[[maps.layers]] +name = "water_areas" +provider_layer = "osm.water_areas_16-20" +min_zoom = 16 +max_zoom = 20 \ No newline at end of file diff --git a/images/tiler-server/config/providers/water_areas_ne.toml b/images/tiler-server/config/providers/water_areas_ne.toml new file mode 100644 index 00000000..ca597451 --- /dev/null +++ b/images/tiler-server/config/providers/water_areas_ne.toml @@ -0,0 +1,20 @@ +[[providers.layers]] +name = "ne_water_lakes_0-2" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "ogc_fid" +sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1000),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + +[[providers.layers]] +name = "ne_water_lakes_3-5" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "ogc_fid" +sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + +[[providers.layers]] +name = "ne_water_lakes_6-8" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "ogc_fid" +sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 100),!BBOX!) AS geometry, name, ogc_fid FROM ne_10m_lakes WHERE wkb_geometry && !BBOX!" diff --git a/images/tiler-server/config/providers/water_lines.toml b/images/tiler-server/config/providers/water_lines.toml new file mode 100644 index 00000000..0b1255c8 --- /dev/null +++ b/images/tiler-server/config/providers/water_lines.toml @@ -0,0 +1,121 @@ +# Simplification for geometries + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +name = "water_lines_gen0_6-6" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge +FROM + osm_water_lines_gen0 +WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! +""" + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +name = "water_lines_gen0_7-7" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1000), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge +FROM + osm_water_lines_gen0 +WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! +""" + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +name = "water_lines_gen0_8-8" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge +FROM + osm_water_lines_gen0 +WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! +""" + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +name = "water_lines_gen0_9-9" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge +FROM + osm_water_lines_gen0 +WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! +""" + + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "osm_id" +name = "water_lines_gen1_10-11" +sql = """ +SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 20), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge, + tags->'surface' AS surface +FROM + osm_water_lines_gen1 +WHERE + type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') + AND geometry && !BBOX! +""" + +[[providers.layers]] +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "id" +name = "water_lines" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'bridge' AS bridge, + tags->'surface' AS surface, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date +FROM + osm_water_lines +WHERE + type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') + AND geometry && !BBOX! +""" \ No newline at end of file diff --git a/images/tiler-server/config/providers/water_lines.zoom.toml b/images/tiler-server/config/providers/water_lines.zoom.toml new file mode 100644 index 00000000..ce286227 --- /dev/null +++ b/images/tiler-server/config/providers/water_lines.zoom.toml @@ -0,0 +1,35 @@ +[[maps.layers]] +name = "water_lines" +provider_layer = "osm.water_lines_gen0_6-6" +min_zoom = 6 +max_zoom = 6 + +[[maps.layers]] +name = "water_lines" +provider_layer = "osm.water_lines_gen0_7-7" +min_zoom = 7 +max_zoom = 7 + +[[maps.layers]] +name = "water_lines" +provider_layer = "osm.water_lines_gen0_8-8" +min_zoom = 8 +max_zoom = 8 + +[[maps.layers]] +name = "water_lines" +provider_layer = "osm.water_lines_gen0_9-9" +min_zoom = 9 +max_zoom = 9 + +[[maps.layers]] +name = "water_lines" +provider_layer = "osm.water_lines_gen1_10-11" +min_zoom = 10 +max_zoom = 11 + +[[maps.layers]] +name = "water_lines" +provider_layer = "osm.water_lines" +min_zoom = 12 +max_zoom = 20 \ No newline at end of file From 92d139dccae383f64e554615bfd2b3f4af15e00c Mon Sep 17 00:00:00 2001 From: Rub21 Date: Fri, 5 Jul 2024 10:44:32 -0500 Subject: [PATCH 4/7] Update docker file - tiler server --- images/tiler-server/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/images/tiler-server/Dockerfile b/images/tiler-server/Dockerfile index e94bab73..382516ee 100644 --- a/images/tiler-server/Dockerfile +++ b/images/tiler-server/Dockerfile @@ -21,6 +21,14 @@ RUN pip install --upgrade pip && pip3 install awscli mercantile RUN ln -s /opt/tegola /usr/bin/tegola +COPY ./config /opt/config/ +COPY build_config.py /opt/ +RUN mkdir /opt/tegola_config +RUN cd /opt/ && python build_config.py \ + --template config/config.template.toml \ + --providers config/providers \ + --output /opt/tegola_config/config.toml + # Volumen VOLUME /mnt/data # Copy config and exec files From fb98bf22a4451e5e7720b3c9a804c452c4fccb60 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Fri, 5 Jul 2024 10:51:23 -0500 Subject: [PATCH 5/7] Update providers --- images/tiler-server/config/config.toml | 1534 ----------------- .../providers/admin_boundaries_areas.toml | 49 +- .../config/providers/amenity_areas.toml | 7 +- .../config/providers/amenity_points.toml | 7 +- .../config/providers/buildings.toml | 7 +- .../config/providers/landuse_areas.toml | 7 +- .../config/providers/landuse_lines.toml | 7 +- .../config/providers/landuse_points.toml | 7 +- .../config/providers/other_areas.toml | 7 +- .../config/providers/other_lines.toml | 7 +- .../config/providers/other_points.toml | 7 +- .../config/providers/place_areas.toml | 7 +- .../config/providers/place_points copy.toml | 19 - .../config/providers/place_points.toml | 7 +- .../config/providers/transport_areas.toml | 7 +- .../transport_associated_streets.toml | 7 +- .../config/providers/transport_lines.toml | 7 +- .../config/providers/transport_points.toml | 7 +- .../config/providers/water_areas.toml | 49 +- .../config/providers/water_lines.toml | 7 +- 20 files changed, 180 insertions(+), 1583 deletions(-) delete mode 100644 images/tiler-server/config/config.toml delete mode 100644 images/tiler-server/config/providers/place_points copy.toml diff --git a/images/tiler-server/config/config.toml b/images/tiler-server/config/config.toml deleted file mode 100644 index 23f63719..00000000 --- a/images/tiler-server/config/config.toml +++ /dev/null @@ -1,1534 +0,0 @@ -[webserver] -port = ":${TILER_SERVER_PORT}" - - [webserver.headers] - Access-Control-Allow-Origin = "*" - -# Tegola offers three tile caching strategies: "file", "redis", and "s3" -[cache] -type = "${TILER_CACHE_TYPE}" -basepath ="${TILER_CACHE_BASEPATH}" -max_zoom = "${TILER_CACHE_MAX_ZOOM}" - -bucket = "${TILER_CACHE_BUCKET}" -region = "${TILER_CACHE_REGION}" -aws_access_key_id = "${TILER_CACHE_AWS_ACCESS_KEY_ID}" -aws_secret_access_key = "${TILER_CACHE_AWS_SECRET_ACCESS_KEY}" - -# metrics -[observer] -type = "prometheus" - -# OpenStreetMap (OSM) -[[providers]] -name = "osm" -type = "mvt_postgis" -uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" -# srid = 3857 -max_connections = 200 - ###### Land providers - ###### From config/providers/land.toml - # Simplification for geometries - # 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 = "land_0-2" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!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, 200),!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, 70),!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, 30),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" - - [[providers.layers]] - name = "land_10-12" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 10),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" - - [[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 areas and lines - ###### From config/providers/water_areas.toml - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - name = "water_areas_gen0_0-2" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 10000), !BBOX!) AS geometry, - ABS(osm_id) as osm_id, - name, - type, - area - FROM - osm_water_areas_gen0 - WHERE - type IN ('water', 'riverbank') - AND area > 100000000 - AND geometry && !BBOX! - """ - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - name = "water_areas_gen0_3-5" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 1000), !BBOX!) AS geometry, - ABS(osm_id) as osm_id, - name, - type, - area - FROM - osm_water_areas_gen0 - WHERE - type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') - AND area > 50000000 - AND geometry && !BBOX! - """ - - # Water bodies > 1,000,000 sqm - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - name = "water_areas_gen0_6-7" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, - ABS(osm_id) as osm_id, - name, - type, - area - FROM - osm_water_areas_gen0 - WHERE - type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') - AND area > 1000000 - AND geometry && !BBOX! - """ - - # Water bodies > 10,000 sqm - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - name = "water_areas_gen0_8-9" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, - ABS(osm_id) as osm_id, - name, - type, - area - FROM - osm_water_areas_gen0 - WHERE - type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') - AND area > 10000 - AND geometry && !BBOX! - """ - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - name = "water_areas_gen1_10-12" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 50), !BBOX!) AS geometry, - ABS(osm_id) as osm_id, - name, - type, - area - FROM - osm_water_areas_gen1 - WHERE - type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') - AND geometry && !BBOX! - """ - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - name = "water_areas_13-15" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 5), !BBOX!) AS geometry, - id, - osm_id, - name, - type, - area - FROM - osm_water_areas - WHERE - type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') - AND geometry && !BBOX! - """ - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - name = "water_areas_16-20" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - type, - area - FROM - osm_water_areas - WHERE - type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') - AND geometry && !BBOX! - """ - - - ###### From config/providers/water_lines.toml - # Simplification for geometries - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - name = "water_lines_gen0_6-6" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 1500), !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - name, - type, - tags->'bridge' AS bridge - FROM - osm_water_lines_gen0 - WHERE - type IN ('river', 'canal') - AND geometry && !BBOX! - """ - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - name = "water_lines_gen0_7-7" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 1000), !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - name, - type, - tags->'bridge' AS bridge - FROM - osm_water_lines_gen0 - WHERE - type IN ('river', 'canal') - AND geometry && !BBOX! - """ - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - name = "water_lines_gen0_8-8" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - name, - type, - tags->'bridge' AS bridge - FROM - osm_water_lines_gen0 - WHERE - type IN ('river', 'canal') - AND geometry && !BBOX! - """ - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - name = "water_lines_gen0_9-9" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - name, - type, - tags->'bridge' AS bridge - FROM - osm_water_lines_gen0 - WHERE - type IN ('river', 'canal') - AND geometry && !BBOX! - """ - - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - name = "water_lines_gen1_10-11" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 20), !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - name, - type, - tags->'bridge' AS bridge, - tags->'surface' AS surface - FROM - osm_water_lines_gen1 - WHERE - type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') - AND geometry && !BBOX! - """ - - [[providers.layers]] - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "id" - name = "water_lines" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - type, - tags->'bridge' AS bridge, - tags->'surface' AS surface, - tags->'start_date' AS start_date, - tags->'end_date' AS end_date - FROM - osm_water_lines - WHERE - type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') - AND geometry && !BBOX! - """ - - ###### Water areas NE - ###### From config/providers/water_areas_ne.toml - [[providers.layers]] - name = "ne_water_lakes_0-2" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1000),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" - - [[providers.layers]] - name = "ne_water_lakes_3-5" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" - - [[providers.layers]] - name = "ne_water_lakes_6-8" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 100),!BBOX!) AS geometry, name, ogc_fid FROM ne_10m_lakes WHERE wkb_geometry && !BBOX!" - - - ###### Admin boundaries providers - ###### From config/providers/admin_boundaries_areas.toml - # Layer configuration for admin boundaries 0-2 - [[providers.layers]] - name = "admin_boundaries_0-2" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, - id, - osm_id, - admin_level, - name, - type - FROM - osm_admin_areas - WHERE - admin_level IN (1,2) - AND geometry && !BBOX! - """ - - # Layer configuration for admin boundaries 3-5 - [[providers.layers]] - name = "admin_boundaries_3-5" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 200), !BBOX!) AS geometry, - id, - osm_id, - admin_level, - name, - type - FROM - osm_admin_areas - WHERE - admin_level IN (1,2,3,4) - AND geometry && !BBOX! - """ - - # Layer configuration for admin boundaries 6-7 - [[providers.layers]] - name = "admin_boundaries_6-7" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, - id, - osm_id, - admin_level, - name, - type - FROM - osm_admin_areas - WHERE - admin_level IN (1,2,3,4,5,6) - AND geometry && !BBOX! - """ - - # Layer configuration for admin boundaries 8-9 - [[providers.layers]] - name = "admin_boundaries_8-9" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 50), !BBOX!) AS geometry, - id, - osm_id, - admin_level, - name, - type - FROM - osm_admin_areas - WHERE - admin_level IN (1,2,3,4,5,6,7,8,9) - AND geometry && !BBOX! - """ - - # Layer configuration for admin boundaries 10-12 - [[providers.layers]] - name = "admin_boundaries_10-12" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 20), !BBOX!) AS geometry, - id, - osm_id, - admin_level, - name, - type - FROM - osm_admin_areas - WHERE - admin_level IN (1,2,3,4,5,6,7,8,9,10) - AND geometry && !BBOX! - """ - - # Layer configuration for admin boundaries 13-15 - [[providers.layers]] - name = "admin_boundaries_13-15" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 5), !BBOX!) AS geometry, - id, - osm_id, - admin_level, - name, - type - FROM - osm_admin_areas - WHERE - admin_level IN (1,2,3,4,5,6,7,8,9,10) - AND geometry && !BBOX! - """ - - # Layer configuration for admin boundaries 16-20 - [[providers.layers]] - name = "admin_boundaries_16-20" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 1), !BBOX!) AS geometry, - id, - osm_id, - admin_level, - name, - type - FROM - osm_admin_areas - WHERE - admin_level IN (1,2,3,4,5,6,7,8,9,10) - AND geometry && !BBOX! - """ - - - ###### Land use areas - ###### From config/providers/landuse_areas.toml - # Layer 50,000,000 - [[providers.layers]] - name = "landuse_areas_gen0_3-5" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - name, - class, - type, - area - FROM - osm_landuse_areas_gen0 - WHERE - type IN ('forest', 'wood', 'nature reserve', 'nature_reserve', 'military') - AND area > 50000000 - AND geometry && !BBOX! - """ - - # Layer 1,000,000 - [[providers.layers]] - name = "landuse_areas_gen0_6-9" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - sql = """ - SELECT - ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - name, - class, - type, - area - FROM - osm_landuse_areas_gen0 - WHERE - type IN ('forest', 'wood', 'nature reserve', 'nature_reserve', 'military') - AND area > 1000000 - AND geometry && !BBOX! - """ - - # Layer configuration for landuse areas gen1 - [[providers.layers]] - name = "landuse_areas_gen1_10-12" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - name, - class, - type, - area - FROM - osm_landuse_areas_gen1 - WHERE - geometry && !BBOX! - """ - # Layer configuration for landuse areas - [[providers.layers]] - name = "landuse_areas_13-20" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type, - tags->'wetland' AS wetland, - area - FROM - osm_landuse_areas - WHERE - geometry && !BBOX! - """ - - - ###### Land use lines and points - ###### From config/providers/landuse_lines.toml - # Layer configuration for landuse lines - [[providers.layers]] - name = "landuse_lines" - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type - FROM - osm_landuse_lines - WHERE - geometry && !BBOX! - """ - - ###### From config/providers/landuse_points.toml - # Layer configuration for landuse points - [[providers.layers]] - name = "landuse_points" - geometry_fieldname = "geometry" - geometry_type = "point" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type - FROM - osm_landuse_points - WHERE - geometry && !BBOX! - """ - - - ###### Transport lines, points and areas from ways - ###### From config/providers/transport_points.toml - # Layer configuration for transport points - [[providers.layers]] - name = "transport_points" - geometry_fieldname = "geometry" - geometry_type = "point" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type - FROM - osm_transport_points - WHERE - geometry && !BBOX! - """ - - ###### From config/providers/transport_lines.toml - # Layer configuration for transport lines gen0 - [[providers.layers]] - name = "transport_lines_gen0" - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - ABS(osm_id) AS osm_id, - type, - tunnel, - bridge, - ref, - service, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage - FROM - osm_transport_lines_gen0 - WHERE - type IN ('motorway', 'trunk', 'motorway_link', 'trunk_link', 'primary') - AND tunnel = 0 - AND bridge = 0 - AND geometry && !BBOX! - """ - - # Layer configuration for transport lines gen1 - [[providers.layers]] - name = "transport_lines_gen1" - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - osm_id, - ref, - class, - type, - service, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage - FROM - osm_transport_lines_gen1 - WHERE - type IN ( - 'motorway', 'trunk', 'primary', 'primary_link', 'secondary', - 'motorway_link', 'trunk_link', 'rail', 'subway', 'light_rail', - 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', - 'funicular', 'taxiway', 'runway', 'proposed', 'construction', - 'disused', 'abandoned', 'razed', 'ferry' - ) - AND geometry && !BBOX! - """ - - # Layer configuration for transport lines 11-12 - [[providers.layers]] - name = "transport_lines_11-12" - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - osm_id, - name, - ref, - class, - type, - tunnel, - bridge, - access, - service, - ford, - tags->'construction' AS construction, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage - FROM - osm_transport_lines - WHERE - type IN ( - 'motorway', 'motorway_link', 'trunk', 'trunk_link', - 'primary', 'primary_link', 'secondary', 'secondary_link', - 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', - 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', - 'funicular', 'taxiway', 'runway', 'proposed', 'construction', - 'disused', 'abandoned', 'razed', 'apron', 'ferry' - ) - AND geometry && !BBOX! - """ - - # Layer configuration for transport lines 13 - [[providers.layers]] - name = "transport_lines_13" - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - ref, - class, - type, - tunnel, - bridge, - access, - service, - ford, - tags->'construction' AS construction, - tags->'electrified' AS electrified, - tags->'highspeed' AS highspeed, - tags->'usage' AS usage - FROM - osm_transport_lines - WHERE - type IN ( - 'motorway', 'motorway_link', 'trunk', 'trunk_link', - 'primary', 'primary_link', 'secondary', 'secondary_link', - 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', - 'tram', 'narrow_gauge', 'monorail', 'preserved', - 'miniature', 'funicular', 'taxiway', 'runway', 'residential', - 'taxiway', 'runway', 'proposed', 'construction', 'disused', - 'abandoned', 'razed', 'apron', 'ferry' - ) - AND geometry && !BBOX! - """ - - # Layer configuration for transport lines 14-20 - [[providers.layers]] - name = "transport_lines_14-20" - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - ref, - class, - type, - tunnel, - bridge, - access, - service, - ford, - tags->'construction' AS construction, - tags->'usage' AS usage - FROM - osm_transport_lines - WHERE - geometry && !BBOX! - """ - - ###### From config/providers/transport_areas.toml - [[providers.layers]] - name = "transport_areas" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type, - area - FROM - osm_transport_areas - WHERE - geometry && !BBOX! - """ - - - ###### Amenities areas and points - ###### From config/providers/amenity_areas.toml - # Layer configuration for amenity areas - [[providers.layers]] - name = "amenity_areas" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - osm_id, - name, - type - FROM - osm_amenity_areas - WHERE - geometry && !BBOX! - """ - - ###### From config/providers/amenity_points.toml - # Layer configuration for amenity points - [[providers.layers]] - name = "amenity_points" - geometry_fieldname = "geometry" - geometry_type = "point" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - type - FROM - osm_amenity_points - WHERE - geometry && !BBOX! - """ - - - ###### Place points and areas - ###### From config/providers/place_points.toml - # Layer configuration for place points - [[providers.layers]] - name = "place_points" - geometry_fieldname = "geometry" - geometry_type = "point" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - type, - tags->'capital' AS capital - FROM - osm_place_points - WHERE - geometry && !BBOX! - """ - - ###### From config/providers/place_areas.toml - # Layer configuration for place areas - [[providers.layers]] - name = "place_areas" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - type - FROM - osm_place_areas - WHERE - geometry && !BBOX! - """ - - - ###### Other (Man Made, Historic, Military, Power, Barrier etc) - ###### From config/providers/other_points.toml - # Layer configuration for other points - [[providers.layers]] - name = "other_points" - geometry_fieldname = "geometry" - geometry_type = "point" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type, - tags->'artwork_type' AS artwork_type, - tags->'site_type' AS site_type - FROM - osm_other_points - WHERE - geometry && !BBOX! - """ - - ###### From config/providers/other_lines.toml - # Layer configuration for other lines - [[providers.layers]] - name = "other_lines" - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type - FROM - osm_other_lines - WHERE - geometry && !BBOX! - """ - - ###### From config/providers/other_areas.toml - [[providers.layers]] - name = "other_areas_6-8" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type - FROM - osm_other_areas - WHERE - area > 1000000 - AND geometry && !BBOX! - """ - - [[providers.layers]] - name = "other_areas_9-11" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type - FROM - osm_other_areas - WHERE - area > 100000 - AND geometry && !BBOX! - """ - - [[providers.layers]] - name = "other_areas_12-14" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type - FROM - osm_other_areas - WHERE - area > 10000 - AND geometry && !BBOX! - """ - - [[providers.layers]] - name = "other_areas_15-20" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - class, - type - FROM - osm_other_areas - WHERE - geometry && !BBOX! - """ - - ###### Buildings - ###### From config/providers/buildings.toml - # Layer configuration for buildings - [[providers.layers]] - name = "buildings" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - nullif(as_numeric(height), -1) AS height, - type - FROM - osm_buildings - WHERE - geometry && !BBOX! - """ - - - ###### transport_associated_streets - ###### From config/providers/transport_associated_streets.toml - # Layer configuration for transport associated streets - [[providers.layers]] - name = "transport_associated_streets" - geometry_fieldname = "geometry" - geometry_type = "LineString" - id_fieldname = "id" - sql = """ - SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - r.id, - m.member, - r.osm_id, - m.name, - m.relname, - m.index, - r.type - FROM - osm_relations r, - osm_relation_members m - WHERE - r.osm_id = m.osm_id - AND r.type = 'associatedStreet' - AND geometry && !BBOX! - """ - - -# Natural Earth (ne) -[[providers]] -name = "ne" -type = "mvt_postgis" -uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" - -# srid = 3857 -max_connections = 200 - ###### Water lands ne - ###### From config/providers/water_areas_ne.toml - [[providers.layers]] - name = "ne_water_lakes_0-2" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1000),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" - - [[providers.layers]] - name = "ne_water_lakes_3-5" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" - - [[providers.layers]] - name = "ne_water_lakes_6-8" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 100),!BBOX!) AS geometry, name, ogc_fid FROM ne_10m_lakes WHERE wkb_geometry && !BBOX!" - - -[[maps]] -name = "osm" -attribution = "OpenStreetMap" -center = [-74.275329586789, -12.153492567373, 8.0] - ###### Land - ###### From config/providers/land.zoom.toml - [[maps.layers]] - name = "land" - 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 display zooms - ###### From config/providers/admin_boundaries_areas.zoom.toml - # Admin Bounduaries Areas - [[maps.layers]] - name = "land_osm" - provider_layer = "osm.admin_boundaries_0-2" - min_zoom = 0 - max_zoom = 2 - - [[maps.layers]] - name = "land_osm" - provider_layer = "osm.admin_boundaries_3-5" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "land_osm" - provider_layer = "osm.admin_boundaries_6-7" - min_zoom = 6 - max_zoom = 7 - - [[maps.layers]] - name = "land_osm" - provider_layer = "osm.admin_boundaries_8-9" - min_zoom = 8 - max_zoom = 9 - - [[maps.layers]] - name = "land_osm" - provider_layer = "osm.admin_boundaries_10-12" - min_zoom = 10 - max_zoom = 12 - - [[maps.layers]] - name = "land_osm" - provider_layer = "osm.admin_boundaries_13-15" - min_zoom = 13 - max_zoom = 15 - - [[maps.layers]] - name = "land_osm" - provider_layer = "osm.admin_boundaries_16-20" - min_zoom = 16 - max_zoom = 20 - - ###### Land Use - ###### From config/providers/landuse_areas.zoom.toml - [[maps.layers]] - name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen0_3-5" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen0_6-9" - min_zoom = 6 - max_zoom = 9 - - [[maps.layers]] - name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen1_10-12" - min_zoom = 10 - max_zoom = 12 - - [[maps.layers]] - name = "landuse_areas" - provider_layer = "osm.landuse_areas_13-20" - min_zoom = 13 - max_zoom = 20 - - ###### From config/providers/landuse_lines.zoom.toml - [[maps.layers]] - name = "landuse_lines" - provider_layer = "osm.landuse_lines" - min_zoom = 14 - max_zoom = 20 - ###### From config/providers/landuse_points.zoom.toml - [[maps.layers]] - name = "landuse_points" - provider_layer = "osm.landuse_points" - min_zoom = 6 - max_zoom = 20 - - ###### Water areas/lines - ###### From config/providers/water_areas.zoom.toml - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_gen0_0-2" - min_zoom = 0 - max_zoom = 2 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_gen0_3-5" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_gen0_6-7" - min_zoom = 6 - max_zoom = 7 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_gen0_8-9" - min_zoom = 8 - max_zoom = 9 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_gen1_10-12" - min_zoom = 10 - max_zoom = 12 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_13-15" - min_zoom = 13 - max_zoom = 15 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_16-20" - min_zoom = 16 - max_zoom = 20 - ###### From config/providers/water_lines.zoom.toml - [[maps.layers]] - name = "water_lines" - provider_layer = "osm.water_lines_gen0_6-6" - min_zoom = 6 - max_zoom = 6 - - [[maps.layers]] - name = "water_lines" - provider_layer = "osm.water_lines_gen0_7-7" - min_zoom = 7 - max_zoom = 7 - - [[maps.layers]] - name = "water_lines" - provider_layer = "osm.water_lines_gen0_8-8" - min_zoom = 8 - max_zoom = 8 - - [[maps.layers]] - name = "water_lines" - provider_layer = "osm.water_lines_gen0_9-9" - min_zoom = 9 - max_zoom = 9 - - [[maps.layers]] - name = "water_lines" - provider_layer = "osm.water_lines_gen1_10-11" - min_zoom = 10 - max_zoom = 11 - - [[maps.layers]] - name = "water_lines" - provider_layer = "osm.water_lines" - min_zoom = 12 - max_zoom = 20 - - # Transport Lines (Roads, Rail, Aviation) - ###### From config/providers/transport_lines.zoom.toml - [[maps.layers]] - name = "transport_lines" - provider_layer = "osm.transport_lines_gen0" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "transport_lines" - provider_layer = "osm.transport_lines_gen1" - min_zoom = 6 - max_zoom = 10 - - [[maps.layers]] - name = "transport_lines" - provider_layer = "osm.transport_lines_11-12" - min_zoom = 11 - max_zoom = 12 - - [[maps.layers]] - name = "transport_lines" - provider_layer = "osm.transport_lines_13" - min_zoom = 13 - max_zoom = 13 - - [[maps.layers]] - name = "transport_lines" - provider_layer = "osm.transport_lines_14-20" - min_zoom = 14 - max_zoom = 20 - [['providers/route_lines.zoom.toml']] - - ###### admin_boundaries_maritime - [['providers/admin_boundaries_maritime.zoom.toml']] - - # Transport Areas - [[maps.layers]] - name = "transport_areas" - provider_layer = "osm.transport_areas" - min_zoom = 12 - max_zoom = 20 - - # Transport Points - [[maps.layers]] - name = "transport_points" - provider_layer = "osm.transport_points" - min_zoom = 14 - max_zoom = 20 - - # Amenity Areas - [[maps.layers]] - name = "amenity_areas" - provider_layer = "osm.amenity_areas" - min_zoom = 14 - max_zoom = 20 - - - - # Amenity Points - [[maps.layers]] - name = "amenity_points" - provider_layer = "osm.amenity_points" - min_zoom = 14 - max_zoom = 20 - - # Place Points - [[maps.layers]] - name = "place_points" - provider_layer = "osm.place_points" - min_zoom = 1 - max_zoom = 20 - - # Place areas - [[maps.layers]] - name = "place_areas" - provider_layer = "osm.place_areas" - min_zoom = 14 - max_zoom = 20 - - # Other Points - [[maps.layers]] - name = "other_points" - provider_layer = "osm.other_points" - min_zoom = 14 - max_zoom = 20 - - # Other Lines - [[maps.layers]] - name = "other_lines" - provider_layer = "osm.other_lines" - min_zoom = 14 - max_zoom = 20 - - # Other Areas - ###### From config/providers/other_areas.zoom.toml - # Other Areas - [[maps.layers]] - name = "other_areas" - provider_layer = "osm.other_areas_6-8" - min_zoom = 6 - max_zoom = 8 - - [[maps.layers]] - name = "other_areas" - provider_layer = "osm.other_areas_9-11" - min_zoom = 9 - max_zoom = 11 - - [[maps.layers]] - name = "other_areas" - provider_layer = "osm.other_areas_12-14" - min_zoom = 12 - max_zoom = 14 - - [[maps.layers]] - name = "other_areas" - provider_layer = "osm.other_areas_15-20" - min_zoom = 15 - max_zoom = 20 - - - # Buildings - [[maps.layers]] - name = "buildings" - provider_layer = "osm.buildings" - min_zoom = 14 - max_zoom = 20 - - - [[maps.layers]] - name = "transport_associated_streets" - provider_layer = "osm.transport_associated_streets" - min_zoom = 7 - max_zoom = 20 - - -[[maps]] -name = "ne" -attribution = "Natural Earth" -center = [-74.275329586789, -12.153492567373, 8.0] - # Water lakes Natural Earth - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.ne_water_lakes_0-2" - min_zoom = 0 - max_zoom = 2 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.ne_water_lakes_3-5" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.ne_water_lakes_6-8" - min_zoom = 6 - max_zoom = 8 diff --git a/images/tiler-server/config/providers/admin_boundaries_areas.toml b/images/tiler-server/config/providers/admin_boundaries_areas.toml index 3c873114..0c6a1e88 100644 --- a/images/tiler-server/config/providers/admin_boundaries_areas.toml +++ b/images/tiler-server/config/providers/admin_boundaries_areas.toml @@ -11,7 +11,12 @@ SELECT osm_id, admin_level, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_admin_areas WHERE @@ -32,7 +37,12 @@ SELECT osm_id, admin_level, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_admin_areas WHERE @@ -53,7 +63,12 @@ SELECT osm_id, admin_level, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_admin_areas WHERE @@ -74,7 +89,12 @@ SELECT osm_id, admin_level, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_admin_areas WHERE @@ -95,7 +115,12 @@ SELECT osm_id, admin_level, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_admin_areas WHERE @@ -116,7 +141,12 @@ SELECT osm_id, admin_level, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_admin_areas WHERE @@ -137,7 +167,12 @@ SELECT osm_id, admin_level, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_admin_areas WHERE diff --git a/images/tiler-server/config/providers/amenity_areas.toml b/images/tiler-server/config/providers/amenity_areas.toml index f4d1924d..9f8548b6 100644 --- a/images/tiler-server/config/providers/amenity_areas.toml +++ b/images/tiler-server/config/providers/amenity_areas.toml @@ -9,7 +9,12 @@ SELECT ST_AsMVTGeom(geometry, !BBOX!) AS geometry, osm_id, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_amenity_areas WHERE diff --git a/images/tiler-server/config/providers/amenity_points.toml b/images/tiler-server/config/providers/amenity_points.toml index 7663a21e..6467c1ad 100644 --- a/images/tiler-server/config/providers/amenity_points.toml +++ b/images/tiler-server/config/providers/amenity_points.toml @@ -10,7 +10,12 @@ SELECT id, osm_id, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_amenity_points WHERE diff --git a/images/tiler-server/config/providers/buildings.toml b/images/tiler-server/config/providers/buildings.toml index 4944cd6f..eb10873c 100644 --- a/images/tiler-server/config/providers/buildings.toml +++ b/images/tiler-server/config/providers/buildings.toml @@ -11,7 +11,12 @@ SELECT osm_id, name, nullif(as_numeric(height), -1) AS height, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_buildings WHERE diff --git a/images/tiler-server/config/providers/landuse_areas.toml b/images/tiler-server/config/providers/landuse_areas.toml index 43b98631..0f262ce2 100644 --- a/images/tiler-server/config/providers/landuse_areas.toml +++ b/images/tiler-server/config/providers/landuse_areas.toml @@ -76,7 +76,12 @@ SELECT class, type, tags->'wetland' AS wetland, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_landuse_areas WHERE diff --git a/images/tiler-server/config/providers/landuse_lines.toml b/images/tiler-server/config/providers/landuse_lines.toml index a70023ee..fee2c2ad 100644 --- a/images/tiler-server/config/providers/landuse_lines.toml +++ b/images/tiler-server/config/providers/landuse_lines.toml @@ -11,7 +11,12 @@ SELECT osm_id, name, class, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_landuse_lines WHERE diff --git a/images/tiler-server/config/providers/landuse_points.toml b/images/tiler-server/config/providers/landuse_points.toml index d3ae48d2..fdfac0bd 100644 --- a/images/tiler-server/config/providers/landuse_points.toml +++ b/images/tiler-server/config/providers/landuse_points.toml @@ -11,7 +11,12 @@ SELECT osm_id, name, class, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_landuse_points WHERE diff --git a/images/tiler-server/config/providers/other_areas.toml b/images/tiler-server/config/providers/other_areas.toml index ddafd44c..b4aa9137 100644 --- a/images/tiler-server/config/providers/other_areas.toml +++ b/images/tiler-server/config/providers/other_areas.toml @@ -70,7 +70,12 @@ SELECT osm_id, name, class, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_other_areas WHERE diff --git a/images/tiler-server/config/providers/other_lines.toml b/images/tiler-server/config/providers/other_lines.toml index 1bbebed5..358483c7 100644 --- a/images/tiler-server/config/providers/other_lines.toml +++ b/images/tiler-server/config/providers/other_lines.toml @@ -11,7 +11,12 @@ SELECT osm_id, name, class, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_other_lines WHERE diff --git a/images/tiler-server/config/providers/other_points.toml b/images/tiler-server/config/providers/other_points.toml index 7579017d..636a2729 100644 --- a/images/tiler-server/config/providers/other_points.toml +++ b/images/tiler-server/config/providers/other_points.toml @@ -13,7 +13,12 @@ SELECT class, type, tags->'artwork_type' AS artwork_type, - tags->'site_type' AS site_type + tags->'site_type' AS site_type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_other_points WHERE diff --git a/images/tiler-server/config/providers/place_areas.toml b/images/tiler-server/config/providers/place_areas.toml index b4fe21c1..2f04ef6f 100644 --- a/images/tiler-server/config/providers/place_areas.toml +++ b/images/tiler-server/config/providers/place_areas.toml @@ -10,7 +10,12 @@ SELECT id, osm_id, name, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_place_areas WHERE diff --git a/images/tiler-server/config/providers/place_points copy.toml b/images/tiler-server/config/providers/place_points copy.toml deleted file mode 100644 index 40695771..00000000 --- a/images/tiler-server/config/providers/place_points copy.toml +++ /dev/null @@ -1,19 +0,0 @@ -# Layer configuration for place points -[[providers.layers]] -name = "place_points" -geometry_fieldname = "geometry" -geometry_type = "point" -id_fieldname = "id" -sql = """ -SELECT - ST_AsMVTGeom(geometry, !BBOX!) AS geometry, - id, - osm_id, - name, - type, - tags->'capital' AS capital -FROM - osm_place_points -WHERE - geometry && !BBOX! -""" diff --git a/images/tiler-server/config/providers/place_points.toml b/images/tiler-server/config/providers/place_points.toml index 40695771..9f6dd7c1 100644 --- a/images/tiler-server/config/providers/place_points.toml +++ b/images/tiler-server/config/providers/place_points.toml @@ -11,7 +11,12 @@ SELECT osm_id, name, type, - tags->'capital' AS capital + tags->'capital' AS capital, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_place_points WHERE diff --git a/images/tiler-server/config/providers/transport_areas.toml b/images/tiler-server/config/providers/transport_areas.toml index 7c7df4b8..f3d9a95b 100644 --- a/images/tiler-server/config/providers/transport_areas.toml +++ b/images/tiler-server/config/providers/transport_areas.toml @@ -11,7 +11,12 @@ SELECT name, class, type, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_transport_areas WHERE diff --git a/images/tiler-server/config/providers/transport_associated_streets.toml b/images/tiler-server/config/providers/transport_associated_streets.toml index 7add6970..690b8ff4 100644 --- a/images/tiler-server/config/providers/transport_associated_streets.toml +++ b/images/tiler-server/config/providers/transport_associated_streets.toml @@ -13,7 +13,12 @@ SELECT m.name, m.relname, m.index, - r.type + r.type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_relations r, osm_relation_members m diff --git a/images/tiler-server/config/providers/transport_lines.toml b/images/tiler-server/config/providers/transport_lines.toml index a774f2f3..c6d085f7 100644 --- a/images/tiler-server/config/providers/transport_lines.toml +++ b/images/tiler-server/config/providers/transport_lines.toml @@ -152,7 +152,12 @@ SELECT service, ford, tags->'construction' AS construction, - tags->'usage' AS usage + tags->'usage' AS usage, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_transport_lines WHERE diff --git a/images/tiler-server/config/providers/transport_points.toml b/images/tiler-server/config/providers/transport_points.toml index 195fa85e..d69ea2e1 100644 --- a/images/tiler-server/config/providers/transport_points.toml +++ b/images/tiler-server/config/providers/transport_points.toml @@ -11,7 +11,12 @@ SELECT osm_id, name, class, - type + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_transport_points WHERE diff --git a/images/tiler-server/config/providers/water_areas.toml b/images/tiler-server/config/providers/water_areas.toml index a30b8346..8cd3aafc 100644 --- a/images/tiler-server/config/providers/water_areas.toml +++ b/images/tiler-server/config/providers/water_areas.toml @@ -9,7 +9,12 @@ SELECT ABS(osm_id) as osm_id, name, type, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_water_areas_gen0 WHERE @@ -29,7 +34,12 @@ SELECT ABS(osm_id) as osm_id, name, type, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_water_areas_gen0 WHERE @@ -50,7 +60,12 @@ SELECT ABS(osm_id) as osm_id, name, type, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_water_areas_gen0 WHERE @@ -71,7 +86,12 @@ SELECT ABS(osm_id) as osm_id, name, type, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_water_areas_gen0 WHERE @@ -91,7 +111,12 @@ SELECT ABS(osm_id) as osm_id, name, type, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_water_areas_gen1 WHERE @@ -111,7 +136,12 @@ SELECT osm_id, name, type, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_water_areas WHERE @@ -131,7 +161,12 @@ SELECT osm_id, name, type, - area + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_water_areas WHERE diff --git a/images/tiler-server/config/providers/water_lines.toml b/images/tiler-server/config/providers/water_lines.toml index 0b1255c8..2f4e06b8 100644 --- a/images/tiler-server/config/providers/water_lines.toml +++ b/images/tiler-server/config/providers/water_lines.toml @@ -112,7 +112,12 @@ SELECT tags->'bridge' AS bridge, tags->'surface' AS surface, tags->'start_date' AS start_date, - tags->'end_date' AS end_date + tags->'end_date' AS end_date, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy FROM osm_water_lines WHERE From 85e50504030de5e097c00418c0b9aedf8112a1d0 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Fri, 5 Jul 2024 11:28:19 -0500 Subject: [PATCH 6/7] Update ne layers - tiler server --- .../tiler-server/config/config.template.toml | 10 +- images/tiler-server/config/config.toml | 1891 +++++++++++++++++ .../config/providers/admin_ne.toml | 131 ++ .../config/providers/admin_ne.zoom.toml | 72 + 4 files changed, 2101 insertions(+), 3 deletions(-) create mode 100644 images/tiler-server/config/config.toml create mode 100644 images/tiler-server/config/providers/admin_ne.toml create mode 100644 images/tiler-server/config/providers/admin_ne.zoom.toml diff --git a/images/tiler-server/config/config.template.toml b/images/tiler-server/config/config.template.toml index 80ed7ef1..c7c6db6e 100644 --- a/images/tiler-server/config/config.template.toml +++ b/images/tiler-server/config/config.template.toml @@ -79,6 +79,8 @@ uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POS # srid = 3857 max_connections = 200 + ###### Admin lines ne + [['providers/admin_ne.toml']] ###### Water lands ne [['providers/water_areas_ne.toml']] @@ -188,21 +190,23 @@ center = [-74.275329586789, -12.153492567373, 8.0] name = "ne" attribution = "Natural Earth" center = [-74.275329586789, -12.153492567373, 8.0] + + [['providers/admin_ne.zoom.toml']] # Water lakes Natural Earth [[maps.layers]] name = "water_areas" - provider_layer = "osm.ne_water_lakes_0-2" + provider_layer = "ne.ne_water_lakes_0-2" min_zoom = 0 max_zoom = 2 [[maps.layers]] name = "water_areas" - provider_layer = "osm.ne_water_lakes_3-5" + provider_layer = "ne.ne_water_lakes_3-5" min_zoom = 3 max_zoom = 5 [[maps.layers]] name = "water_areas" - provider_layer = "osm.ne_water_lakes_6-8" + provider_layer = "ne.ne_water_lakes_6-8" min_zoom = 6 max_zoom = 8 diff --git a/images/tiler-server/config/config.toml b/images/tiler-server/config/config.toml new file mode 100644 index 00000000..fdef2dcc --- /dev/null +++ b/images/tiler-server/config/config.toml @@ -0,0 +1,1891 @@ +[webserver] +port = ":${TILER_SERVER_PORT}" + + [webserver.headers] + Access-Control-Allow-Origin = "*" + +# Tegola offers three tile caching strategies: "file", "redis", and "s3" +[cache] +type = "${TILER_CACHE_TYPE}" +basepath ="${TILER_CACHE_BASEPATH}" +max_zoom = "${TILER_CACHE_MAX_ZOOM}" + +bucket = "${TILER_CACHE_BUCKET}" +region = "${TILER_CACHE_REGION}" +aws_access_key_id = "${TILER_CACHE_AWS_ACCESS_KEY_ID}" +aws_secret_access_key = "${TILER_CACHE_AWS_SECRET_ACCESS_KEY}" + +# metrics +[observer] +type = "prometheus" + +# OpenStreetMap (OSM) +[[providers]] +name = "osm" +type = "mvt_postgis" +uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" +# srid = 3857 +max_connections = 200 + ###### Land providers + ###### From config/providers/land.toml + # Simplification for geometries + # 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 = "land_0-2" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!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, 200),!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, 70),!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, 30),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "land_10-12" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 10),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + + [[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 areas and lines + ###### From config/providers/water_areas.toml + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + name = "water_areas_gen0_0-2" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 10000), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_water_areas_gen0 + WHERE + type IN ('water', 'riverbank') + AND area > 100000000 + AND geometry && !BBOX! + """ + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + name = "water_areas_gen0_3-5" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1000), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_water_areas_gen0 + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 50000000 + AND geometry && !BBOX! + """ + + # Water bodies > 1,000,000 sqm + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + name = "water_areas_gen0_6-7" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_water_areas_gen0 + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 1000000 + AND geometry && !BBOX! + """ + + # Water bodies > 10,000 sqm + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + name = "water_areas_gen0_8-9" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_water_areas_gen0 + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND area > 10000 + AND geometry && !BBOX! + """ + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + name = "water_areas_gen1_10-12" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 50), !BBOX!) AS geometry, + ABS(osm_id) as osm_id, + name, + type, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_water_areas_gen1 + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') + AND geometry && !BBOX! + """ + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + name = "water_areas_13-15" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 5), !BBOX!) AS geometry, + id, + osm_id, + name, + type, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_water_areas + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') + AND geometry && !BBOX! + """ + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + name = "water_areas_16-20" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_water_areas + WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') + AND geometry && !BBOX! + """ + + + ###### From config/providers/water_lines.toml + # Simplification for geometries + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "osm_id" + name = "water_lines_gen0_6-6" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge + FROM + osm_water_lines_gen0 + WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! + """ + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "osm_id" + name = "water_lines_gen0_7-7" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1000), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge + FROM + osm_water_lines_gen0 + WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! + """ + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "osm_id" + name = "water_lines_gen0_8-8" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge + FROM + osm_water_lines_gen0 + WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! + """ + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "osm_id" + name = "water_lines_gen0_9-9" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge + FROM + osm_water_lines_gen0 + WHERE + type IN ('river', 'canal') + AND geometry && !BBOX! + """ + + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "osm_id" + name = "water_lines_gen1_10-11" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 20), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + type, + tags->'bridge' AS bridge, + tags->'surface' AS surface + FROM + osm_water_lines_gen1 + WHERE + type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') + AND geometry && !BBOX! + """ + + [[providers.layers]] + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "id" + name = "water_lines" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'bridge' AS bridge, + tags->'surface' AS surface, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_water_lines + WHERE + type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') + AND geometry && !BBOX! + """ + + ###### Water areas NE + ###### From config/providers/water_areas_ne.toml + [[providers.layers]] + name = "ne_water_lakes_0-2" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1000),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "ne_water_lakes_3-5" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "ne_water_lakes_6-8" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 100),!BBOX!) AS geometry, name, ogc_fid FROM ne_10m_lakes WHERE wkb_geometry && !BBOX!" + + + ###### Admin boundaries providers + ###### From config/providers/admin_boundaries_areas.toml + # Layer configuration for admin boundaries 0-2 + [[providers.layers]] + name = "admin_boundaries_0-2" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_admin_areas + WHERE + admin_level IN (1,2) + AND geometry && !BBOX! + """ + + # Layer configuration for admin boundaries 3-5 + [[providers.layers]] + name = "admin_boundaries_3-5" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 200), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4) + AND geometry && !BBOX! + """ + + # Layer configuration for admin boundaries 6-7 + [[providers.layers]] + name = "admin_boundaries_6-7" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6) + AND geometry && !BBOX! + """ + + # Layer configuration for admin boundaries 8-9 + [[providers.layers]] + name = "admin_boundaries_8-9" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 50), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6,7,8,9) + AND geometry && !BBOX! + """ + + # Layer configuration for admin boundaries 10-12 + [[providers.layers]] + name = "admin_boundaries_10-12" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 20), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! + """ + + # Layer configuration for admin boundaries 13-15 + [[providers.layers]] + name = "admin_boundaries_13-15" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 5), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! + """ + + # Layer configuration for admin boundaries 16-20 + [[providers.layers]] + name = "admin_boundaries_16-20" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 1), !BBOX!) AS geometry, + id, + osm_id, + admin_level, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_admin_areas + WHERE + admin_level IN (1,2,3,4,5,6,7,8,9,10) + AND geometry && !BBOX! + """ + + + ###### Land use areas + ###### From config/providers/landuse_areas.toml + # Layer 50,000,000 + [[providers.layers]] + name = "landuse_areas_gen0_3-5" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 500), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area + FROM + osm_landuse_areas_gen0 + WHERE + type IN ('forest', 'wood', 'nature reserve', 'nature_reserve', 'military') + AND area > 50000000 + AND geometry && !BBOX! + """ + + # Layer 1,000,000 + [[providers.layers]] + name = "landuse_areas_gen0_6-9" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(ST_Simplify(geometry, 100), !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area + FROM + osm_landuse_areas_gen0 + WHERE + type IN ('forest', 'wood', 'nature reserve', 'nature_reserve', 'military') + AND area > 1000000 + AND geometry && !BBOX! + """ + + # Layer configuration for landuse areas gen1 + [[providers.layers]] + name = "landuse_areas_gen1_10-12" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + name, + class, + type, + area + FROM + osm_landuse_areas_gen1 + WHERE + geometry && !BBOX! + """ + # Layer configuration for landuse areas + [[providers.layers]] + name = "landuse_areas_13-20" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'wetland' AS wetland, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_landuse_areas + WHERE + geometry && !BBOX! + """ + + + ###### Land use lines and points + ###### From config/providers/landuse_lines.toml + # Layer configuration for landuse lines + [[providers.layers]] + name = "landuse_lines" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_landuse_lines + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/landuse_points.toml + # Layer configuration for landuse points + [[providers.layers]] + name = "landuse_points" + geometry_fieldname = "geometry" + geometry_type = "point" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_landuse_points + WHERE + geometry && !BBOX! + """ + + + ###### Transport lines, points and areas from ways + ###### From config/providers/transport_points.toml + # Layer configuration for transport points + [[providers.layers]] + name = "transport_points" + geometry_fieldname = "geometry" + geometry_type = "point" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_transport_points + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/transport_lines.toml + # Layer configuration for transport lines gen0 + [[providers.layers]] + name = "transport_lines_gen0" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + ABS(osm_id) AS osm_id, + type, + tunnel, + bridge, + ref, + service, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage + FROM + osm_transport_lines_gen0 + WHERE + type IN ('motorway', 'trunk', 'motorway_link', 'trunk_link', 'primary') + AND tunnel = 0 + AND bridge = 0 + AND geometry && !BBOX! + """ + + # Layer configuration for transport lines gen1 + [[providers.layers]] + name = "transport_lines_gen1" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + ref, + class, + type, + service, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage + FROM + osm_transport_lines_gen1 + WHERE + type IN ( + 'motorway', 'trunk', 'primary', 'primary_link', 'secondary', + 'motorway_link', 'trunk_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', + 'funicular', 'taxiway', 'runway', 'proposed', 'construction', + 'disused', 'abandoned', 'razed', 'ferry' + ) + AND geometry && !BBOX! + """ + + # Layer configuration for transport lines 11-12 + [[providers.layers]] + name = "transport_lines_11-12" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage + FROM + osm_transport_lines + WHERE + type IN ( + 'motorway', 'motorway_link', 'trunk', 'trunk_link', + 'primary', 'primary_link', 'secondary', 'secondary_link', + 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', + 'funicular', 'taxiway', 'runway', 'proposed', 'construction', + 'disused', 'abandoned', 'razed', 'apron', 'ferry' + ) + AND geometry && !BBOX! + """ + + # Layer configuration for transport lines 13 + [[providers.layers]] + name = "transport_lines_13" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage + FROM + osm_transport_lines + WHERE + type IN ( + 'motorway', 'motorway_link', 'trunk', 'trunk_link', + 'primary', 'primary_link', 'secondary', 'secondary_link', + 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', + 'tram', 'narrow_gauge', 'monorail', 'preserved', + 'miniature', 'funicular', 'taxiway', 'runway', 'residential', + 'taxiway', 'runway', 'proposed', 'construction', 'disused', + 'abandoned', 'razed', 'apron', 'ferry' + ) + AND geometry && !BBOX! + """ + + # Layer configuration for transport lines 14-20 + [[providers.layers]] + name = "transport_lines_14-20" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + ref, + class, + type, + tunnel, + bridge, + access, + service, + ford, + tags->'construction' AS construction, + tags->'usage' AS usage, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_transport_lines + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/transport_areas.toml + [[providers.layers]] + name = "transport_areas" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + area, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_transport_areas + WHERE + geometry && !BBOX! + """ + + + ###### Amenities areas and points + ###### From config/providers/amenity_areas.toml + # Layer configuration for amenity areas + [[providers.layers]] + name = "amenity_areas" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "osm_id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + osm_id, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_amenity_areas + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/amenity_points.toml + # Layer configuration for amenity points + [[providers.layers]] + name = "amenity_points" + geometry_fieldname = "geometry" + geometry_type = "point" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_amenity_points + WHERE + geometry && !BBOX! + """ + + + ###### Place points and areas + ###### From config/providers/place_points.toml + # Layer configuration for place points + [[providers.layers]] + name = "place_points" + geometry_fieldname = "geometry" + geometry_type = "point" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'capital' AS capital, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_place_points + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/place_areas.toml + # Layer configuration for place areas + [[providers.layers]] + name = "place_areas" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_place_areas + WHERE + geometry && !BBOX! + """ + + + ###### Other (Man Made, Historic, Military, Power, Barrier etc) + ###### From config/providers/other_points.toml + # Layer configuration for other points + [[providers.layers]] + name = "other_points" + geometry_fieldname = "geometry" + geometry_type = "point" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'artwork_type' AS artwork_type, + tags->'site_type' AS site_type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_other_points + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/other_lines.toml + # Layer configuration for other lines + [[providers.layers]] + name = "other_lines" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_other_lines + WHERE + geometry && !BBOX! + """ + + ###### From config/providers/other_areas.toml + [[providers.layers]] + name = "other_areas_6-8" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_other_areas + WHERE + area > 1000000 + AND geometry && !BBOX! + """ + + [[providers.layers]] + name = "other_areas_9-11" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_other_areas + WHERE + area > 100000 + AND geometry && !BBOX! + """ + + [[providers.layers]] + name = "other_areas_12-14" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type + FROM + osm_other_areas + WHERE + area > 10000 + AND geometry && !BBOX! + """ + + [[providers.layers]] + name = "other_areas_15-20" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_other_areas + WHERE + geometry && !BBOX! + """ + + ###### Buildings + ###### From config/providers/buildings.toml + # Layer configuration for buildings + [[providers.layers]] + name = "buildings" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + nullif(as_numeric(height), -1) AS height, + type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_buildings + WHERE + geometry && !BBOX! + """ + + + ###### transport_associated_streets + ###### From config/providers/transport_associated_streets.toml + # Layer configuration for transport associated streets + [[providers.layers]] + name = "transport_associated_streets" + geometry_fieldname = "geometry" + geometry_type = "LineString" + id_fieldname = "id" + sql = """ + SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + r.id, + m.member, + r.osm_id, + m.name, + m.relname, + m.index, + r.type, + tags->'name:ar' as name_ar, + tags->'name:en' as name_en, + tags->'name:he' as name_he, + tags->'name:fr' as name_fr, + tags->'name:hy' as name_hy + FROM + osm_relations r, + osm_relation_members m + WHERE + r.osm_id = m.osm_id + AND r.type = 'associatedStreet' + AND geometry && !BBOX! + """ + + +# Natural Earth (ne) +[[providers]] +name = "ne" +type = "mvt_postgis" +uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" + +# srid = 3857 +max_connections = 200 + ###### Admin lines ne + ###### From config/providers/admin_ne.toml + [[providers.layers]] + name = "ne_110m_admin_0_boundary_lines_land" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom + FROM ne_110m_admin_0_boundary_lines_land + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_50m_admin_0_boundary_lines_land" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom + FROM ne_50m_admin_0_boundary_lines_land + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_10m_admin_0_boundary_lines_land" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom + FROM ne_10m_admin_0_boundary_lines_land + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_50m_admin_0_boundary_lines_disputed_areas" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom + FROM ne_50m_admin_0_boundary_lines_disputed_areas + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_10m_admin_0_boundary_lines_disputed_areas" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom + FROM ne_10m_admin_0_boundary_lines_disputed_areas + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_110m_admin_0_countries" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label + FROM ne_110m_admin_0_countries + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_50m_admin_0_countries" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label + FROM ne_50m_admin_0_countries + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_10m_admin_0_countries" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label + FROM ne_10m_admin_0_countries + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_110m_admin_1_states_provinces_lines" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom + FROM ne_110m_admin_1_states_provinces_lines + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_50m_admin_1_states_provinces_lines" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom + FROM ne_50m_admin_1_states_provinces_lines + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_10m_admin_1_states_provinces_lines" + geometry_fieldname = "geometry" + geometry_type = "linestring" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom, min_label + FROM ne_10m_admin_1_states_provinces_lines + WHERE wkb_geometry && !BBOX! + """ + + [[providers.layers]] + name = "ne_10m_admin_0_label_points" + geometry_fieldname = "geometry" + geometry_type = "point" + id_fieldname = "ogc_fid" + sql = """ + SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, sr_subunit, scalerank + FROM ne_10m_admin_0_label_points + WHERE wkb_geometry && !BBOX! + """ + ###### Water lands ne + ###### From config/providers/water_areas_ne.toml + [[providers.layers]] + name = "ne_water_lakes_0-2" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 1000),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "ne_water_lakes_3-5" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, name, ogc_fid FROM ne_50m_lakes WHERE wkb_geometry && !BBOX!" + + [[providers.layers]] + name = "ne_water_lakes_6-8" + geometry_fieldname = "geometry" + geometry_type = "multipolygon" + id_fieldname = "ogc_fid" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 100),!BBOX!) AS geometry, name, ogc_fid FROM ne_10m_lakes WHERE wkb_geometry && !BBOX!" + + +[[maps]] +name = "osm" +attribution = "OpenStreetMap" +center = [-74.275329586789, -12.153492567373, 8.0] + ###### Land + ###### From config/providers/land.zoom.toml + [[maps.layers]] + name = "land" + 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 display zooms + ###### From config/providers/admin_boundaries_areas.zoom.toml + # Admin Bounduaries Areas + [[maps.layers]] + name = "land_osm" + provider_layer = "osm.admin_boundaries_0-2" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "land_osm" + provider_layer = "osm.admin_boundaries_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "land_osm" + provider_layer = "osm.admin_boundaries_6-7" + min_zoom = 6 + max_zoom = 7 + + [[maps.layers]] + name = "land_osm" + provider_layer = "osm.admin_boundaries_8-9" + min_zoom = 8 + max_zoom = 9 + + [[maps.layers]] + name = "land_osm" + provider_layer = "osm.admin_boundaries_10-12" + min_zoom = 10 + max_zoom = 12 + + [[maps.layers]] + name = "land_osm" + provider_layer = "osm.admin_boundaries_13-15" + min_zoom = 13 + max_zoom = 15 + + [[maps.layers]] + name = "land_osm" + provider_layer = "osm.admin_boundaries_16-20" + min_zoom = 16 + max_zoom = 20 + + ###### Land Use + ###### From config/providers/landuse_areas.zoom.toml + [[maps.layers]] + name = "landuse_areas" + provider_layer = "osm.landuse_areas_gen0_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "landuse_areas" + provider_layer = "osm.landuse_areas_gen0_6-9" + min_zoom = 6 + max_zoom = 9 + + [[maps.layers]] + name = "landuse_areas" + provider_layer = "osm.landuse_areas_gen1_10-12" + min_zoom = 10 + max_zoom = 12 + + [[maps.layers]] + name = "landuse_areas" + provider_layer = "osm.landuse_areas_13-20" + min_zoom = 13 + max_zoom = 20 + + ###### From config/providers/landuse_lines.zoom.toml + [[maps.layers]] + name = "landuse_lines" + provider_layer = "osm.landuse_lines" + min_zoom = 14 + max_zoom = 20 + ###### From config/providers/landuse_points.zoom.toml + [[maps.layers]] + name = "landuse_points" + provider_layer = "osm.landuse_points" + min_zoom = 6 + max_zoom = 20 + + ###### Water areas/lines + ###### From config/providers/water_areas.zoom.toml + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_gen0_0-2" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_gen0_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_gen0_6-7" + min_zoom = 6 + max_zoom = 7 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_gen0_8-9" + min_zoom = 8 + max_zoom = 9 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_gen1_10-12" + min_zoom = 10 + max_zoom = 12 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_13-15" + min_zoom = 13 + max_zoom = 15 + + [[maps.layers]] + name = "water_areas" + provider_layer = "osm.water_areas_16-20" + min_zoom = 16 + max_zoom = 20 + ###### From config/providers/water_lines.zoom.toml + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines_gen0_6-6" + min_zoom = 6 + max_zoom = 6 + + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines_gen0_7-7" + min_zoom = 7 + max_zoom = 7 + + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines_gen0_8-8" + min_zoom = 8 + max_zoom = 8 + + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines_gen0_9-9" + min_zoom = 9 + max_zoom = 9 + + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines_gen1_10-11" + min_zoom = 10 + max_zoom = 11 + + [[maps.layers]] + name = "water_lines" + provider_layer = "osm.water_lines" + min_zoom = 12 + max_zoom = 20 + + # Transport Lines (Roads, Rail, Aviation) + ###### From config/providers/transport_lines.zoom.toml + [[maps.layers]] + name = "transport_lines" + provider_layer = "osm.transport_lines_gen0" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "transport_lines" + provider_layer = "osm.transport_lines_gen1" + min_zoom = 6 + max_zoom = 10 + + [[maps.layers]] + name = "transport_lines" + provider_layer = "osm.transport_lines_11-12" + min_zoom = 11 + max_zoom = 12 + + [[maps.layers]] + name = "transport_lines" + provider_layer = "osm.transport_lines_13" + min_zoom = 13 + max_zoom = 13 + + [[maps.layers]] + name = "transport_lines" + provider_layer = "osm.transport_lines_14-20" + min_zoom = 14 + max_zoom = 20 + [['providers/route_lines.zoom.toml']] + + ###### admin_boundaries_maritime + [['providers/admin_boundaries_maritime.zoom.toml']] + + # Transport Areas + [[maps.layers]] + name = "transport_areas" + provider_layer = "osm.transport_areas" + min_zoom = 12 + max_zoom = 20 + + # Transport Points + [[maps.layers]] + name = "transport_points" + provider_layer = "osm.transport_points" + min_zoom = 14 + max_zoom = 20 + + # Amenity Areas + [[maps.layers]] + name = "amenity_areas" + provider_layer = "osm.amenity_areas" + min_zoom = 14 + max_zoom = 20 + + + + # Amenity Points + [[maps.layers]] + name = "amenity_points" + provider_layer = "osm.amenity_points" + min_zoom = 14 + max_zoom = 20 + + # Place Points + [[maps.layers]] + name = "place_points" + provider_layer = "osm.place_points" + min_zoom = 1 + max_zoom = 20 + + # Place areas + [[maps.layers]] + name = "place_areas" + provider_layer = "osm.place_areas" + min_zoom = 14 + max_zoom = 20 + + # Other Points + [[maps.layers]] + name = "other_points" + provider_layer = "osm.other_points" + min_zoom = 14 + max_zoom = 20 + + # Other Lines + [[maps.layers]] + name = "other_lines" + provider_layer = "osm.other_lines" + min_zoom = 14 + max_zoom = 20 + + # Other Areas + ###### From config/providers/other_areas.zoom.toml + # Other Areas + [[maps.layers]] + name = "other_areas" + provider_layer = "osm.other_areas_6-8" + min_zoom = 6 + max_zoom = 8 + + [[maps.layers]] + name = "other_areas" + provider_layer = "osm.other_areas_9-11" + min_zoom = 9 + max_zoom = 11 + + [[maps.layers]] + name = "other_areas" + provider_layer = "osm.other_areas_12-14" + min_zoom = 12 + max_zoom = 14 + + [[maps.layers]] + name = "other_areas" + provider_layer = "osm.other_areas_15-20" + min_zoom = 15 + max_zoom = 20 + + + # Buildings + [[maps.layers]] + name = "buildings" + provider_layer = "osm.buildings" + min_zoom = 14 + max_zoom = 20 + + + [[maps.layers]] + name = "transport_associated_streets" + provider_layer = "osm.transport_associated_streets" + min_zoom = 7 + max_zoom = 20 + + +[[maps]] +name = "ne" +attribution = "Natural Earth" +center = [-74.275329586789, -12.153492567373, 8.0] + + ###### From config/providers/admin_ne.zoom.toml + [[maps.layers]] + name = "country_lines" + provider_layer = "ne.ne_110m_admin_0_boundary_lines_land" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "country_lines" + provider_layer = "ne.ne_50m_admin_0_boundary_lines_land" + dont_simplify = true + min_zoom = 3 + max_zoom = 4 + + [[maps.layers]] + name = "country_lines" + provider_layer = "ne.ne_10m_admin_0_boundary_lines_land" + min_zoom = 5 + max_zoom = 10 + + [[maps.layers]] + name = "country_lines_disputed" + provider_layer = "ne.ne_50m_admin_0_boundary_lines_disputed_areas" + min_zoom = 3 + max_zoom = 4 + + [[maps.layers]] + name = "country_lines_disputed" + provider_layer = "ne.ne_10m_admin_0_boundary_lines_disputed_areas" + min_zoom = 5 + max_zoom = 10 + + [[maps.layers]] + name = "country_label_points" + provider_layer = "ne.ne_10m_admin_0_label_points" + min_zoom = 3 + max_zoom = 20 + + [[maps.layers]] + name = "country_polygons" + provider_layer = "ne.ne_110m_admin_0_countries" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "country_polygons" + provider_layer = "ne.ne_50m_admin_0_countries" + min_zoom = 3 + max_zoom = 4 + + [[maps.layers]] + name = "country_polygons" + provider_layer = "ne.ne_10m_admin_0_countries" + min_zoom = 5 + max_zoom = 10 + + [[maps.layers]] + name = "state_lines" + provider_layer = "ne.ne_110m_admin_1_states_provinces_lines" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "state_lines" + provider_layer = "ne.ne_50m_admin_1_states_provinces_lines" + min_zoom = 3 + max_zoom = 4 + + [[maps.layers]] + name = "state_lines" + provider_layer = "ne.ne_10m_admin_1_states_provinces_lines" + min_zoom = 5 + max_zoom = 10 + # Water lakes Natural Earth + [[maps.layers]] + name = "water_areas" + provider_layer = "ne.ne_water_lakes_0-2" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "water_areas" + provider_layer = "ne.ne_water_lakes_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "water_areas" + provider_layer = "ne.ne_water_lakes_6-8" + min_zoom = 6 + max_zoom = 8 diff --git a/images/tiler-server/config/providers/admin_ne.toml b/images/tiler-server/config/providers/admin_ne.toml new file mode 100644 index 00000000..6a7a757e --- /dev/null +++ b/images/tiler-server/config/providers/admin_ne.toml @@ -0,0 +1,131 @@ +[[providers.layers]] +name = "ne_110m_admin_0_boundary_lines_land" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom +FROM ne_110m_admin_0_boundary_lines_land +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_50m_admin_0_boundary_lines_land" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom +FROM ne_50m_admin_0_boundary_lines_land +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_10m_admin_0_boundary_lines_land" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom +FROM ne_10m_admin_0_boundary_lines_land +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_50m_admin_0_boundary_lines_disputed_areas" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom +FROM ne_50m_admin_0_boundary_lines_disputed_areas +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_10m_admin_0_boundary_lines_disputed_areas" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, min_zoom +FROM ne_10m_admin_0_boundary_lines_disputed_areas +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_110m_admin_0_countries" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label +FROM ne_110m_admin_0_countries +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_50m_admin_0_countries" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label +FROM ne_50m_admin_0_countries +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_10m_admin_0_countries" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, name_long, abbrev, adm0_a3, min_zoom, min_label, max_label +FROM ne_10m_admin_0_countries +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_110m_admin_1_states_provinces_lines" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom +FROM ne_110m_admin_1_states_provinces_lines +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_50m_admin_1_states_provinces_lines" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom +FROM ne_50m_admin_1_states_provinces_lines +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_10m_admin_1_states_provinces_lines" +geometry_fieldname = "geometry" +geometry_type = "linestring" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, featurecla, name, adm0_name, min_zoom, min_label +FROM ne_10m_admin_1_states_provinces_lines +WHERE wkb_geometry && !BBOX! +""" + +[[providers.layers]] +name = "ne_10m_admin_0_label_points" +geometry_fieldname = "geometry" +geometry_type = "point" +id_fieldname = "ogc_fid" +sql = """ +SELECT ST_AsMVTGeom(wkb_geometry, !BBOX!) AS geometry, ogc_fid, sr_subunit, scalerank +FROM ne_10m_admin_0_label_points +WHERE wkb_geometry && !BBOX! +""" \ No newline at end of file diff --git a/images/tiler-server/config/providers/admin_ne.zoom.toml b/images/tiler-server/config/providers/admin_ne.zoom.toml new file mode 100644 index 00000000..11457e3f --- /dev/null +++ b/images/tiler-server/config/providers/admin_ne.zoom.toml @@ -0,0 +1,72 @@ +[[maps.layers]] +name = "country_lines" +provider_layer = "ne.ne_110m_admin_0_boundary_lines_land" +min_zoom = 0 +max_zoom = 2 + +[[maps.layers]] +name = "country_lines" +provider_layer = "ne.ne_50m_admin_0_boundary_lines_land" +dont_simplify = true +min_zoom = 3 +max_zoom = 4 + +[[maps.layers]] +name = "country_lines" +provider_layer = "ne.ne_10m_admin_0_boundary_lines_land" +min_zoom = 5 +max_zoom = 10 + +[[maps.layers]] +name = "country_lines_disputed" +provider_layer = "ne.ne_50m_admin_0_boundary_lines_disputed_areas" +min_zoom = 3 +max_zoom = 4 + +[[maps.layers]] +name = "country_lines_disputed" +provider_layer = "ne.ne_10m_admin_0_boundary_lines_disputed_areas" +min_zoom = 5 +max_zoom = 10 + +[[maps.layers]] +name = "country_label_points" +provider_layer = "ne.ne_10m_admin_0_label_points" +min_zoom = 3 +max_zoom = 20 + +[[maps.layers]] +name = "country_polygons" +provider_layer = "ne.ne_110m_admin_0_countries" +min_zoom = 0 +max_zoom = 2 + +[[maps.layers]] +name = "country_polygons" +provider_layer = "ne.ne_50m_admin_0_countries" +min_zoom = 3 +max_zoom = 4 + +[[maps.layers]] +name = "country_polygons" +provider_layer = "ne.ne_10m_admin_0_countries" +min_zoom = 5 +max_zoom = 10 + +[[maps.layers]] +name = "state_lines" +provider_layer = "ne.ne_110m_admin_1_states_provinces_lines" +min_zoom = 0 +max_zoom = 2 + +[[maps.layers]] +name = "state_lines" +provider_layer = "ne.ne_50m_admin_1_states_provinces_lines" +min_zoom = 3 +max_zoom = 4 + +[[maps.layers]] +name = "state_lines" +provider_layer = "ne.ne_10m_admin_1_states_provinces_lines" +min_zoom = 5 +max_zoom = 10 \ No newline at end of file From cf9c368df080acfb13653df833d755488b1fa05b Mon Sep 17 00:00:00 2001 From: Rub21 Date: Fri, 5 Jul 2024 16:53:36 -0500 Subject: [PATCH 7/7] Update container for tiler --- compose/tiler.yml | 64 +++++++++++++++------------------- images/tiler-server/Dockerfile | 3 -- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/compose/tiler.yml b/compose/tiler.yml index 5f676b40..b3124f50 100644 --- a/compose/tiler.yml +++ b/compose/tiler.yml @@ -18,49 +18,43 @@ services: # # ###################################################### # # ### Tiler imposm for importing data # # ###################################################### - tiler-imposm: - image: osmseed-tiler-imposm:v1 - build: - context: ../images/tiler-imposm - dockerfile: Dockerfile - volumes: - - ../data/tiler-imposm-data:/mnt/data - # - ../images/tiler-imposm:/osm - command: - - sh - - -c - - "./start.sh" - env_file: - - ../envs/.env.tiler-db - - ../envs/.env.tiler-imposm - healthcheck: - test: ["CMD", "./liveness.sh"] - interval: 30s - timeout: 10s - retries: 3 - restart: always + # tiler-imposm: + # image: osmseed-tiler-imposm:v1 + # build: + # context: ../images/tiler-imposm + # dockerfile: Dockerfile + # volumes: + # - ../data/tiler-imposm-data:/mnt/data + # # - ../images/tiler-imposm:/osm + # command: + # - sh + # - -c + # - "./start.sh" + # env_file: + # - ../envs/.env.tiler-db + # - ../envs/.env.tiler-imposm + # healthcheck: + # test: ["CMD", "./liveness.sh"] + # interval: 30s + # timeout: 10s + # retries: 3 + # restart: always # # ###################################################### # # ### Tiler server # # ###################################################### tiler-server: image: osmseed-tiler-server:v1 + # platform: linux/amd64 build: context: ../images/tiler-server dockerfile: Dockerfile volumes: - - ../images/tiler-server:/app - - ../data/tiler-imposm-data:/mnt/data/imposm - depends_on: - - tiler-db - - tiler-imposm + - ../images/tiler-server:/app + - ../data/tiler-imposm-data:/mnt/data/imposm ports: - - "9090:9090" - command: - - sh - - -c - - "./start.sh" + - "9090:9090" + command: "./start.sh" env_file: - - ../envs/.env.tiler-db - - ../envs/.env.tiler-server - restart: always - \ No newline at end of file + - ../envs/.env.tiler-db + - ../envs/.env.tiler-server + restart: always \ No newline at end of file diff --git a/images/tiler-server/Dockerfile b/images/tiler-server/Dockerfile index 382516ee..ce77ee72 100644 --- a/images/tiler-server/Dockerfile +++ b/images/tiler-server/Dockerfile @@ -29,10 +29,7 @@ RUN cd /opt/ && python build_config.py \ --providers config/providers \ --output /opt/tegola_config/config.toml -# Volumen -VOLUME /mnt/data # Copy config and exec files -COPY ./config/config.toml /opt/tegola_config/config.toml COPY ./tile2bounds.py . COPY ./start.sh . COPY ./expire-watcher.sh .