[Qgis-user] MBTiles have wrong georeferencing

Johannes Kröger (WhereGroup) johannes.kroeger at wheregroup.com
Sat Apr 8 11:15:49 PDT 2023


Hi Christian,

By default the MBTiles format is *always* assumed to be in EPSG:3857. 
You might be lucky and be able to override that in QGIS if you go to the 
layer's settings and set your CRS there. It might or it might not work.

If you can, best use GPKG for your raster-tiles-in-many-zoomlevels 
needs. That format does not have this restriction.

Cheers, Hannes

Am 06.04.23 um 17:38 schrieb Namotec, Eberbach am Neckar via QGIS-User:
>
> Hi,
>
>
> I want to georeference a very large SQlite file (MBTiles) and include 
> it in QGIS3. The tiles can be displayed with QGIS, but the location is 
> not correct.
>
> What is the best strategy to georeference MBTiles?
>
> According to manual MBTiles does not accept worldfile (wld).
> Reference: https://gdal.org/drivers/raster/mbtiles.html
>
> For correct projection scaling and XY shift is enough.
>
> Is it standard to create a Custom Coordinate Reference System (CRS) in 
> such a case?
>
> Or is GDAL suitable to make a coordinate transformation?
>
> Does anyone know a manual? I am grateful for any hint.
>
>
> Regards,
> Christian Naujoks
>
>
> gdalinfo:
>
> Driver: MBTiles/MBTiles
> Files: map_z6-18.mbtiles
> Size is 2097152, 2097152
> Coordinate System is:
> PROJCS["WGS 84 / Pseudo-Mercator",
>     GEOGCS["WGS 84",
>         DATUM["WGS_1984",
>             SPHEROID["WGS 84",6378137,298.257223563,
>                 AUTHORITY["EPSG","7030"]],
>             AUTHORITY["EPSG","6326"]],
>         PRIMEM["Greenwich",0,
>             AUTHORITY["EPSG","8901"]],
>         UNIT["degree",0.0174532925199433,
>             AUTHORITY["EPSG","9122"]],
>         AUTHORITY["EPSG","4326"]],
>     PROJECTION["Mercator_1SP"],
>     PARAMETER["central_meridian",0],
>     PARAMETER["scale_factor",1],
>     PARAMETER["false_easting",0],
>     PARAMETER["false_northing",0],
>     UNIT["metre",1,
>         AUTHORITY["EPSG","9001"]],
>     AXIS["X",EAST],
>     AXIS["Y",NORTH],
>     EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 
> +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null 
> +wktext  +no_defs"],
>     AUTHORITY["EPSG","3857"]]
> Origin = (0.000000000000000,7514065.628809665329754)
> Pixel Size = (1.194328566955879,-1.194328566955879)
> Metadata:
>   ZOOM_LEVEL=17
>   name=Unnamed map
>   type=baselayer
>   version=1.2
>   format=jpg
>   bounds=0.00000000,40.97989807,22.50000000,55.77657302
>   attribution=
>   scheme=tms
>   minzoom=5
>   maxzoom=17
>   center=11.25000000, 48.37823554, 5
> Image Structure Metadata:
>   INTERLEAVE=PIXEL
> Corner Coordinates:
> Upper Left  (       0.000, 7514065.629) (  0d 0' 0.01"E, 55d46'35.66"N)
> Lower Left  (       0.000, 5009377.086) (  0d 0' 0.01"E, 40d58'47.63"N)
> Upper Right ( 2504688.543, 7514065.629) ( 22d30' 0.00"E, 55d46'35.66"N)
> Lower Right ( 2504688.543, 5009377.086) ( 22d30' 0.00"E, 40d58'47.63"N)
> Center      ( 1252344.271, 6261721.357) ( 11d15' 0.00"E, 48d55'21.00"N)
> Band 1 Block=256x256 Type=Byte, ColorInterp=Red
>   Overviews: 1048576x1048576, 524288x524288, 262144x262144, 
> 131072x131072, 65536x65536, 32768x32768, 16384x16384, 8192x8192, 
> 4096x4096, 2048x2048, 1024x1024, 512x512
>   Mask Flags: PER_DATASET ALPHA
>   Overviews of mask band: 1048576x1048576, 524288x524288, 
> 262144x262144, 131072x131072, 65536x65536, 32768x32768, 16384x16384, 
> 8192x8192, 4096x4096, 2048x2048, 1024x1024, 512x512
> Band 2 Block=256x256 Type=Byte, ColorInterp=Green
>   Overviews: 1048576x1048576, 524288x524288, 262144x262144, 
> 131072x131072, 65536x65536, 32768x32768, 16384x16384, 8192x8192, 
> 4096x4096, 2048x2048, 1024x1024, 512x512
>   Mask Flags: PER_DATASET ALPHA
>   Overviews of mask band: 1048576x1048576, 524288x524288, 
> 262144x262144, 131072x131072, 65536x65536, 32768x32768, 16384x16384, 
> 8192x8192, 4096x4096, 2048x2048, 1024x1024, 512x512
> Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
>   Overviews: 1048576x1048576, 524288x524288, 262144x262144, 
> 131072x131072, 65536x65536, 32768x32768, 16384x16384, 8192x8192, 
> 4096x4096, 2048x2048, 1024x1024, 512x512
>   Mask Flags: PER_DATASET ALPHA
>   Overviews of mask band: 1048576x1048576, 524288x524288, 
> 262144x262144, 131072x131072, 65536x65536, 32768x32768, 16384x16384, 
> 8192x8192, 4096x4096, 2048x2048, 1024x1024, 512x512
> Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha
>   Overviews: 1048576x1048576, 524288x524288, 262144x262144, 
> 131072x131072, 65536x65536, 32768x32768, 16384x16384, 8192x8192, 
> 4096x4096, 2048x2048, 1024x1024, 512x512
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user

-- 
Johannes Kröger / GIS-Entwickler/-Berater

---------------------------------------------
Aufwind durch Wissen!
Web-Seminare und Online-Schulungen
bei derwww.foss-academy.com
---------------------------------------------

WhereGroup GmbH
c/o KK03 GmbH
Lange Reihe 29
20099 Hamburg
Germany

Tel: +49 (0)228 / 90 90 38 - 36
Fax: +49 (0)228 / 90 90 38 - 11

johannes.kroeger at wheregroup.com
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
-------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230408/5610fada/attachment.htm>


More information about the QGIS-User mailing list