[PROJ] Bugs in PROJ_LIB handling?

Even Rouault even.rouault at spatialys.com
Wed Oct 5 14:06:45 PDT 2022


I don't confirm this. Your test case works fine for me with 8.1.0 and a 
few later versions

$ g++ test.cpp -o mytest -I/home/even/install-proj-8.1.0/include 
-L/home/even/install-proj-8.1.0/lib -lproj
$ LD_LIBRARY_PATH=/home/even/install-proj-8.1.0/lib ldd mytest | grep proj
     libproj.so.22 => /home/even/install-proj-8.1.0/lib/libproj.so.22 
(0x00007f6d7f059000)
$ PROJ_LIB=/tmp/foo LD_LIBRARY_PATH=/home/even/install-proj-8.1.0/lib 
./mytest
proj searchpath: /home/even/.local/share/proj:/tmp/foo

Le 05/10/2022 à 22:44, Tom O'Reilly a écrit :
>
> How exactly is $PROJ_LIB intended to alter the PJ_INFO.searchpath? It 
> appears to behave differently between PROJ-7.1.0 and PROJ-8.1.0:
>
>  *
>
>     PROJ-7.1.0 replacesthe last element of PJ_INFO.searchpath with
>     $PROJ_LIB
>
>  *
>
>     PROJ-8.1.0 does not add the contents of $PROJ_LIB environment
>     variable to PJ_INFO.searchpath.
>
>
> (These are the only two PROJ versions I've tested so far)
>
> I determined this behavior from this simple program:
>
>
> #include <iostream>
>
> #include <proj.h>
>
> *
> *
>
> int main(int argc, char **argv) {
>
> *
> *
>
>   PJ_INFO projInfo = proj_info();
>
>   std::cerr << "proj searchpath: " << projInfo.searchpath << std::endl;
>
> *
> *
>
>   return 0;
>
> }
>
> *
> *
>
> PROJ-7.1.0, PROJ_LIB not set:
>
> proj searchpath: /home/oreilly/.local/share/proj:/usr/local/share/proj
>
> *
> *
>
> PROJ-7.1.0, PROJ_LIB=/tmp/mystuff:
>
> proj searchpath: /home/oreilly/.local/share/proj:/tmp/mystuff
>
> *
> *
>
> PROJ-8.1.0, PROJ_LIB not set:
>
> proj searchpath: /home/oreilly/.local/share/proj
>
> *
> *
>
> PROJ-8.1.0, PROJ_LIB=/tmp/mystuff:
>
> proj searchpath: /home/oreilly/.local/share/proj
>
>
> Are there bugs in how PROJ_LIB is handled? What is the intended effect 
> of PROJ_LIB on searchpath?
>
>
> Thanks,
>
> Tom
>
>
> --------------------------------------------------
> Thomas C. O'Reilly
> Monterey Bay Aquarium Research Institute
> 7700 Sandholdt Road
> Moss Landing, California 95039-9644
> 831-775-1766 (voice)
> 831-775-1620 (FAX)
> oreilly at mbari.org (email)
> http://www.mbari.org (World-wide Web)
>
> "The machine does not isolate us from the great mysteries
>  of nature, but plunges us more deeply into them."
>
>    - ANTOINE DE SAINT-EXUPERY
>      "Wind, Sand, and Stars" (1939)
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj

-- 
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/proj/attachments/20221005/be460500/attachment-0001.htm>


More information about the PROJ mailing list