Opened 5 years ago

Last modified 5 years ago

#6836 closed defect

Making mbtiles with alpha band depends on resolution — at Initial Version

Reported by: mattwilkins Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Hi,

I can't find a general mailing list to ask questions, so sorry, I have to pose this as a bug. But I'm probably making a mistake somewhere.

I have a geotiff that I want to make into a mbtiles with an alpha band. This sequence of commands makes a mbtile with an alpha band:

gdalwarp -tr 0.02 0.02 -r average 11.tif tmp.tif gdal_translate tmp.tif foo.mbtiles -of MBTILES

but this sequence of commands (NB: just the resolution different) results in an mbtiles without an alpha band:

gdalwarp -tr 0.0002 0.0002 -r average 11.tif tmp.tif gdal_translate tmp.tif foo.mbtiles -of MBTILES

The input file 11.tif is kinda large so not sure I want to submit it here. But this is its gdalinfo

Driver: GTiff/GeoTIFF Files: 11.tif Size is 4863, 2999 Coordinate System is: GEOGCS["WGS 84",

DATUM["WGS_1984",

SPHEROID["WGS 84",6378137,298.257223563,

AUTHORITY["EPSG","7030"]],

AUTHORITY["EPSG","6326"]],

PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]]

Origin = (173.727848284398078,-37.696798582530377) Pixel Size = (0.000224206890208,-0.000224206890208) Metadata:

AREA_OR_POINT=Area

Image Structure Metadata:

INTERLEAVE=PIXEL

Corner Coordinates: Upper Left ( 173.7278483, -37.6967986) (173d43'40.25"E, 37d41'48.47"S) Lower Left ( 173.7278483, -38.3691950) (173d43'40.25"E, 38d22' 9.10"S) Upper Right ( 174.8181664, -37.6967986) (174d49' 5.40"E, 37d41'48.47"S) Lower Right ( 174.8181664, -38.3691950) (174d49' 5.40"E, 38d22' 9.10"S) Center ( 174.2730073, -38.0329968) (174d16'22.83"E, 38d 1'58.79"S) Band 1 Block=4863x1 Type=Byte, ColorInterp=Red

Mask Flags: PER_DATASET ALPHA

Band 2 Block=4863x1 Type=Byte, ColorInterp=Green

Mask Flags: PER_DATASET ALPHA

Band 3 Block=4863x1 Type=Byte, ColorInterp=Blue

Mask Flags: PER_DATASET ALPHA

Band 4 Block=4863x1 Type=Byte, ColorInterp=Alpha

Note that I tried doing a gdalwarp -t_srs EPSG:3857 -r average 11.tif tmp2.tif first and I got similar results: this didn't work,

gdalwarp -tr 40 40 -r average tmp2.tif tmp.tif gdal_translate tmp.tif foo.mbtiles -of MBTILES

but this did:

gdalwarp -tr 4000 4000 -r average tmp2.tif tmp.tif gdal_translate tmp.tif foo.mbtiles -of MBTILES

and the gdalinfo of tmp2.tif is Driver: GTiff/GeoTIFF Files: tmp2.tif Size is 11277, 16132 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"]],

PROJECTIONMercator_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 = (19339295.607630282640457,-4533291.924883016385138) Pixel Size = (20.000000000000000,-20.000000000000000) Metadata:

AREA_OR_POINT=Area

Image Structure Metadata:

INTERLEAVE=PIXEL

Corner Coordinates: Upper Left (19339295.608,-4533291.925) (173d43'40.25"E, 37d40'21.72"S) Lower Left (19339295.608,-4855931.925) (173d43'40.25"E, 39d55'51.88"S) Upper Right (19564835.608,-4533291.925) (175d45'14.07"E, 37d40'21.72"S) Lower Right (19564835.608,-4855931.925) (175d45'14.07"E, 39d55'51.88"S) Center (19452065.608,-4694611.925) (174d44'27.16"E, 38d48'39.02"S) Band 1 Block=11277x1 Type=Byte, ColorInterp=Red

Mask Flags: PER_DATASET ALPHA

Band 2 Block=11277x1 Type=Byte, ColorInterp=Green

Mask Flags: PER_DATASET ALPHA

Band 3 Block=11277x1 Type=Byte, ColorInterp=Blue

Mask Flags: PER_DATASET ALPHA

Band 4 Block=11277x1 Type=Byte, ColorInterp=Alpha

Thanks for any help.

Matt

Change History (0)

Note: See TracTickets for help on using tickets.