sitn / SelvansGeo

Spatial extension of the SELVANS information system - a forest managment application
GNU General Public License v2.0
0 stars 3 forks source link

Migrate to QGIS 3 with Backward compatibility #7

Closed monodo closed 6 years ago

monodo commented 7 years ago

NOT READY FOR MERGING

monodo commented 6 years ago

As ensuring backward compatibility to QGIS 2.18 LTR was not a big job (2h), I decided to add it so that we don't need to keep managing to versions in the future.

Ok for you @romainbh @fredericwyss ?

fredericwyss commented 6 years ago

Ok for me

monodo commented 6 years ago

@fredericwyss @romainbh have you tested this ? Does it look ok to you ?

romainbh commented 6 years ago

It works well on QGIS3, but doesn't load on QGIS2.

Impossible de charger l'extension sgeo_qgis_3 provoque une erreur lors de l'appel de sa méthode classFactory()

ImportError: cannot import name QgsDataSourceUri Traceback (most recent call last): File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 333, in startPlugin plugins[packageName] = package.classFactory(iface) File "C:/Users/blancr/.qgis2/python/plugins\sgeo_qgis_3__init__.py", line 28, in classFactory from .selvansgeo import SelvansGeo File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:/Users/blancr/.qgis2/python/plugins\sgeo_qgis_3\selvansgeo.py", line 44, in from .core.sitndb import SitnDB File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python\qgis\utils.py", line 607, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:/Users/blancr/.qgis2/python/plugins\sgeo_qgis_3\core\sitndb.py", line 5, in from qgis.core import QgsDataSourceUri, QgsVectorLayer ImportError: cannot import name QgsDataSourceUri

Version de Python : 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] Version de QGIS : 2.18.14 Las Palmas, ff83b9a479

Chemin Python : C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing C:/Users/blancr/.qgis2/python/plugins\processinglwgeomprovider C:/Users/blancr/.qgis2/python/plugins\postgis_geoprocessing C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python C:/Users/blancr/.qgis2/python C:/Users/blancr/.qgis2/python/plugins C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins C:\PROGRA~1\QGIS2~1.18\bin\python27.zip C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\plat-win C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\lib-tk C:\PROGRA~1\QGIS2~1.18\bin C:\PROGRA~1\QGIS2~1.18\apps\Python27 C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32 C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32\lib C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Pythonwin C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\wx-2.8-msw-unicode C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg C:/Users/blancr/.qgis2//python C:\Users\blancr.qgis2\python\plugins\SelvansGeo\tools . C:/Users/blancr/.qgis2/python/plugins\NNJoin

monodo commented 6 years ago

You need to have qgis2compat plugin from opengis installed