[QGIS-Developer] OSGeo4W Gdal meta package and Python init

Nyall Dawson nyall.dawson at gmail.com
Mon Jan 7 13:52:59 PST 2019


On Tue, 8 Jan 2019 at 02:59, Axel Andersson
<axel.n.c.andersson at gmail.com> wrote:
>
> If I shall use GDAL functions in QGIS3 what would be the working solution (that works on Windows, Linux and Mac)
>

This is very complex -- if you look at the logic the GDAL Processing
algorithm uses, there's lots of special handling to get it to work
correctly cross platform. My 2c: use processing's GDAL Polygonize
algorithm instead, and let the QGIS team ensure that it works
correctly cross platform ;)

Nyall


> Thanks,
> Axel
>
> On Thu, 27 Sep 2018 at 00:19, Jürgen E. Fischer <jef at norbit.de> wrote:
>>
>> Hi Idan,
>>
>> On Thu, 27. Sep 2018 at 00:53:32 +0300, Idan Miara wrote:
>> > 1. As I'm targeting only Python3 (using python3-gdal-2.2.4-1.tar.bz2), I
>> > was wandering if I need to provide also the Python27 for the gdal-python
>> > scripts (gdal-python-2.2.4-2.tar.bz2) ?
>> > Are they all the gdal-python scripts Python3 compatible? If so, why does
>> > gdal-python-2.2.4-2.tar.bz2 include the Python27 libs/site-packages and not
>> > in a separate file as for Python3?
>>
>> gdal-python is for python2
>> python3-gdal for python3
>>
>> Which is also what you need to install to get the bindings and the required
>> dependencies (except for optional parts a gdal-ecw, gdal-oracle etc.)
>>
>> > I understand it must be possible because somehow starting qgis-bin.exe
>> > works (I guess it has to do with the qgis-bin.env file, but how does it
>> > work?
>>
>> That is actually done by QGIS itself.  QGIS's postinstall runs the qgis*bat
>> with --postinstall argument, which in turn will read the qgis*.vars file, which
>> has a list of environment variables that are required to run qgis and dumps
>> them to the qgis*.env file.  The latter is then used whenever the exe is
>> started directly - for instance to make it pinnable (see src/app/mainwin.cpp).
>>
>> To enable python3 you need to call py3_env.bat.  That will also add the scripts
>> directory of python3 to the path, which has the python3 versions of the gdal
>> scripts.  However the wrapper batch files (eg.  gdal_merge.bat) are only
>> generated in gdal-python and use python2.
>>
>>
>> Jürgen
>>
>> --
>> Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
>> Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
>> Software Engineer           D-26506 Norden             http://www.norbit.de
>> QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list