From a2a6bee6e130883c842a78b8058e031848e487d6 Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Thu, 18 Jul 2024 11:15:50 +1200 Subject: [PATCH 1/3] Testing health screenshot --- .github/workflows/build.yml | 2 +- config/style/aerial.json | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 config/style/aerial.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68b16146..d79ffc1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -229,7 +229,7 @@ jobs: name: Take Screenshots runs-on: ubuntu-latest env: - SCREENSHOT_CONTAINER: ghcr.io/linz/basemaps-screenshot/cli:v1 + SCREENSHOT_CONTAINER: ghcr.io/linz/basemaps-screenshot/cli:v1.7.0-2-g99b800e DOCKER_AWS_ENV: -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_REGION -e AWS_DEFAULT_REGION CONFIG_PATH: ${{ needs.build.outputs.config_path }} BASEMAPS_HOST: http://localhost:5000 diff --git a/config/style/aerial.json b/config/style/aerial.json new file mode 100644 index 00000000..bc480c04 --- /dev/null +++ b/config/style/aerial.json @@ -0,0 +1,31 @@ +{ + "id": "st_aerial", + "layers": [ + { + "id": "Aerial-Imagery", + "source": "LINZ-Basemaps", + "type": "raster" + } + ], + "name": "aerial", + "sources": { + "LINZ-Basemaps": { + "tileSize": 256, + "tiles": ["/v1/tiles/aerial/{tileMatrix}/{z}/{x}/{y}.webp"], + "type": "raster" + }, + "LINZ-Terrain": { + "maxzoom": 18, + "tileSize": 256, + "tiles": ["/v1/tiles/elevation/{tileMatrix}/{z}/{x}/{y}.png?pipeline=terrain-rgb"], + "type": "raster-dem" + }, + "__hillshade-LINZ-Terrain": { + "maxzoom": 18, + "tileSize": 256, + "tiles": ["/v1/tiles/elevation/{tileMatrix}/{z}/{x}/{y}.png?pipeline=terrain-rgb"], + "type": "raster-dem" + } + }, + "version": 8 +} From ca87925aa1f8b600f149ddb5f9095afef5cdd4ba Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Thu, 18 Jul 2024 12:00:40 +1200 Subject: [PATCH 2/3] Add health json --- .github/workflows/build.yml | 2 +- ...rial.json => health_aerial_hillshade.json} | 14 ++++----- config/style/health_aerial_terrain.json | 29 +++++++++++++++++++ test.json | 14 +++++++++ 4 files changed, 51 insertions(+), 8 deletions(-) rename config/style/{aerial.json => health_aerial_hillshade.json} (70%) create mode 100644 config/style/health_aerial_terrain.json create mode 100644 test.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d79ffc1b..dfba5c70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -251,7 +251,7 @@ jobs: # Wait for the server to start timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:5000/v1/version)" != "200" ]]; do sleep 0.5; done' || false - docker run --rm --network="host" -v $PWD:$PWD ${DOCKER_AWS_ENV} ${SCREENSHOT_CONTAINER} --url http://localhost:5000 --output $PWD/.artifacts/visual-snapshots + docker run --rm --network="host" -v $PWD:$PWD ${DOCKER_AWS_ENV} ${SCREENSHOT_CONTAINER} --test $PWD/test.json --url http://localhost:5000 --output $PWD/.artifacts/visual-snapshots - name: Save snapshots uses: getsentry/action-visual-snapshot@v2 diff --git a/config/style/aerial.json b/config/style/health_aerial_hillshade.json similarity index 70% rename from config/style/aerial.json rename to config/style/health_aerial_hillshade.json index bc480c04..45a01ce2 100644 --- a/config/style/aerial.json +++ b/config/style/health_aerial_hillshade.json @@ -1,10 +1,16 @@ { - "id": "st_aerial", + "id": "st_health_aerial_hillshade", "layers": [ { "id": "Aerial-Imagery", "source": "LINZ-Basemaps", "type": "raster" + }, + { + "id": "LINZ-HillShade", + "paint": { "hillshade-shadow-color": "#040404" }, + "source": "LINZ-Terrain", + "type": "hillshade" } ], "name": "aerial", @@ -19,12 +25,6 @@ "tileSize": 256, "tiles": ["/v1/tiles/elevation/{tileMatrix}/{z}/{x}/{y}.png?pipeline=terrain-rgb"], "type": "raster-dem" - }, - "__hillshade-LINZ-Terrain": { - "maxzoom": 18, - "tileSize": 256, - "tiles": ["/v1/tiles/elevation/{tileMatrix}/{z}/{x}/{y}.png?pipeline=terrain-rgb"], - "type": "raster-dem" } }, "version": 8 diff --git a/config/style/health_aerial_terrain.json b/config/style/health_aerial_terrain.json new file mode 100644 index 00000000..d6e11ed2 --- /dev/null +++ b/config/style/health_aerial_terrain.json @@ -0,0 +1,29 @@ +{ + "id": "st_health_aerial_terrain", + "layers": [ + { + "id": "Aerial-Imagery", + "source": "LINZ-Basemaps", + "type": "raster" + } + ], + "name": "aerial", + "sources": { + "LINZ-Basemaps": { + "tileSize": 256, + "tiles": ["/v1/tiles/aerial/{tileMatrix}/{z}/{x}/{y}.webp"], + "type": "raster" + }, + "LINZ-Terrain": { + "maxzoom": 18, + "tileSize": 256, + "tiles": ["/v1/tiles/elevation/{tileMatrix}/{z}/{x}/{y}.png?pipeline=terrain-rgb"], + "type": "raster-dem" + } + }, + "terrain": { + "exaggeration": 1.2, + "source": "LINZ-Terrain" + }, + "version": 8 +} diff --git a/test.json b/test.json new file mode 100644 index 00000000..93f09092 --- /dev/null +++ b/test.json @@ -0,0 +1,14 @@ +[ + { + "name": "health-aerial-terrain-3857-z5", + "tileMatrix": "WebMercatorQuad", + "location": { "lat": -41.8899962, "lng": 174.0492437, "z": 5 }, + "tileSet": "health_aerial_terrain" + }, + { + "name": "health-aerial-hillshade-3857-z5", + "tileMatrix": "WebMercatorQuad", + "location": { "lat": -41.8899962, "lng": 174.0492437, "z": 5 }, + "tileSet": "health_aerial_hillshade" + } +] From 6923580f5fb7991bb0914a92df260e390e482171 Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Thu, 18 Jul 2024 12:29:29 +1200 Subject: [PATCH 3/3] Add style to the test --- test.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test.json b/test.json index 93f09092..99c33ff2 100644 --- a/test.json +++ b/test.json @@ -2,13 +2,15 @@ { "name": "health-aerial-terrain-3857-z5", "tileMatrix": "WebMercatorQuad", - "location": { "lat": -41.8899962, "lng": 174.0492437, "z": 5 }, - "tileSet": "health_aerial_terrain" + "location": { "lat": -41.8899962, "lng": 174.0492437, "z": 12, "p": 58 }, + "tileSet": "aerial", + "style": "health_aerial_terrain" }, { "name": "health-aerial-hillshade-3857-z5", "tileMatrix": "WebMercatorQuad", - "location": { "lat": -41.8899962, "lng": 174.0492437, "z": 5 }, - "tileSet": "health_aerial_hillshade" + "location": { "lat": -43.1785324, "lng": 171.3611922, "z": 7 }, + "tileSet": "aerial", + "style": "health_aerial_hillshade" } ]