From 7cda119879cf48ba72ba34522fa9cdf9ef6d9b49 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 21 Sep 2024 04:00:05 +0200 Subject: Add `webmap-publish` script to export layers to Mapbox Vector Tiles. --- config.yml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'config.yml') diff --git a/config.yml b/config.yml index b23496b..ec5ec50 100644 --- a/config.yml +++ b/config.yml @@ -22,6 +22,29 @@ extent: - 1159296 - 7975712 +# Export options for MVT publishing, see +# https://gdal.org/en/latest/drivers/vector/mvt.html +vector-tiles: + min-zoom: 0 # res. 1024m/px + max-zoom: 9 # res. 2m/px + max-size: 4194304 + max-features: 262144 + tiling-scheme: + # Custom tiling scheme, cf. https://gdal.org/en/latest/drivers/vector/mvt.html#dataset-creation-options + # Compared to Lantmäteriet's scheme we start 2 levels deeper (resolution 1024m per pixel) + # and with 1024×1024 tiles + - 'EPSG:3006' + # upper-left corner of the upper-left tile (0,0) in the CRS + - 110720 + - 7975712 + # dimension of the tile at zoom level 0 (tile size * resolution) + - 1048576 + # simplification factor, cf. + # https://gis.stackexchange.com/questions/401867/gdal-mvt-writer-simplification-parameter + simplification: 4. + simplification-max-zoom: 2. + + # Take User-Agent value from Tor Browser 13.0.15 (based on Mozilla Firefox 115.11.0esr) User-Agent: 'Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/115.0' @@ -68,6 +91,11 @@ dataset: USER: webmap_import DBNAME: webmap + # Optional driver-specific dataset open options which overrides the + # above 'open-options' settings when publishing. + open-options-publish: + USER: webmap_guest + # Optional dictionary of default layer creation options, cf. # https://gdal.org/drivers/vector/pg.html#layer-creation-options or # https://gdal.org/drivers/vector/gpkg.html#layer-creation-options @@ -528,6 +556,7 @@ layers: - ArendeStatus - AvvHa - AvverkningsanmalanKlass + publish: clearcut_appl 'sks:UtfordAvverk': # https://geodpags.skogsstyrelsen.se/geodataport/feeds/UtfordAvverk.xml @@ -634,6 +663,7 @@ layers: Beteckn: - replace: 'Visas ej' with: null + publish: clearcut_comp 'st:betesomraden': source: @@ -826,6 +856,35 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: + station_completed: + minzoom: 4 + where: | + "Raderat" IS FALSE AND "Statuskod" = 4 + station_processed: + minzoom: 4 + where: | + "Raderat" IS FALSE AND "Statuskod" = 1 + station_approved: + minzoom: 4 + where: | + "Raderat" IS FALSE AND "Statuskod" = 3 + station_revoked: + minzoom: 4 + where: | + "Raderat" IS FALSE AND ("Statuskod" = 6 OR "Statuskod" = 9) + station_rejected: + minzoom: 4 + where: | + "Raderat" IS FALSE AND "Statuskod" = 7 + station_dismounted: + minzoom: 4 + where: | + "Raderat" IS FALSE AND "Statuskod" = 5 + station_appealed: + minzoom: 4 + where: | + "Raderat" IS FALSE AND "Statuskod" = 8 'vbk:projekteringsomraden': description: Vindbrukskollen landbaserade projekteringsområden (Länsstyrelsen) @@ -977,6 +1036,13 @@ layers: with: '1' - replace: 'No' with: '0' + publish: + area_current: + where: | + "Raderat" IS FALSE AND "EjAktuell" IS FALSE + area_notcurrent: + where: | + "Raderat" IS FALSE AND "EjAktuell" IS NOT FALSE 'vbk:havsbaserad_vindkraft': description: Vindbrukskollen havsbaserad vindkraft (Länsstyrelsen) @@ -1193,6 +1259,10 @@ layers: with: '1' - replace: 'No' with: '0' + publish: + area_offshore: + where: | + "Raderat" IS FALSE # The list of layers available on the WMS server can be found at # https://maps3.sgu.se/geoserver/wms?SERVICE=WMS&VERSION=1.11&REQUEST=GetCapabilities @@ -1249,6 +1319,7 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: mrr 'mrr:bearbetningskoncessioner_approved': description: Bearbetningskoncessioner, beviljade (SGU) @@ -1311,6 +1382,7 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: mrr 'mrr:markanvisningar': description: Markanvisning till koncession (SGU) @@ -1357,6 +1429,7 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: mrr 'mrr:mineral_applied': description: Undersökningstillstånd, metallar och mineral, ansökta (SGU) @@ -1411,6 +1484,7 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: mrr 'mrr:mineral_approved': description: Undersökningstillstånd, metallar och mineral, beviljade (SGU) @@ -1479,6 +1553,7 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: mrr # 'mrr:mineral_expired': # source: @@ -1560,6 +1635,7 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: mrr 'mrr:olja_gas_diamant_approved': description: Undersökningstillstånd, olja, gas och diamant, beviljade (SGU) @@ -1628,6 +1704,7 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: mrr 'mrr:torvkoncessioner': description: Torvkoncessioner (SGU) @@ -1692,3 +1769,4 @@ layers: - replace: '([0-9]{4})([0-9]{2})([0-9]{2})' with: '{0}-{1}-{2}' type: regex + publish: mrr -- cgit v1.2.3