der-stefan / OpenTopoMap

A topographic map from OpenStreetMap and SRTM data
https://opentopomap.org
Other
455 stars 118 forks source link

Hillshade & relief offset from the map #326

Open MoridinBG opened 1 year ago

MoridinBG commented 1 year ago

I have been using this docker image as a quick start to get a tileserver going. I have compared the included scripts against the instructions at https://github.com/der-stefan/OpenTopoMap/blob/master/mapnik/README.md and they check out. But the resulting tile server has the relief and hillshade offset a few kilometers north east.

Note the white band to the left. It's not snow (:

Screenshot 2022-08-05 at 15 47 21

Contour lines seem to be at the right place, but the relief is offset.

Screenshot 2022-08-05 at 15 48 30

This is the same location in opentopomap.org

Screenshot 2022-08-05 at 16 13 07

Both the contour lines and the hillshade & reliefe are derived from the same SRTM data via http://viewfinderpanoramas.org/Coverage%20map%20viewfinderpanoramas_org3.htm

I have merged the files into the raw.tiff with gdal_merge.py -n 32767 -co BIGTIFF=YES -co TILED=YES -co COMPRESS=LZW -co PREDICTOR=2 -o ../raw.tif *.hgt.tif

Wraps with -tr 5000, 1000, 500, 60, 30 with gdalwarp -co BIGTIFF=YES -co TILED=YES -co COMPRESS=LZW -co PREDICTOR=2 -t_srs "+proj=merc +ellps=sphere +R=6378137 +a=6378137 +units=m" -r bilinear -tr 60 60 raw.tif warp-60.tif

Reliefs with gdaldem color-relief -co COMPRESS=LZW -co PREDICTOR=2 -alpha warp-5000.tif /home/otm/relief_color_text_file.txt relief-5000.tif

Finally hillshade with

gdaldem hillshade -z 7 -compute_edges -co COMPRESS=JPEG warp-5000.tif hillshade-5000.tif
gdaldem hillshade -z 7 -compute_edges -co BIGTIFF=YES -co TILED=YES -co COMPRESS=JPEG warp-1000.tif hillshade-1000.tif
gdaldem hillshade -z 5 -compute_edges -co BIGTIFF=YES -co TILED=YES -co COMPRESS=JPEG warp-500.tif hillshade-500.tif
gdaldem hillshade -z 2 -co compress=lzw -co predictor=2 -co bigtiff=yes -compute_edges warp-30.tif hillshade-30.tif
gdal_translate -co compress=JPEG -co bigtiff=yes -co tiled=yes hillshade-30.tif hillshade-30-jpeg.tif

What is strange is that the contours seem to be in the right place, while the hillshade and relief are not. I got the contours with phyghtmap -j 12 -o contour --max-nodes-per-tile=0 -s 10 -0 --pbf warp-60.tif from the same data that I derived the hillshade from. I would have expected all of them to be offset then.

I first tried with the complete South America pbf and SRTM for full coverage, which took days, then again from scratch with just Uruguay and only the Uruguay SRTM files, being the smallest filesize and quickest to redo. Both times the same result. Is this a misconfiguration of the map & server or an issue with rendering?