Feature request #10124

take advantage of gdal's vsipreload mechanism to support VSIFILE on all formats

Added by Etienne Tourigny over 9 years ago. Updated over 6 years ago.

Category:Data Provider/OGR
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:18586


More details on vsipreload and why it would be a good thing to have it inside QGIS


From gdal NEWS:

Add vsipreload.cpp that can be compiled as a shared library that can be LD_PRELOAD'ed as an overload of libc to enable VSI Virtual FILE API to be used with binaries using regular libc for I/O

Many formats (e.g. netcdf) cannot be read inside .zip files without this

basically, it could be implemented this way (at least in linux):

- create a shared lib vsipreload.so and install it with other qgis libs (e.g. /usr/lib/)

this is how it is done inside gdal, should be done in another manner in qgis
g++ -Wall -fPIC port/vsipreload.cpp -shared -o vsipreload.so -Iport -L. -L.libs -lgdal

- modify qgis startup script so that qgis is started like this

LD_PRELOAD=vsipreload.so qgis.bin

I am not sure about licensing issues though, can we copy the port/vsipreload.cpp to qgis source legally? Looks ok to me.

vsipreload-patch.txt Magnifier (1.08 KB) Etienne Tourigny, 2014-05-07 07:09 PM

vsipreload.cpp Magnifier (55.1 KB) Etienne Tourigny, 2014-05-07 07:09 PM

landsat-gz.nc.gz - test file which can only be opened directly in qgis using the vsipreload trick (29.4 KB) Etienne Tourigny, 2014-05-08 04:10 PM


#1 Updated by Etienne Tourigny over 9 years ago

Attaching the vsipreload.cpp code and a patch that allows to build and install it as a shared library.

With this, qgis can be started using the LE_PRELOAD trick. It sould be easy to add this to the debian builds, which already use a startup script.

#2 Updated by Paolo Cavallini over 9 years ago

A pull request is probably better.

#3 Updated by Etienne Tourigny over 9 years ago

#4 Updated by Etienne Tourigny over 9 years ago

added a pull request, this works with debian build


#5 Updated by Alexander Bruy over 7 years ago

  • Category changed from Build/Install to Data Provider/OGR

#6 Updated by Giovanni Manghi over 6 years ago

  • Easy fix? set to No

Also available in: Atom PDF