[Qgis-user] Unable to open MrSID file in QGIS even if gdalinfo can read it

Even Rouault even.rouault at spatialys.com
Mon Sep 23 05:21:05 PDT 2024


"ldd /path/to/bin/qgis | grep gdal" will show you where the qgis binary 
links GDAL from

To convince an existing QGIS build to run against another libgdal, you 
may (ab)use LD_LIBRARY_PATH, and you probably need to create symlinks so 
that QGIS finds the right libgdal.X.Y that it expects

Safer way is to build your own QGIS using cmake 
-DGDAL_CONFIG:FILEPATH=/path/to/your/bin/gdal-config

Le 23/09/2024 à 13:48, chris hermansen via QGIS-User a écrit :
> Andrew and list,
>
> On Mon, Sep 23, 2024, 00:28 Andrew Plowright via QGIS-User 
> <qgis-user at lists.osgeo.org> wrote:
>
>     I do indeed:
>
>     /usr/bin/gdalinfo
>     /bin/gdalinfo
>
>     I suppose that with the -DCMAKE_INSTALL_PREFIX:PATH=/usr
>     parameter, this means that the version of GDAL that I built was in
>     /usr/bin/gdalinfo?
>
>
> You can confirm positively by running each version using the full path 
> and check which one includes the MrSID driver.
>
>
>     Is there any way to determine where QGIS is looking for GDAL? If
>     that is indeed the problem, is there a way to redirect QGIS
>     towards a different installation of GDAL?
>
>
> Maybe this link can help as it offers solutions to a similar-sounding 
> problem
>
> https://gis.stackexchange.com/questions/258314/handle-two-versions-of-gdal
>
>
>     Thanks!
>
>     On Wed, Sep 18, 2024 at 5:04 PM Richard Greenwood
>     <richard.greenwood at gmail.com> wrote:
>
>         What do you get from
>             which -a gdalinfo
>         You might have two versions installed.
>
>
>         On Wed, Sep 18, 2024, 4:03 PM Andrew Plowright via QGIS-User
>         <qgis-user at lists.osgeo.org> wrote:
>
>             Operating system: Linux Mint 22 Cinnamon
>             QGIS version: 3.34.4-Prizen
>             GDAL version: 3.10.0dev-1250e96221-dirt
>             MrSid DSDK version: 9.5.5.5244
>
>             I have followed the instructions provided by the GDAL
>             website
>             <https://gdal.org/en/latest/drivers/raster/mrsid.html> to
>             build GDAL from source in conjunction with the MrSid DSDK.
>
>             My cmake command was as follows:
>
>             cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr
>             -DGDAL_ENABLE_DRIVER_JP2MRSID=ON -DGDAL_USE_MRSID=ON
>             -DMRSID_ROOT=/opt/MrSID_DSDK-9.5.5.5244-rhel9.x86-64.gcc1131/Raster_DSDK
>             -DMRSID_LIBRARY=/opt/MrSID_DSDK-9.5.5.5244-rhel9.x86-64.gcc1131/Raster_DSDK/lib/libltidsdk.so
>             -DMRSID_INCLUDE_DIR=/opt/MrSID_DSDK-9.5.5.5244-rhel9.x86-64.gcc1131/Raster_DSDK/include
>             ..
>
>             As instructed, I've also set the LD_LIBRARY_PATH variable
>             to point towards the DSDK's /lib/ path by adding the
>             following to me /etc/profile file:
>
>             export
>             LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/MrSID_DSDK-9.5.5.5244-rhel9.x86-64.gcc1131/Raster_DSDK/lib:/usr/lib
>
>             Using the command line, I'm able to use gdalinfo to read a
>             .sid file's information. I even successfully used gdalwarp
>             on it.
>
>             However, QGIS will not accept this file format, returning
>             a "not a valid or recognized data source" error.
>
>             It was my expectation that if MrSid was enabled within
>             GDAL through the command line, then QGIS would be able to
>             read it too. Is there an additional configuration that I'm
>             missing?
>
>             Thank you,
>             Andrew Plowright
>             _______________________________________________
>             QGIS-User mailing list
>             QGIS-User at lists.osgeo.org
>             List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>             Unsubscribe:
>             https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>     _______________________________________________
>     QGIS-User mailing list
>     QGIS-User at lists.osgeo.org
>     List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>     Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240923/1fb9bff2/attachment.htm>


More information about the QGIS-User mailing list