diff --git a/.github/workflows/frontend-nominatim.yaml b/.github/workflows/frontend-nominatim.yaml index 6dae9bb9..8b4e17bc 100644 --- a/.github/workflows/frontend-nominatim.yaml +++ b/.github/workflows/frontend-nominatim.yaml @@ -17,7 +17,7 @@ jobs: if: github.ref == 'refs/heads/staging' uses: allenevans/set-env@v2.0.0 with: - NOMINATIM_API: 'https://nominatim-api-staging.openhistoricalmap.org/' + NOMINATIM_API: 'https://nominatim-api.staging.openhistoricalmap.org/' NOMINATIM_BUCKET: 'nominatim-staging.openhistoricalmap.org' CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_NOMINATIM_CLOUDFRONT_ID }} diff --git a/.github/workflows/frontend-overpass.yaml b/.github/workflows/frontend-overpass.yaml index c4c00939..f12b1704 100644 --- a/.github/workflows/frontend-overpass.yaml +++ b/.github/workflows/frontend-overpass.yaml @@ -17,7 +17,7 @@ jobs: if: github.ref == 'refs/heads/staging' uses: allenevans/set-env@v2.0.0 with: - OVERPASS_API: overpass-api-staging.openhistoricalmap.org + OVERPASS_API: overpass-api.staging.openhistoricalmap.org OVERPASS_BUCKET: overpass-turbo-staging.openhistoricalmap.org CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_OVERPASS_CLOUDFRONT_ID }} diff --git a/.github/workflows/frontend-tasking-manager.yaml b/.github/workflows/frontend-tasking-manager.yaml index f5dbdc5a..7ba9fd38 100644 --- a/.github/workflows/frontend-tasking-manager.yaml +++ b/.github/workflows/frontend-tasking-manager.yaml @@ -18,7 +18,7 @@ jobs: uses: allenevans/set-env@v2.0.0 with: TM_APP_BASE_URL: https://tasks-staging.openhistoricalmap.org - TM_APP_API_URL: https://staging-tm-api.openhistoricalmap.org + TM_APP_API_URL: https://tm-api.staging.openhistoricalmap.org TM_APP_API_VERSION: v2 TM_ORG_NAME: OpenHistoricalMap TM_ORG_CODE: OHM diff --git a/.gitignore b/.gitignore index 418eec33..847d2c97 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ values.dev.yaml secrets tegola envs/.env.tiler -envs/.env.web \ No newline at end of file +envs/.env.web +config.toml \ No newline at end of file diff --git a/images/tiler-server/Dockerfile b/images/tiler-server/Dockerfile index d0479d79..9e832147 100644 --- a/images/tiler-server/Dockerfile +++ b/images/tiler-server/Dockerfile @@ -24,8 +24,16 @@ RUN rm -rf /var/cache/apk/* \ 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 + # Copy config and exec files -COPY ./config/config.toml /opt/tegola_config/config.toml +# COPY ./config/config.toml /opt/tegola_config/config.toml COPY ./tile2bounds.py . COPY ./start.sh . COPY ./expire-watcher.sh . diff --git a/images/tiler-server/build_config.py b/images/tiler-server/build_config.py new file mode 100644 index 00000000..d52d3443 --- /dev/null +++ b/images/tiler-server/build_config.py @@ -0,0 +1,36 @@ +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, new_config 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] + content = content.replace(section_header, new_config.replace("\n", "\n" + indentation)) + +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..8d1804e5 --- /dev/null +++ b/images/tiler-server/config/config.template.toml @@ -0,0 +1,421 @@ +[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" +host = "${POSTGRES_HOST}" +port = "${POSTGRES_PORT}" +database = "${POSTGRES_DB}" +user = "${POSTGRES_USER}" +password = "${POSTGRES_PASSWORD}" +# srid = 3857 +max_connections = 50 + ###### Land providers + [['providers/land.toml']] + + ###### Water areas and lines + [['providers/water_areas.toml']] + [['providers/water_lines.toml']] + + ###### Admin boundaries providers + [['providers/admin_boundaries.toml']] + + ###### Land use areas + [['providers/landuse_areas.toml']] + + ###### Land use lines and points + [['providers/landuse_lines.toml']] + [['providers/landuse_points.toml']] + + ###### Transport lines from ways + [['providers/transport_lines.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']] + + ###### Transport lines from relations + [['providers/transport_lines_relation.toml']] + +[[maps]] +name = "osm" +attribution = "OpenHistoricalMap" +center = [-74.275329586789, -12.153492567373, 8.0] + + # Land + [[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 + [[maps.layers]] + name = "land_ohm" + provider_layer = "osm.admin_boundaries_0-2" + min_zoom = 0 + max_zoom = 2 + + [[maps.layers]] + name = "land_ohm" + provider_layer = "osm.admin_boundaries_3-5" + min_zoom = 3 + max_zoom = 5 + + [[maps.layers]] + name = "land_ohm" + provider_layer = "osm.admin_boundaries_6-7" + min_zoom = 6 + max_zoom = 7 + + [[maps.layers]] + name = "land_ohm" + provider_layer = "osm.admin_boundaries_8-9" + min_zoom = 8 + max_zoom = 9 + + [[maps.layers]] + name = "land_ohm" + provider_layer = "osm.admin_boundaries_10-12" + min_zoom = 10 + max_zoom = 12 + + [[maps.layers]] + name = "land_ohm" + provider_layer = "osm.admin_boundaries_13-15" + min_zoom = 13 + max_zoom = 15 + + [[maps.layers]] + name = "land_ohm" + provider_layer = "osm.admin_boundaries_16-20" + min_zoom = 16 + max_zoom = 20 + + # [[maps.layers]] + # name = "admin_lines" + # provider_layer = "osm.admin_boundaries_8-12" + # min_zoom = 8 + # max_zoom = 12 + + # [[maps.layers]] + # name = "admin_lines" + # provider_layer = "osm.admin_boundaries_13-20" + # min_zoom = 13 + # max_zoom = 20 + + # [[maps.layers]] + # name = "state_label_points" + # provider_layer = "ne.ne_10m_admin_1_label_points" + # min_zoom = 3 + # max_zoom = 20 + + # Land Use + [[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 + + [[maps.layers]] + name = "landuse_lines" + provider_layer = "osm.landuse_lines" + min_zoom = 14 + max_zoom = 20 + + [[maps.layers]] + name = "landuse_points" + provider_layer = "osm.landuse_points" + min_zoom = 6 + max_zoom = 20 + + # Water Areas + [[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 + + # Water Lines + + [[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) + [[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 + + # Transport Lines from relations + [[maps.layers]] + name = "transport_lines_relation" + provider_layer = "osm.transport_lines_5_10_relation" + min_zoom = 5 + max_zoom = 10 + + [[maps.layers]] + name = "transport_lines_relation" + provider_layer = "osm.transport_lines_11_20_relation" + min_zoom = 11 + max_zoom = 20 + + # 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 + [[maps.layers]] + name = "other_areas" + provider_layer = "osm.other_areas_filter" + min_zoom = 6 + max_zoom = 8 + + [[maps.layers]] + name = "other_areas" + provider_layer = "osm.other_areas" + min_zoom = 9 + 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 + \ No newline at end of file diff --git a/images/tiler-server/config/config.toml b/images/tiler-server/config/config.toml deleted file mode 100644 index af103e03..00000000 --- a/images/tiler-server/config/config.toml +++ /dev/null @@ -1,673 +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" -host = "${POSTGRES_HOST}" -port = "${POSTGRES_PORT}" -database = "${POSTGRES_DB}" -user = "${POSTGRES_USER}" -password = "${POSTGRES_PASSWORD}" -# srid = 3857 -max_connections = 40 - # Land - [[providers.layers]] - name = "land_0-2" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 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 - [[providers.layers]] - name = "water_areas" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, name, type, area, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_areas WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') AND geometry && !BBOX!" - - [[providers.layers]] - name = "water_areas_gen0" - 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, type, area, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_areas_gen0 WHERE type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 500000000 AND geometry && !BBOX!" - - [[providers.layers]] - name = "water_areas_gen0_6" - 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, type, area, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_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" - geometry_type = "multipolygon" - id_fieldname = "osm_id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, ABS(osm_id) as osm_id, name, type, area, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_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" - geometry_type = "linestring" - id_fieldname = "id" - 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, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_lines WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') AND geometry && !BBOX!" - - [[providers.layers]] - name = "water_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, name, type, tags->'bridge' as bridge, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_lines_gen0 WHERE type IN ('river', 'canal') AND geometry && !BBOX!" - - [[providers.layers]] - name = "water_lines_gen1" - geometry_fieldname = "geometry" - geometry_type = "linestring" - id_fieldname = "osm_id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, ABS(osm_id) as osm_id, name, type, tags->'bridge' as bridge, tags->'surface' as surface, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_water_lines_gen1 WHERE type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') AND geometry && !BBOX!" - - # Admin boundaries - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2) AND geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4) AND geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6) AND geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9) AND geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) AND geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_admin_areas WHERE admin_level IN (1,2,3,4,5,6,7,8,9,10) AND geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_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" - 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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_landuse_areas WHERE geometry && !BBOX!" - - [[providers.layers]] - name = "landuse_areas_gen0" - 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, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_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" - 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, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_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" - 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, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_landuse_areas_gen1 WHERE geometry && !BBOX!" - - # Land Use 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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_landuse_lines WHERE geometry && !BBOX!" - - # Land Use 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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_landuse_points WHERE geometry && !BBOX!" - - # Transport - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_transport_points WHERE geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_transport_areas WHERE geometry && !BBOX!" - - [[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, tags->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate 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" - geometry_type = "linestring" - id_fieldname = "osm_id" - sql = """SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, osm_id, ref, class, type, tags->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate - 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!""" - - [[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->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate - 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!""" - - [[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->'usage' as usage, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate - 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!""" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate - FROM osm_transport_lines - WHERE geometry && !BBOX!""" - - # Amenities - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_amenity_areas WHERE geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_amenity_points WHERE geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate, tags->'capital' as capital FROM osm_place_points WHERE geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate, tags->'capital' as capital FROM osm_place_areas WHERE geometry && !BBOX!" - - # Other (Man Made, Historic, Military, Power, Barrier etc) - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_other_points WHERE geometry && !BBOX!" - - [[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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_other_lines WHERE geometry && !BBOX!" - - [[providers.layers]] - name = "other_areas" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, name, class, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_other_areas WHERE geometry && !BBOX!" - - [[providers.layers]] - name = "other_areas_filter" - geometry_fieldname = "geometry" - geometry_type = "multipolygon" - id_fieldname = "id" - sql = "SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, id, osm_id, name, class, type, tags->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_other_areas WHERE area > 1000000 AND geometry && !BBOX!" - - # 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->'start_date' as start_date, tags->'end_date' as end_date, isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate FROM osm_buildings WHERE geometry && !BBOX!" - - # 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, r.tags->'start_date' as start_date, r.tags->'end_date' as end_date, isodatetodecimaldate(pad_date(r.tags->'start_date', 'start')) AS start_decdate, isodatetodecimaldate(pad_date(r.tags->'end_date', 'end')) AS end_decdate FROM osm_relations r, osm_relation_members m WHERE r.osm_id=m.osm_id and r.type='associatedStreet' and geometry && !BBOX!" - -[[maps]] -name = "osm" -attribution = "OpenStreetMap" # map attribution -center = [-74.275329586789, -12.153492567373, 8.0] # optional center value. part of the TileJSON spec - - # Zoom levels 0-2,Tolerance=500 => ~1000 meters - # Zoom levels 3-5,Tolerance=200=> ~500 meters - # Zoom levels 6-7,Tolerance=100=> ~200 meters - # Zoom levels 8-9,Tolerance=50=> ~100 meters - # Zoom levels 10-12,Tolerance=20=> ~50 meters - # Zoom levels 13-15,Tolerance=5=> ~20 meters - # Zoom levels 16-20,Tolerance=1=> ~5 meters - - # Land - [[maps.layers]] - name = "land" - provider_layer = "osm.land_0-2" - min_zoom = 0 - max_zoom = 2 - - [[maps.layers]] - name = "land" - provider_layer = "osm.land_3-5" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "land" - provider_layer = "osm.land_6-7" - min_zoom = 6 - max_zoom = 7 - - [[maps.layers]] - name = "land" - provider_layer = "osm.land_8-9" - min_zoom = 8 - max_zoom = 9 - - [[maps.layers]] - name = "land" - provider_layer = "osm.land_10-12" - min_zoom = 10 - max_zoom = 12 - - [[maps.layers]] - name = "land" - provider_layer = "osm.land_13-15" - min_zoom = 13 - max_zoom = 15 - - [[maps.layers]] - name = "land" - provider_layer = "osm.land_16-20" - min_zoom = 16 - max_zoom = 20 - - # Admin boundaries - [[maps.layers]] - name = "land_ohm" - provider_layer = "osm.admin_boundaries_0-2" - min_zoom = 0 - max_zoom = 2 - - [[maps.layers]] - name = "land_ohm" - provider_layer = "osm.admin_boundaries_3-5" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "land_ohm" - provider_layer = "osm.admin_boundaries_6-7" - min_zoom = 6 - max_zoom = 7 - - [[maps.layers]] - name = "land_ohm" - provider_layer = "osm.admin_boundaries_8-9" - min_zoom = 8 - max_zoom = 9 - - [[maps.layers]] - name = "land_ohm" - provider_layer = "osm.admin_boundaries_10-12" - min_zoom = 10 - max_zoom = 12 - - [[maps.layers]] - name = "land_ohm" - provider_layer = "osm.admin_boundaries_13-15" - min_zoom = 13 - max_zoom = 15 - - [[maps.layers]] - name = "land_ohm" - provider_layer = "osm.admin_boundaries_16-20" - min_zoom = 16 - max_zoom = 20 - - # [[maps.layers]] - # name = "admin_lines" - # provider_layer = "osm.admin_boundaries_8-12" - # min_zoom = 8 - # max_zoom = 12 - - # [[maps.layers]] - # name = "admin_lines" - # provider_layer = "osm.admin_boundaries_13-20" - # min_zoom = 13 - # max_zoom = 20 - - # [[maps.layers]] - # name = "state_label_points" - # provider_layer = "ne.ne_10m_admin_1_label_points" - # min_zoom = 3 - # max_zoom = 20 - - # Land Use - [[maps.layers]] - name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen0" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen0_6" - min_zoom = 6 - max_zoom = 9 - - [[maps.layers]] - name = "landuse_areas" - provider_layer = "osm.landuse_areas_gen1" - min_zoom = 10 - max_zoom = 12 - - [[maps.layers]] - name = "landuse_areas" - provider_layer = "osm.landuse_areas" - min_zoom = 13 - max_zoom = 20 - - [[maps.layers]] - name = "landuse_lines" - provider_layer = "osm.landuse_lines" - min_zoom = 14 - max_zoom = 20 - - [[maps.layers]] - name = "landuse_points" - provider_layer = "osm.landuse_points" - min_zoom = 6 - max_zoom = 20 - - # Water Areas - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_gen0" - min_zoom = 3 - max_zoom = 5 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_gen0_6" - min_zoom = 6 - max_zoom = 9 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas_gen1" - min_zoom = 10 - max_zoom = 11 - - [[maps.layers]] - name = "water_areas" - provider_layer = "osm.water_areas" - min_zoom = 12 - max_zoom = 20 - - # Water Lines - [[maps.layers]] - name = "water_lines" - provider_layer = "osm.water_lines_gen0" - min_zoom = 8 - max_zoom = 9 - - [[maps.layers]] - name = "water_lines" - provider_layer = "osm.water_lines_gen1" - 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) - [[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 - - # 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 - [[maps.layers]] - name = "other_areas" - provider_layer = "osm.other_areas_filter" - min_zoom = 6 - max_zoom = 8 - - [[maps.layers]] - name = "other_areas" - provider_layer = "osm.other_areas" - min_zoom = 9 - 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 - \ No newline at end of file diff --git a/images/tiler-server/config/providers/admin_boundaries.toml b/images/tiler-server/config/providers/admin_boundaries.toml new file mode 100644 index 00000000..4d14fe31 --- /dev/null +++ b/images/tiler-server/config/providers/admin_boundaries.toml @@ -0,0 +1,174 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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/amenity_areas.toml b/images/tiler-server/config/providers/amenity_areas.toml new file mode 100644 index 00000000..eadcb73e --- /dev/null +++ b/images/tiler-server/config/providers/amenity_areas.toml @@ -0,0 +1,21 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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..3a42e866 --- /dev/null +++ b/images/tiler-server/config/providers/amenity_points.toml @@ -0,0 +1,22 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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..4c713623 --- /dev/null +++ b/images/tiler-server/config/providers/buildings.toml @@ -0,0 +1,23 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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/landuse_areas.toml b/images/tiler-server/config/providers/landuse_areas.toml new file mode 100644 index 00000000..6a5869f6 --- /dev/null +++ b/images/tiler-server/config/providers/landuse_areas.toml @@ -0,0 +1,100 @@ +# 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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_landuse_areas +WHERE + geometry && !BBOX! +""" 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..3915112e --- /dev/null +++ b/images/tiler-server/config/providers/landuse_lines.toml @@ -0,0 +1,23 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_landuse_lines +WHERE + geometry && !BBOX! +""" 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..75aba31e --- /dev/null +++ b/images/tiler-server/config/providers/landuse_points.toml @@ -0,0 +1,23 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_landuse_points +WHERE + geometry && !BBOX! +""" 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..271a62c6 --- /dev/null +++ b/images/tiler-server/config/providers/other_areas.toml @@ -0,0 +1,48 @@ +# Layer configuration for other areas with a filter +[[providers.layers]] +name = "other_areas_filter" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_other_areas +WHERE + area > 1000000 + AND geometry && !BBOX! +""" + +# Layer configuration for other areas +[[providers.layers]] +name = "other_areas" +geometry_fieldname = "geometry" +geometry_type = "multipolygon" +id_fieldname = "id" +sql = """ +SELECT + ST_AsMVTGeom(geometry, !BBOX!) AS geometry, + id, + osm_id, + name, + class, + type, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_other_areas +WHERE + geometry && !BBOX! +""" 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..779335ee --- /dev/null +++ b/images/tiler-server/config/providers/other_lines.toml @@ -0,0 +1,23 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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..d0c60272 --- /dev/null +++ b/images/tiler-server/config/providers/other_points.toml @@ -0,0 +1,25 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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..93611f31 --- /dev/null +++ b/images/tiler-server/config/providers/place_areas.toml @@ -0,0 +1,23 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate, + tags->'capital' AS capital +FROM + osm_place_areas +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..adcab89d --- /dev/null +++ b/images/tiler-server/config/providers/place_points.toml @@ -0,0 +1,23 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate, + tags->'capital' AS capital +FROM + osm_place_points +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..b4dca932 --- /dev/null +++ b/images/tiler-server/config/providers/transport_associated_streets.toml @@ -0,0 +1,28 @@ +# 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, + r.tags->'start_date' AS start_date, + r.tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(r.tags->'start_date', 'start')) AS start_decdate, + isodatetodecimaldate(pad_date(r.tags->'end_date', 'end')) AS end_decdate +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..fa370e3a --- /dev/null +++ b/images/tiler-server/config/providers/transport_lines.toml @@ -0,0 +1,206 @@ +# 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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_transport_points +WHERE + geometry && !BBOX! +""" + +# Layer configuration for transport areas +[[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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_transport_areas +WHERE + geometry && !BBOX! +""" + +# 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, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +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, + tags->'electrified' AS electrified, + tags->'highspeed' AS highspeed, + tags->'usage' AS usage, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_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->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_transport_lines +WHERE + geometry && !BBOX! +""" diff --git a/images/tiler-server/config/providers/transport_lines_relation.toml b/images/tiler-server/config/providers/transport_lines_relation.toml new file mode 100644 index 00000000..fd3c40cf --- /dev/null +++ b/images/tiler-server/config/providers/transport_lines_relation.toml @@ -0,0 +1,60 @@ +[[providers.layers]] +name = "transport_lines_5_10_relation" +geometry_fieldname = "geometry" +geometry_type = "LineString" +id_fieldname = "id" +sql = """ +SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, + r.id, + r.name, + r.tags->'ref' AS ref, + r.tags->'class' AS class, + r.tags->'highway' AS type, + r.tags->'route' AS route, + r.tags->'tunnel' AS tunnel, + r.tags->'bridge' AS bridge, + r.tags->'usage' AS usage, + r.tags->'electrified' AS electrified, + r.tags->'highspeed' AS highspeed, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(r.tags->'start_date', 'start')) AS start_decdate, + isodatetodecimaldate(pad_date(r.tags->'end_date', 'end')) AS end_decdate +FROM osm_relations r, osm_relation_members m +WHERE r.osm_id=m.osm_id +AND r.type IN ('multilinestring', 'route') +AND geometry && !BBOX! +""" + +[[providers.layers]] +name = "transport_lines_11_20_relation" +geometry_fieldname = "geometry" +geometry_type = "LineString" +id_fieldname = "id" +sql = """ +SELECT ST_AsMVTGeom(geometry,!BBOX!) AS geometry, + r.id, + r.name, + r.tags->'ref' AS ref, + r.tags->'class' AS class, + r.tags->'highway' AS type, + r.tags->'route' AS route, + r.tags->'tunnel' AS tunnel, + r.tags->'bridge' AS bridge, + r.tags->'access' AS access, + r.tags->'service' AS service, + r.tags->'ford' AS ford, + r.tags->'construction' AS construction, + r.tags->'usage' AS usage, + r.tags->'electrified' AS electrified, + r.tags->'highspeed' AS highspeed, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + m.name AS mname, + isodatetodecimaldate(pad_date(r.tags->'start_date', 'start')) AS start_decdate, + isodatetodecimaldate(pad_date(r.tags->'end_date', 'end')) AS end_decdate +FROM osm_relations r, osm_relation_members m +WHERE r.osm_id=m.osm_id +AND r.type IN ('multilinestring', 'route') +AND 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..3cfef479 --- /dev/null +++ b/images/tiler-server/config/providers/water_areas.toml @@ -0,0 +1,152 @@ +# Simplification for geometries +# Zoom levels 3-5,Tolerance=1000 +# Zoom levels 6-7,Tolerance=500 +# Zoom levels 8-9,Tolerance=200 +# Zoom levels 10-12,Tolerance=50 +# Zoom levels 13-15,Tolerance=5 +# Zoom levels 16-20,Tolerance=0 +# Water bodies > 50,000,000 sqm +[[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->'start_date' as start_date, + tags->'end_date' as end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_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->'start_date' as start_date, + tags->'end_date' as end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_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->'start_date' as start_date, + tags->'end_date' as end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_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->'start_date' as start_date, + tags->'end_date' as end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_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->'start_date' as start_date, + tags->'end_date' as end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_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->'start_date' as start_date, + tags->'end_date' as end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_areas +WHERE + type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') + AND 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..13003bf4 --- /dev/null +++ b/images/tiler-server/config/providers/water_lines.toml @@ -0,0 +1,143 @@ +# 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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_lines_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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_lines_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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_lines_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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_lines_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, + tags->'start_date' AS start_date, + tags->'end_date' AS end_date, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_lines_gen1 +WHERE + type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') + AND geometry && !BBOX! +""" + +[[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, + isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate, + isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate +FROM + osm_water_lines +WHERE + type IN ('river', 'canal', 'stream', 'ditch', 'drain', 'dam', 'cliff') + AND geometry && !BBOX! +""" \ No newline at end of file diff --git a/ohm/requirements.yaml b/ohm/requirements.yaml index f2570b24..ac181a79 100644 --- a/ohm/requirements.yaml +++ b/ohm/requirements.yaml @@ -1,4 +1,4 @@ dependencies: - name: osm-seed - version: '0.1.0-n777.he5c57fc' + version: '0.1.0-n790.hfb2d63a' repository: https://devseed.com/osm-seed-chart/ diff --git a/values.production.template.yaml b/values.production.template.yaml index 980108ea..326f890e 100644 --- a/values.production.template.yaml +++ b/values.production.template.yaml @@ -30,7 +30,7 @@ osm-seed: # an `AWS_SSL_ARN` that is a wildcart certificate, that will be configured # as the SSL certificate for your services. Else, you will need to configure # SSL separately. - serviceType: LoadBalancer + serviceType: ClusterIP # Domain that is pointed to the clusterIP # You will need to create an A record like *.osmseed.example.com pointed to the ClusterIP @@ -47,7 +47,7 @@ osm-seed: # Admin Email address used when generating Lets Encrypt certificates. # You will be notified of expirations, etc. on this email address. - adminEmail: ruben@developmentseed.org + adminEmail: no-reply@openhistoricalmap.org # ==================================================================================================== # Variables for osm-seed database @@ -91,6 +91,7 @@ osm-seed: staticIp: c serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: www.openhistoricalmap.org nodeSelector: enabled: true label_key: nodegroup_type @@ -392,6 +393,7 @@ osm-seed: commad: './start.sh' serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: vtiles.openhistoricalmap.org env: TILER_SERVER_PORT: 9090 TILER_CACHE_TYPE: s3 @@ -489,6 +491,7 @@ osm-seed: staticIp: c serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: tm-api.openhistoricalmap.org env: POSTGRES_HOST: {{PRODUCTION_TM_API_DB_HOST}} POSTGRES_DB: {{PRODUCTION_TM_API_DB}} @@ -536,6 +539,7 @@ osm-seed: enabled: true serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: nominatim-api.openhistoricalmap.org replicaCount: 1 env: PBF_URL: http://s3.amazonaws.com/planet.openhistoricalmap.org/planet/planet-230727_1030.osm.pbf @@ -591,6 +595,7 @@ osm-seed: label_value: web serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: overpass-api.openhistoricalmap.org env: OVERPASS_META: 'attic' OVERPASS_MODE: 'init' @@ -619,6 +624,7 @@ osm-seed: enabled: true serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: taginfo.openhistoricalmap.org env: URL_PLANET_FILE_STATE: https://planet.openhistoricalmap.org.s3.amazonaws.com/planet/state.txt URL_HISTORY_PLANET_FILE_STATE: https://planet.openhistoricalmap.org.s3.amazonaws.com/planet/full-history/state.txt @@ -711,6 +717,7 @@ osm-seed: image: name: "ghcr.io/openhistoricalmap/osmcha-django" tag: "a1bcea85dc1f7c27566c20bafe7fff7aaa1e38a4" + ingressDomain: osmcha.openhistoricalmap.org env: DJANGO_SETTINGS_MODULE: "config.settings.production" OSMCHA_FRONTEND_VERSION: "v0.86.0-production" diff --git a/values.staging.template.yaml b/values.staging.template.yaml index b3edccbe..3d19806b 100644 --- a/values.staging.template.yaml +++ b/values.staging.template.yaml @@ -37,7 +37,7 @@ osm-seed: # an `AWS_SSL_ARN` that is a wildcart certificate, that will be configured # as the SSL certificate for your services. Else, you will need to configure # SSL separately. - serviceType: LoadBalancer + serviceType: ClusterIP # Domain that is pointed to the clusterIP # You will need to create an A record like *.osmseed.example.com pointed to the ClusterIP @@ -54,7 +54,7 @@ osm-seed: # Admin Email address used when generating Lets Encrypt certificates. # You will be notified of expirations, etc. on this email address. - adminEmail: ruben@developmentseed.org + adminEmail: no-reply@staging.openhistoricalmap.org # ==================================================================================================== # ==================================================================================================== # ==================================Pods Configurations=============================================== @@ -105,6 +105,7 @@ osm-seed: staticIp: c serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: www.staging.openhistoricalmap.org env: MAILER_ADDRESS: {{MAILER_ADDRESS}} MAILER_DOMAIN: staging.openhistoricalmap.org @@ -114,18 +115,18 @@ osm-seed: OAUTH_CLIENT_ID: {{STAGING_OAUTH_CLIENT_ID}} OAUTH_KEY: {{STAGING_OAUTH_KEY}} MAILER_FROM: no-reply@staging.openhistoricalmap.org - NOMINATIM_URL: nominatim-api-staging.openhistoricalmap.org - OVERPASS_URL: overpass-api-staging.openhistoricalmap.org + NOMINATIM_URL: nominatim-api.staging.openhistoricalmap.org + OVERPASS_URL: overpass-api.staging.openhistoricalmap.org NEW_RELIC_LICENSE_KEY: {{STAGING_NEW_RELIC_LICENSE_KEY}} NEW_RELIC_APP_NAME: {{STAGING_NEW_RELIC_APP_NAME}} ORGANIZATION_NAME: OpenHistoricalMap resources: - enabled: true + enabled: false requests: memory: "2Gi" cpu: "1" limits: - memory: "4Gi" + memory: "2Gi" cpu: "2" autoscaling: enabled: false @@ -284,7 +285,7 @@ osm-seed: dbBackupRestore: cronjobs: - name: web-db - enabled: true + enabled: false schedule: '0 0 * * *' env: # backup/restore @@ -367,8 +368,8 @@ osm-seed: mountPath: /var/lib/postgresql/data subPath: postgresql-d # In case cloudProvider: aws - AWS_ElasticBlockStore_volumeID : vol-04b9db9f3982e44a4 - AWS_ElasticBlockStore_size: 100Gi + AWS_ElasticBlockStore_volumeID : vol-0de0a9672fa9fa7e4 + AWS_ElasticBlockStore_size: 40Gi resources: enabled: false requests: @@ -393,9 +394,9 @@ osm-seed: label_value: web env: TILER_IMPORT_FROM: osm - TILER_IMPORT_PBF_URL: https://s3.amazonaws.com/planet.openhistoricalmap.org/planet/planet-240216_0000.osm.pbf + TILER_IMPORT_PBF_URL: https://s3.amazonaws.com/planet.openhistoricalmap.org/planet/planet-240404_0003.osm.pbf REPLICATION_URL: http://s3.amazonaws.com/planet.openhistoricalmap.org/replication/minute/ - SEQUENCE_NUMBER: "1301000" + SEQUENCE_NUMBER: "1351000" OVERWRITE_STATE: false UPLOAD_EXPIRED_FILES: true persistenceDisk: @@ -403,8 +404,8 @@ osm-seed: accessMode: ReadWriteOnce mountPath: /mnt/data # In case cloudProvider: aws - AWS_ElasticBlockStore_volumeID: vol-0eebe4dd0e6b04f44 - AWS_ElasticBlockStore_size: 100Gi + AWS_ElasticBlockStore_volumeID: vol-0af76080fb2dfc3c0 + AWS_ElasticBlockStore_size: 40Gi resources: enabled: false requests: @@ -427,6 +428,7 @@ osm-seed: commad: './start.sh' serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: vtiles.staging.openhistoricalmap.org env: TILER_SERVER_PORT: 9090 TILER_CACHE_TYPE: s3 @@ -446,7 +448,7 @@ osm-seed: AWS_ElasticBlockStore_volumeID: vol-0e8b605fe3b16bf08 AWS_ElasticBlockStore_size: 100Gi resources: - enabled: true + enabled: false requests: memory: "2Gi" cpu: "1" @@ -470,7 +472,7 @@ osm-seed: replicaCount: 1 command: './cache_cleaner.sh' resources: - enabled: true + enabled: false requests: memory: "2Gi" cpu: "1" @@ -527,6 +529,7 @@ osm-seed: staticIp: c serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: tm-api.staging.openhistoricalmap.org env: POSTGRES_HOST: {{STAGING_TM_API_DB_HOST}} POSTGRES_DB: {{STAGING_TM_API_DB}} @@ -539,7 +542,7 @@ osm-seed: TM_ORG_PRIVACY_POLICY_URL: 'staging.openhistoricalmap.org/copyright' TM_ORG_GITHUB: 'github.com/openhistoricalmap' OSM_SERVER_URL: 'https://staging.openhistoricalmap.org' - OSM_NOMINATIM_SERVER_URL: 'https://nominatim-api-staging.openhistoricalmap.org' + OSM_NOMINATIM_SERVER_URL: 'https://nominatim-api.staging.openhistoricalmap.org' OSM_REGISTER_URL: 'https://staging.openhistoricalmap.org/user/new' ID_EDITOR_URL: 'https://staging.openhistoricalmap.org/edit?editor=id' POTLATCH2_EDITOR_URL: 'https://staging.openhistoricalmap.org/edit?editor=potlatch2' @@ -552,8 +555,8 @@ osm-seed: TM_SMTP_USER: {{MAILER_USERNAME}} TM_SMTP_PASSWORD: {{MAILER_PASSWORD}} TM_DEFAULT_LOCALE: 'en' - TM_APP_API_URL: 'https://staging-tm-api.openhistoricalmap.org' - TM_APP_BASE_URL: 'https://tasks-staging.openhistoricalmap.org' + TM_APP_API_URL: 'https://tm-api.staging.openhistoricalmap.org' + TM_APP_BASE_URL: 'https://tasks.staging.openhistoricalmap.org' TM_IMPORT_MAX_FILESIZE: 3000000 TM_MAX_AOI_AREA: 15000 resources: @@ -569,12 +572,13 @@ osm-seed: # Variables for nominatim api # ==================================================================================================== nominatimApi: - enabled: false + enabled: true serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: nominatim-api.staging.openhistoricalmap.org replicaCount: 1 env: - PBF_URL: https://s3.amazonaws.com/planet.openhistoricalmap.org/planet/planet-240108_0000.osm.pbf + PBF_URL: https://s3.amazonaws.com/planet.openhistoricalmap.org/planet/planet-240405_0003.osm.pbf REPLICATION_URL: http://planet.openhistoricalmap.org.s3.amazonaws.com/replication/minute REPLICATION_UPDATE_INTERVAL: 60 REPLICATION_RECHECK_INTERVAL: 30 @@ -588,8 +592,7 @@ osm-seed: PGDATA: /var/lib/postgresql/14/main NOMINATIM_ADDRESS_LEVEL_CONFIG_URL: https://raw.githubusercontent.com/OpenHistoricalMap/nominatim-ui/master/address-levels.json UPDATE_MODE: continuous - OSMSEED_WEB_API_DOMAIN: staging.openhistoricalmap.org - OSMSEED_OVERPASS_API_DOMAIN: overpass-api-staging.openhistoricalmap.org + OSMSEED_WEB_API_DOMAIN: www.openhistoricalmap.org resources: enabled: false requests: @@ -607,14 +610,15 @@ osm-seed: localVolumeHostPath: /mnt/nominatim-db-data localVolumeSize: 10Gi # AWS - AWS_ElasticBlockStore_volumeID: vol-0027487e80f9c6863 - AWS_ElasticBlockStore_size: 100Gi + AWS_ElasticBlockStore_volumeID: vol-0a9f1da7c7f6d587e + AWS_ElasticBlockStore_size: 30Gi # GCP GCP_gcePersistentDisk_pdName: osmseed-disk-nominatim_db-v1 GCP_gcePersistentDisk_size: 50Gi nodeSelector: - enabled: false - + enabled: true + label_key: nodegroup_type + label_value: web_xlarge # ==================================================================================================== # Variables for overpass-api # ==================================================================================================== @@ -622,6 +626,7 @@ osm-seed: enabled: true serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: overpass-api.staging.openhistoricalmap.org env: OVERPASS_META: 'attic' OVERPASS_MODE: 'init' @@ -644,20 +649,17 @@ osm-seed: memory: '8Gi' cpu: '2' nodeSelector: - enabled: false + enabled: true label_key: nodegroup_type - label_value: web_v2 + label_value: web # ==================================================================================================== # Variables for taginfo # ==================================================================================================== taginfo: - enabled: false - nodeSelector: - enabled: false - label_key: nodegroup_type - label_value: web + enabled: true serviceAnnotations: service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300" + ingressDomain: taginfo.staging.openhistoricalmap.org env: URL_PLANET_FILE_STATE: https://s3.amazonaws.com/planet.openhistoricalmap.org/planet/state.txt URL_HISTORY_PLANET_FILE_STATE: https://s3.amazonaws.com/planet.openhistoricalmap.org/planet/full-history/state.txt @@ -676,6 +678,10 @@ osm-seed: limits: memory: '2Gi' cpu: '2' + nodeSelector: + enabled: true + label_key: nodegroup_type + label_value: web_xlarge # ==================================================================================================== # Variables for osm-simple-metrics # ==================================================================================================== @@ -746,6 +752,7 @@ osm-seed: image: name: "ghcr.io/openhistoricalmap/osmcha-django" tag: "a1bcea85dc1f7c27566c20bafe7fff7aaa1e38a4" + ingressDomain: osmcha.staging.openhistoricalmap.org env: DJANGO_SETTINGS_MODULE: "config.settings.production" OSMCHA_FRONTEND_VERSION: "v0.86.0-production" @@ -754,10 +761,10 @@ osm-seed: OAUTH_OSM_SECRET: {{STAGING_OSMCHA_API_CONSUMER_SECRET}} DJANGO_SECURE_SSL_REDIRECT: "False" OSM_SERVER_URL: https://www.openhistoricalmap.org - OAUTH_REDIRECT_URI: https://osmcha-staging.openhistoricalmap.org/oauth-landing.html + OAUTH_REDIRECT_URI: https://osmcha.staging.openhistoricalmap.org/oauth-landing.html OSM_PLANET_BASE_URL: https://s3.amazonaws.com/planet.openhistoricalmap.org/replication/changesets/ ## frontend - OSMCHA_URL: https://osmcha-staging.openhistoricalmap.org + OSMCHA_URL: https://osmcha.staging.openhistoricalmap.org OSMCHA_API_URL: www.openhistoricalmap.org REACT_APP_OSM_URL: https://www.openhistoricalmap.org REACT_APP_OSM_API: https://www.openhistoricalmap.org/api/0.6 @@ -797,15 +804,15 @@ osm-seed: memory: "24Gi" cpu: "10" persistenceDisk: - enabled: false + enabled: true accessMode: ReadWriteOnce mountPath: /var/lib/postgresql/data # Minikube localVolumeHostPath: /mnt/db-data/osmcha-data localVolumeSize: 10Gi # AWS - AWS_ElasticBlockStore_volumeID: vol-1234bcd - AWS_ElasticBlockStore_size: 50Gi + AWS_ElasticBlockStore_volumeID: vol-06f981afe8def5915 + AWS_ElasticBlockStore_size: 10Gi # GCP GCP_gcePersistentDisk_pdName: osmseed-osmcha-disk--v1 GCP_gcePersistentDisk_size: 50Gi