[gdal-dev] Fwd: MBTiles Write support

Lorenzo Pini lorenzo.pini at geo-solutions.it
Mon Apr 18 06:35:44 PDT 2016


Hi all,
I recently tested the MBTiles write support in the latest beta with good
results.
I'm now testing it with larger files, so here is some of my comments and
questions.

Version is: GDAL 2.1.0beta1, released 2016/04/01
The gdalinfo of the input file is:

Driver: GTiff/GeoTIFF
Files: mosaic.tif
Size is 645661, 308112
Coordinate System is:
PROJCS["Monte Mario / Italy zone 1",
    GEOGCS["Monte Mario",
        DATUM["Monte_Mario",
            SPHEROID["International 1924",6378388,297,
                AUTHORITY["EPSG","7022"]],
            TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],
            AUTHORITY["EPSG","6265"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4265"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",9],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",1500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    AUTHORITY["EPSG","3003"]]
Origin = (1473060.112236728700000,4930249.736560207800000)
Pixel Size = (0.055042625523929,-0.055042631056927)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=CCITTFAX4
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 1473060.112, 4930249.737) (  8d39'39.60"E, 44d31'27.30"N)
Lower Left  ( 1473060.112, 4913290.441) (  8d39'42.77"E, 44d22'17.68"N)
Upper Right ( 1508598.989, 4930249.737) (  9d 6'29.55"E, 44d31'28.93"N)
Lower Right ( 1508598.989, 4913290.441) (  9d 6'28.53"E, 44d22'19.29"N)
Center      ( 1490829.551, 4921770.089) (  8d53' 5.11"E, 44d26'54.09"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Palette
  NoData Value=1
  Image Structure Metadata:
    NBITS=1
  Color Table (RGB with 2 entries)
    0: 0,0,0,255
    1: 255,255,255,0

The command I used is:

\>gdal_translate mosaic.tif full_def9.mbtiles -of MBTILES -expand rgb -co
TILE_FORMAT=PNG8 -co ZLEVEL=9
Input file size is 645661, 308112
0...10...20...30...40...50...60...70...80ERROR 1: Failure when inserting
partial tile (row=759306,col=1099566) at zoom_level=21 : database or disk
is full
ERROR 1: full_def9.mbtiles, band 4: An error occurred while writing a dirty
block
ERROR 1: Failure when inserting partial tile (row=759306,col=1099566) at
zoom_level=21 : database disk image is malformed
ERROR 1: Failure when inserting partial tile (row=759306,col=1099566) at
zoom_level=21 : database disk image is malformed
ERROR 1: Failure when inserting partial tile (row=759306,col=1099566) at
zoom_level=21 : database disk image is malformed
ERROR 1: Failure when inserting partial tile (row=759306,col=1099576) at
zoom_level=21 : database disk image is malformed

NOTE: without the "-expand rgb" option, all the output tiles will be black,
gdal_translate will warn you.

The process failed due to insufficient disk space (70Gb free was not
enough) but the resulting incomplete file (7Gb) looks good.
Most of the space was used by the "partial_tiles" database, is there any
settings I can use to force a more frequent "flush" of the tiles in the
main database?

The file was created with zoom level = 21, that is more than we need, so I
tried to use ZOOM_LEVEL_STRATEGY to generate a level 20.
My plan was to generate a level 20 file with gdal_translate and then add
the level 19 with gdaladdo but both ZOOM_LEVEL_STRATEGY=UPPER and
ZOOM_LEVEL_STRATEGY=LOWER seems to compute the same zoom level 21.
How is the zoom level computed?

Thank you

Regards
Lorenzo Pini
Software Engineer

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:     +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160418/39bcc265/attachment-0001.html>


More information about the gdal-dev mailing list