TransWikia.com

Conversion to mbtiles drastically reduces file size of GTiff (rio mbtiles)

Geographic Information Systems Asked on April 13, 2021

Input file is a GTiff (georeferenced tif), 16728 x 21386 pixels, 1.43 Gb.
Output from rio mbtiles is an mbtiles file, 104 x 136 pixels, 41 Kb. The resulting mbtile has much larger pixels and therefore is very low quality (resolution) when loaded to MapTiler or MapBox.

Is there a parameter in my command I am missing, or not setting properly?

Command:

rio mbtiles myfile.tif myfile.mbtiles --zoom-levels 13..16 --format PNG --src-nodata 0

From gdalinfo:

INPUT FILE

gdalinfo myfile.tif 
Driver: GTiff/GeoTIFF
Files: myfile.tif
Size is 16728, 21386
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    USAGE[
        SCOPE["unknown"],
        AREA["World"],
        BBOX[-90,-180,90,180]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-90.473095751789174,31.184670772772130)
Pixel Size = (0.000000134018474,-0.000000116325716)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_DATETIME=2020:10:05 19:50:55
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_SOFTWARE=Adobe Photoshop 21.2 (Macintosh)
  TIFFTAG_XRESOLUTION=72
  TIFFTAG_YRESOLUTION=72
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( -90.4730958,  31.1846708) ( 90d28'23.14"W, 31d11' 4.81"N)
Lower Left  ( -90.4730958,  31.1821830) ( 90d28'23.14"W, 31d10'55.86"N)
Upper Right ( -90.4708539,  31.1846708) ( 90d28'15.07"W, 31d11' 4.81"N)
Lower Right ( -90.4708539,  31.1821830) ( 90d28'15.07"W, 31d10'55.86"N)
Center      ( -90.4719748,  31.1834269) ( 90d28'19.11"W, 31d11' 0.34"N)
Band 1 Block=16728x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA 
Band 2 Block=16728x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA 
Band 3 Block=16728x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA 
Band 4 Block=16728x1 Type=Byte, ColorInterp=Alpha

OUTPUT FILE

gdalinfo myfile.mbtiles 
Driver: MBTiles/MBTiles
Files: myfile.mbtiles
Size is 104, 136
Coordinate System is:
PROJCRS["WGS 84 / Pseudo-Mercator",
    BASEGEOGCRS["WGS 84",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["unnamed",
        METHOD["Popular Visualisation Pseudo Mercator",
            ID["EPSG",1024]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["False easting",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    ID["EPSG",3857]]
Data axis to CRS axis mapping: 1,2
Origin = (-10071418.977210955694318,3656755.483043113257736)
Pixel Size = (2.388657133911758,-2.388657133911758)
Metadata:
  ZOOM_LEVEL=16
  name=myfile.tif
  type=overlay
  version=1.1
  description=/Volumes/me/TLTR/myfile.tif
  format=png
  bounds=-90.473096,31.182183,-90.470854,31.184671
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-10071418.977, 3656755.483) ( 90d28'23.15"W, 31d11' 4.82"N)
Lower Left  (-10071418.977, 3656430.626) ( 90d28'23.15"W, 31d10'55.83"N)
Upper Right (-10071170.557, 3656755.483) ( 90d28'15.11"W, 31d11' 4.82"N)
Lower Right (-10071170.557, 3656430.626) ( 90d28'15.11"W, 31d10'55.83"N)
Center      (-10071294.767, 3656593.054) ( 90d28'19.13"W, 31d11' 0.32"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Overviews: 52x68
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 52x68
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Overviews: 52x68
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 52x68
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Overviews: 52x68
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 52x68
Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha
  Overviews: 52x68

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP