Closed jacmendt closed 1 month ago
I tried to use the QGIS transformation directly with gdalwarp, but this leads me to the following error:
gdalwarp -ct '+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=de_adv_BETA2007.tif +step +proj=webmerc +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84' historic_map_4314.tif historic_map_3857_ct.tif
yes this is expected as the BETA2007 grid only goes up to longitude 15.75, and your raster is around 18.5 degree. More generally the DHDN datum of EPSG:4314 is documented to be only valid for former West Germany, up to longitude 13.84. So PROJ auto guessing methods will not work very weel for such data that is outside the normal area of use. Your solution of manually specifying the transformation that works for you is the best one I can recommend.
What is the bug?
We have a couple of historic images with the coordinate system
EPSG:4314
. We publish the images via WMS as well as TMS. For the TMS we use gdal2tiles. Recently we did a reprocessing of some of the TMS and observe now shifts for historic maps of poland, which were not there before. On the image below you can see the shifts on the edges of the map, were it does not fit the roads.To track down our issues, we start to first warp the image via gdalwarp (GDAL-Version: 3.4.1 | Proj-Bin: 8.2.1-1 | Ubuntu: 22.04.4) from
EPSG:4314
toEPSG:3857
. After that we displayed the results in QGIS (in EPSG:3857). We could again see the shift.Because the warping was working in the past, I tried it with an older gdal version.
I also detected that somehow, when I load in the historic_map_4314.tif directly into QGIS, QGIS does some other kind of transformation and the image again is displayed properly.
I tried to use the QGIS transformation directly with gdalwarp, but this leads me to the following error:
I'm not an expert in coordinate systems, but according to [https://epsg.io/4314] there are different transformations. By selection from this page one of the more specific transformation, I can also produce a proper result:
I'm not sure if this a bug or just something with the change of definition of the coordinate system. We already have found some ways to work around it, so do not hesitate to close the issue, if you think this is not a GDAL issue. If it is a regression in the GDAL library we would also be willing to help fund the fix. Of course, we are also happy to receive feedback in order to better address the topic.
Steps to reproduce the issue
With gdalversion 3.4.1 and Ubuntu 22.04 use the following command:
Test-Data: historic_map_4314.zip
Versions and provenance
GDAL: 3.4.1 Ubuntu: 22.04
Additional context
No response