Opened 5 years ago

Closed 5 years ago

#7240 closed defect (worksforme)

error while reading zip file

Reported by: TobWen Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 2.2.3
Severity: normal Keywords:


I'm getting an error while parsing the vector VRT attached; it works in older builds.

Example command: ogrinfo merged.vrt

Error message: ERROR 1: In file cpl_vsil_gzip.cpp, at line 1116, return 0

Attachments (1)

merged.vrt (13.8 KB ) - added by TobWen 5 years ago.

Download all attachments as: .zip

Change History (11)

by TobWen, 5 years ago

Attachment: merged.vrt added

comment:1 by Even Rouault, 5 years ago

Summary: error while reading vector VRTerror while reading zip file

Could you isolate which zip file causes the issue, and attach it ? And you will likely reproduce the issue with reading it directly outside of the VRT.

comment:2 by TobWen, 5 years ago

Actually, I can't... I've unzipped it and check it, no errors occurred: for f in *.shp; do ogrinfo $f; done

Here are all my steps:

ogrmerge -single -f VRT -o merged.vrt /vsizip/
ogrinfo -so --debug yes merged.vrt

I wonder why GZIP complains, it's a ZIP file, not a GZIP file.

comment:3 by Even Rouault, 5 years ago

Could you try ogrinfo -so /vsizip/..... instead ?

(Both /vsigzip/ and /vsizip/ are implemented in cpl_vsil_gzip.cpp)

comment:4 by TobWen, 5 years ago

Works like a charm:

INFO: Open of `/vsizip/'
      using driver `ESRI Shapefile' successful.
1: 100kmN26E43_DE_Grid_ETRS89-LAEA_100m (Polygon)
2: 100kmN26E44_DE_Grid_ETRS89-LAEA_100m (Polygon)
3: 100kmN27E41_DE_Grid_ETRS89-LAEA_100m (Polygon)
56: 100kmN35E41_DE_Grid_ETRS89-LAEA_100m (Polygon)
57: 100kmN35E42_DE_Grid_ETRS89-LAEA_100m (Polygon)
58: 100kmN35E43_DE_Grid_ETRS89-LAEA_100m (Polygon)
59: 100kmN35E44_DE_Grid_ETRS89-LAEA_100m (Polygon)
60: 100kmN35E45_DE_Grid_ETRS89-LAEA_100m (Polygon)

comment:5 by Even Rouault, 5 years ago

You lack the -so flag, but even with it, is probably not enough in the case of shapefiles since getting extent and feature count doesn't require iterating over the layer content. You likely need to ogr2ogr each layer to identify the one that cause issues

comment:6 by TobWen, 5 years ago

I was running with -so: ogrinfo -so /vsizip/ This also works without an error: ogrinfo -al -so /vsizip/

Okay, let's go through each layer.

Last edited 5 years ago by TobWen (previous) (diff)

comment:7 by TobWen, 5 years ago

Takes a while, the output file is about 14 GiB.

comment:8 by TobWen, 5 years ago

I was able to load all features. OGR didn't output any errors, only this one: ERROR 1: In file cpl_vsil_gzip.cpp, at line 1116, return 0

comment:9 by TobWen, 5 years ago

I've just built it against external gzip - no errors occurred.

comment:10 by Even Rouault, 5 years ago

Resolution: worksforme
Status: newclosed

I tried with both internal and external zlib and couldn't reproduce any error message with your reproduction steps and dataset. I also tried "ogr2ogr -f null null merged.vrt" ( --with-null flag at ./configure stage to force the compilation of the null driver, with trunk), to force reading of the whole file.

Closing this for now as "worksforme". Please re-open if you can provide more elements

Note: See TracTickets for help on using tickets.