View Ticket
Not logged in
Ticket Hash: 7a2e998b6475899d40cd75ecf1a7130bf5f28b93
Title: ImportZipSHP fails when the enclosed DBF file is larger than 2GB
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2020-10-26 11:20:00
Version Found In: 5.0.0
User Comments:
anonymous added on 2020-10-25 16:27:04:
Lately, I imported dozens of zipped shape files, and found out that this function consistently fails when importing some files with the enclosed DBF, when unzipped, is more than 2GB in size. I could import all the zipped shape files if the enclosed DBF file is less than 2GB. For instance, one zipped shape file had a DBF file of 1.92 GB, and could be imported successfully. I observed that the zipped shape files with a DBF of size 2.16 GB, 2.57 GB, 3.6 GB, etc. were all failed to import with an error message like "Error -1034240749 with zipfile in unzReadCurrentFile". Each failed import might have a different negative integer. The error message was seen with CLI. I did not see such an error message with gui; but the app might die while importing. 

I also tried to unzip these files first, and then used ImportSHP to import which worked fine, but takes longer time due to the large size of DBF. I also used ogr2ogr to cut the number of columns in the DBF file, so that the resulting DBF is smaller than 2 GB. I had no problem to import such modified zipped shape files. By the way, my DBF files had 85 columns, and also encountered some DBF files with 318 columns.

I would like to make an enhancement request for both ImportZipSHP and ImportSHP, so that the end user can specify which columns to import, just as ogr2ogr has an -select option.

mj10777 added on 2020-10-25 16:36:45:
Probably an int32 instead of uint32 or int64 when storing file size somewhere between the calling functions.

sandro added on 2020-10-26 11:20:00:
in the minizip-based routines there was a mismatch between 32 and 64 bit
integers forbidding to read any file with an uncompressed size > 2GB

fixed by commit 5808354e84