Opened 8 years ago

Closed 8 years ago

#6339 closed defect (fixed)

Overview Creation fails in geopackages created using Tiling Scheme

Reported by: Augustus Owned by: warmerdam
Priority: normal Milestone: 2.0.3
Component: default Version: 2.0.1
Severity: normal Keywords: raster geopackage gdaladdo
Cc:

Description (last modified by Augustus)

The following command will cause a crash for large tiled images. With small tiled images the overviews creation is done fine

gdal_translate -of GPKG byteError.tif gpkg.gpkg -co TILING_SCHEME=GoogleMapsCompatible
gdaladdo gpkg.gpkg 2 4 8 16 32

You can reproduce this issue by re-sampling the byte.tif to 9999 rows and columns and then manipulating the resultant tif file using the above commands https://github.com/OSGeo/gdal/blob/trunk/autotest/gdrivers/data/byte.tif I have attached the intermediate files.

Update: Workflow for reproducing the issue

Attachments (3)

gpkg.gpkg (439.0 KB ) - added by Augustus 8 years ago.
byte4800.tif (486.0 KB ) - added by Augustus 8 years ago.
Log (21.8 KB ) - added by Augustus 8 years ago.
ErrorLog

Download all attachments as: .zip

Change History (11)

by Augustus, 8 years ago

Attachment: gpkg.gpkg added

by Augustus, 8 years ago

Attachment: byte4800.tif added

comment:1 by Even Rouault, 8 years ago

Resolution: duplicate
Status: newclosed

I guess this is the same as #6335 I cannot reproduce any issue after the fixes done in #6335 (instead of the error message you got in #6335, crash was also likely)

comment:2 by Augustus, 8 years ago

Description: modified (diff)

I was able to reproduce this issue with larger images. Steps to reproduce this issue

Data is Attached byte4800.tif

gdal_translate -outsize 9999 10118 byte4800.tif byteError.tif
gdal_translate -of GPKG byteError.tif TestPNG.gpkg -co TILING_SCHEME=GoogleMapsCompatible -co TILE_FORMAT=PNG

Error

ERROR 1: sqlite3_exec(UPDATE partial_tiles SET zoom_level = -21, partial_flag =
0 WHERE zoom_level = 20 AND partial_flag != 0) failed: columns zoom_level, tile_
column, tile_row are not unique
ERROR 1: sqlite3_exec(UPDATE partial_tiles SET zoom_level = -21, partial_flag =
0 WHERE zoom_level = 20 AND partial_flag != 0) failed: database disk image is ma
lformed
Version 0, edited 8 years ago by Augustus (next)

comment:3 by Augustus, 8 years ago

Description: modified (diff)
Resolution: duplicate
Status: closedreopened

comment:4 by Even Rouault, 8 years ago

Witch which version / revision of the code did you try ? Is it at least 2.0.2 ? I just tried with the latest state of the 2.0 branch with your instructions and it works fine

comment:5 by Augustus, 8 years ago

I have done the test on build from latest source Revision 33721 with

sqlite3 v3.7.17-2
proj4 v4.9.2-2
Windows 8.1

comment:6 by Even Rouault, 8 years ago

I've just tested with latest trunk as well, and cannot still reproduce. However in trunk now the default value for the GDAL_CACHEMAX configuration option is 5% of the RAM, so the issue might be dependant on that. Could you add "--debug on" to the gdal_translate command line and check the debug trace "GDAL: GDAL_CACHEMAX = xx MB" and report the value of xx ?

by Augustus, 8 years ago

Attachment: Log added

comment:7 by Augustus, 8 years ago

Detailed Log is now attached.

GDAL: GDAL_CACHEMAX = 102 MB

Updated to sqllite3 3.11.1

comment:8 by Even Rouault, 8 years ago

Milestone: 2.0.3
Resolution: fixed
Status: reopenedclosed

Reproduced with GDAL_CACHEMAX = 102 MB

trunk r33727, branches/2.0 r33728 "GPKG write support: fix inversion of row/column in one of the SQL request involved in partial tiles management (#6339)"

Note: See TracTickets for help on using tickets.