[OSM-dev-fr] Paratage de DEM ( était Héberger le rendu HOT?)
yvecai
yvecai at gmail.com
Mer 3 Juil 19:37:56 UTC 2013
Recette Hillshading sur opensnowmap, pour noter çà quelque part et si
certains son d'humeur joueuse.
Rien de particulier, si ce n'est ce réglage là avec imagemagick, qui ne
marche pas sur des tifff énormes, bien sûr :
composite -compose Multiply hillshade.tif slopes.tif composed.tif
mogrify -level 28%x70% composed.tif
Yves
gdalbuildvrt -srcnodata -32768 DEM.vrt tiles/*.tif
gdal_translate -of GTiff -co "BIGTIFF=YES" -co "TILED=YES" DEM.vrt DEM.tif
gdaldem hillshade -of GTiff -co "BIGTIFF=YES" -co "COMPRESS=PACKBITS"
-z 2 -s 111120 DEM.tif HILLSHADE.tif
gdaldem slope -of GTiff -co "BIGTIFF=YES" -co "COMPRESS=PACKBITS" -s
111120 DEM.tif TMP.tif
gdaldem color-relief -of GTiff -co "BIGTIFF=YES" -co
"COMPRESS=PACKBITS" TMP.tif color_slope.txt SLOPES.tif
for a in {-18..17}
do
for y1 in {-60..71}
do
x1=$(echo $a*10 | bc)
x2=$(echo $x1+10.02 | bc)
y2=$(echo $y1+1.02 | bc)
#~
echo $x1 $y2 $x2 $y1
name=E$x1"N"$y1.tif
echo $name
gdalwarp -dstnodata 255 -of GTiff -te $x1 $y1 $x2 $y2 HILLSHADE.tif
hillshade.tif
gdalwarp -dstnodata 255 -of GTiff -te $x1 $y1 $x2 $y2 SLOPES.tif
slopes.tif
composite -compose Multiply hillshade.tif slopes.tif composed.tif
mogrify -level 28%x70% composed.tif
./gdalcopyproj.py hillshade.tif composed.tif
mv composed.tif hs-tiles/$name
rm hillshade.tif slopes.tif
done
done
# sort out paletted (empty) files
for x in hs-tiles/*.tif
do
if [ $(gdalinfo $x | grep -c "ColorInterp=Palette") -ne 0 ]
then
mv $x tmp/
fi
done
gdalbuildvrt -hidenodata -vrtnodata "255" done.vrt hs-tiles/*.tif
gdal_translate -of GTiff -co "BIGTIFF=YES" -co "TILED=YES" done.vrt
wgs84.tif
gdalwarp -of GTiff -co "BIGTIFF=YES" -co "COMPRESS=PACKBITS" -co
"TILED=YES" \
-t_srs "+init=epsg:3857 +over" \
-r cubic -order 3 -multi wgs84.tif 3857.tif
Plus d'informations sur la liste de diffusion dev-fr