Skip to content

Commit 6de97b6

Browse files
committed
Adding test for GeoTIFF
1 parent e8ac8f1 commit 6de97b6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/install-package-and-test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
packages: >-
4040
apache2
4141
curl
42+
gdal-bin
4243
libapache2-mod-tile
4344
renderd
4445
@@ -73,7 +74,30 @@ jobs:
7374
TYPE=webp image/webp webp
7475
URI=/tiles/renderd-example-webp
7576
XML=/usr/share/renderd/example-map/mapnik.xml
77+
78+
[example-geotiff-map]
79+
URI=/tiles/renderd-geotiff-example
80+
XML=/usr/share/renderd/example-map/mapnik-geotiff.xml
7681
' | tee -a /etc/renderd.conf
82+
curl --location --silent https://raw.githubusercontent.com/GeoTIFF/test-data/8506204783ff26a6c49ed1f721e7e1635b2e43ee/files/gpm_1d.20240617.tif > /tmp/gpm_1d.20240617.tif
83+
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
84+
printf '<?xml version="1.0" encoding="utf-8"?>
85+
<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">
86+
<Style name="raster">
87+
<Rule>
88+
<RasterSymbolizer/>
89+
</Rule>
90+
</Style>
91+
92+
<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">
93+
<StyleName>raster</StyleName>
94+
<Datasource>
95+
<Parameter name="type"><![CDATA[gdal]]></Parameter>
96+
<Parameter name="file"><![CDATA[/tmp/gpm_1d.20240617_web.tif]]></Parameter>
97+
</Datasource>
98+
</Layer>
99+
</Map>
100+
' | tee /usr/share/renderd/example-map/mapnik-geotiff.xml
77101
mkdir -p /run/renderd
78102
renderd
79103
a2enmod tile
@@ -90,3 +114,14 @@ jobs:
90114
echo 'dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08 tile.png' | sha256sum --check
91115
shell: bash --noprofile --norc -euxo pipefail {0}
92116
timeout-minutes: 1
117+
118+
- name: Test GeoTIFF
119+
run: |
120+
until $(curl --fail --output tile-geotiff.png --silent http://localhost:8081/tiles/renderd-geotiff-example/4/0/5.png); do
121+
echo 'Sleeping 5s';
122+
sleep 5;
123+
done
124+
echo 'a0ef37208f88c16a7853bf58cdb359cf48c43ddfa983835f32a87391329b1de0 tile-geotiff.png
125+
79e9b6b53dd0cd0e62033562c093268cf6b0538201caffe6e07e4e2e33112c33 tile-geotiff.png' | sha256sum --check | grep OK
126+
shell: bash --noprofile --norc -eux {0}
127+
timeout-minutes: 1

0 commit comments

Comments
 (0)