GDAL 3.4.1, released 2021/12/27
curl -kJLOR "https://daten.gdz.bkg.bund.de/produkte/topplus_open/TopPlusOpen/aktuell/mercator/9.mbtile"
cp 9.mbtile 9.mbtiles
gdal_translate -srcwin 68000 44000 500 500 9.mbtiles vrt.vrt
gdal_translate -srcwin 68000 44000 500 500 9.mbtiles rasterlite.sqlite -co DRIVER=PNG -of rasterlite
gdal_translate -srcwin 68000 44000 500 500 9.mbtiles gpkg.gpkg -co TILE_FORMAT=PNG
gdal_translate -srcwin 68000 44000 500 500 9.mbtiles mbtiles.mbtiles -co TILE_FORMAT=PNG
gdal_translate -srcwin 68000 44000 500 500 9.mbtiles geotiff.tif -co COMPRESS=LZW
gdalinfo -json vrt.vrt | jq .geoTransform
gdalinfo -json rasterlite.sqlite | jq .geoTransform
gdalinfo -json gpkg.gpkg | jq .geoTransform
gdalinfo -json mbtiles.mbtiles | jq .geoTransform
gdalinfo -json geotiff.tif | jq .geoTransform
{
"vrt.vrt": [753363.3507786989212036,305.7481131407050157,0.0,6584591.3645982239395380,0.0,-305.7481131407050157],
"rasterlite.sqlite": [753363.3507786989212036,305.7481131407050157,0.0,6584591.3645982239395380,0.0,-305.7481131407050157],
"geotiff.tif": [753363.3507786989212036,305.7481131407050157,0.0,6584591.3645982239395380,0.0,-305.7481131407050157],
"gpkg.gpkg": [753363.3507786990376189,305.7481131407050157,0.0,6584591.3645982202142477,0.0,-305.7481131407050157],
"mbtiles.mbtiles": [753363.3507786989212036,305.7481131407050157,0.0,6584591.3645982258021832,0.0,-305.7481131407050157]
^^^^^^^^ ^^^^^^^^
}
gdal gdal_translate rasterlite.sqlite rasterlite.tif
gdal gdal_translate gpkg.gpkg gpkg.tif
gdal gdal_translate mbtiles.mbtiles mbtiles.tif
gdal gdal_translate --config GDAL_PAM_ENABLED NO rasterlite.sqlite rasterlite.tif -co PROFILE=BASELINE -co TFW=YES; \
gdal gdal_translate --config GDAL_PAM_ENABLED NO gpkg.gpkg gpkg.tif -co PROFILE=BASELINE -co TFW=YES; \
gdal gdal_translate --config GDAL_PAM_ENABLED NO mbtiles.mbtiles mbtiles.tif -co PROFILE=BASELINE -co TFW=YES; \
{
"geotiff.tif" : [305.7481131407 0.0000000000 0.0000000000 -305.7481131407 753516.2248352693 6584438.4905416537],
"rasterlite.tif": [305.7481131407 0.0000000000 0.0000000000 -305.7481131407 753516.2248352693 6584438.4905416537],
"gpkg.tif" : [305.7481131407 0.0000000000 0.0000000000 -305.7481131407 753516.2248352693 6584438.4905416556],
"mbtiles.tif" : [305.7481131407 0.0000000000 0.0000000000 -305.7481131407 753516.2248352694 6584438.4905416500]
^ ^^
}
- Somewhy,
.geoTransform
is off in gpkg and mbtiles. - Even when this is an IEEE754 issue, all the values should be equal.