Skip to content

Adding test for GeoTIFF #240

Adding test for GeoTIFF

Adding test for GeoTIFF #240

---
name: Install Package & Test
on:
pull_request:
push:
paths:
- "etc/**"
- "utils/**"
- ".github/workflows/install-package-and-test.yml"
jobs:
install-package-and-test:
continue-on-error: ${{ matrix.experimental || false }}
name: ${{ matrix.image }}
runs-on: ubuntu-latest
strategy:
matrix:
image:
- "debian:11"
- "debian:12"
- "ubuntu:22.04"
- "ubuntu:24.04"
include:
- image: "debian:unstable"
experimental: true
- image: "ubuntu:devel"
experimental: true
fail-fast: false
container:
image: ${{ matrix.image }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install mod_tile & renderd
uses: ./.github/actions/dependencies/install/apt-get
with:
packages: >-
apache2
curl
gdal-bin
libapache2-mod-tile
renderd
- name: Prepare
run: |
mkdir -p /usr/share/renderd
cp -av utils/example-map /usr/share/renderd/
cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf
MAPNIK_INPUT=$(find /usr -type d -name input | grep mapnik)
sed -i "s#/usr/lib/mapnik/3.1/input#${MAPNIK_INPUT}#g" /etc/renderd.conf
printf '
[example-map]
URI=/tiles/renderd-example
XML=/usr/share/renderd/example-map/mapnik.xml
[example-map-jpg]
TYPE=jpg image/jpeg jpeg
URI=/tiles/renderd-example-jpg
XML=/usr/share/renderd/example-map/mapnik.xml
[example-map-png256]
TYPE=png image/png png256
URI=/tiles/renderd-example-png256
XML=/usr/share/renderd/example-map/mapnik.xml
[example-map-png32]
TYPE=png image/png png32
URI=/tiles/renderd-example-png32
XML=/usr/share/renderd/example-map/mapnik.xml
[example-map-webp]
TYPE=webp image/webp webp
URI=/tiles/renderd-example-webp
XML=/usr/share/renderd/example-map/mapnik.xml
[example-geotiff-map]
URI=/tiles/renderd-geotiff-example
XML=/usr/share/renderd/example-map/mapnik-geotiff.xml
' | tee -a /etc/renderd.conf
curl --location --silent https://raw.githubusercontent.com/GeoTIFF/test-data/8506204783ff26a6c49ed1f721e7e1635b2e43ee/files/gpm_1d.20240617.tif > /tmp/gpm_1d.20240617.tif
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 -r bilinear -te -20037508.34 -20037508.34 20037508.34 20037508.3 /tmp/gpm_1d.20240617.tif /tmp/gpm_1d.20240617_web.tif
printf '<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Style name="raster">
<Rule>
<RasterSymbolizer/>
</Rule>
</Style>
<Layer name="raster" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<StyleName>raster</StyleName>
<Datasource>
<Parameter name="type"><![CDATA[gdal]]></Parameter>
<Parameter name="file"><![CDATA[/tmp/gpm_1d.20240617_web.tif]]></Parameter>
</Datasource>
</Layer>
</Map>
' | tee /usr/share/renderd/example-map/mapnik-geotiff.xml
mkdir -p /run/renderd
renderd
a2enmod tile
a2ensite renderd-example-map
apache2ctl restart
shell: bash --noprofile --norc -euxo pipefail {0}
- name: Test
run: |
until $(curl --fail --output tile.png --silent http://localhost:8081/tiles/renderd-example/9/297/191.png); do
echo 'Sleeping 5s';
sleep 5;
done
echo 'dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08 tile.png' | sha256sum --check
shell: bash --noprofile --norc -euxo pipefail {0}
timeout-minutes: 1
- name: Test GeoTIFF
run: |
until $(curl --fail --output tile-geotiff.png --silent http://localhost:8081/tiles/renderd-geotiff-example/4/0/5.png); do
echo 'Sleeping 5s';
sleep 5;
done
echo 'a0ef37208f88c16a7853bf58cdb359cf48c43ddfa983835f32a87391329b1de0 tile-geotiff.png
79e9b6b53dd0cd0e62033562c093268cf6b0538201caffe6e07e4e2e33112c33 tile-geotiff.png' | sha256sum --check | grep OK
shell: bash --noprofile --norc -eux {0}
timeout-minutes: 1