Opened 6 years ago
Closed 6 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: | |
Cc: |
Description
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)
Change History (11)
by , 6 years ago
Attachment: | merged.vrt added |
---|
comment:1 by , 6 years ago
Summary: | error while reading vector VRT → error while reading zip file |
---|
comment:2 by , 6 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:
wget http://www.geodatenzentrum.de/auftrag1/archiv/vektor/geogitter/last/laea_shape/DE_Grid_ETRS89-LAEA_100m.shape.zip ogrmerge -single -f VRT -o merged.vrt /vsizip/DE_Grid_ETRS89-LAEA_100m.shape.zip ogrinfo -so --debug yes merged.vrt
I wonder why GZIP complains, it's a ZIP file, not a GZIP file.
comment:3 by , 6 years ago
Could you try ogrinfo -so /vsizip/..... instead ?
(Both /vsigzip/ and /vsizip/ are implemented in cpl_vsil_gzip.cpp)
comment:4 by , 6 years ago
Works like a charm:
INFO: Open of `/vsizip/DE_Grid_ETRS89-LAEA_100m.shape.zip' 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 , 6 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 , 6 years ago
I was running with -so: ogrinfo -so /vsizip/DE_Grid_ETRS89-LAEA_100m.shape.zip
This also works without an error: ogrinfo -al -so /vsizip/DE_Grid_ETRS89-LAEA_100m.shape.zip
Okay, let's go through each layer.
comment:8 by , 6 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:10 by , 6 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
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
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.