diff --git a/gobs/metadata.txt b/gobs/metadata.txt index e542053..c6370b0 100644 --- a/gobs/metadata.txt +++ b/gobs/metadata.txt @@ -1,6 +1,6 @@ [general] name=G-Obs -qgisMinimumVersion=3.16 +qgisMinimumVersion=3.28 description=This plugin provides tools to store and manage spatial and time data in a standardized way # Done by qgis-plugin-ci diff --git a/gobs/processing/algorithms/import_spatial_layer_data.py b/gobs/processing/algorithms/import_spatial_layer_data.py index 8354aa0..ab11c57 100644 --- a/gobs/processing/algorithms/import_spatial_layer_data.py +++ b/gobs/processing/algorithms/import_spatial_layer_data.py @@ -9,6 +9,7 @@ import processing from qgis.core import ( + Qgis, QgsExpressionContextUtils, QgsProcessingException, QgsProcessingOutputString, @@ -286,8 +287,13 @@ def processAlgorithm(self, parameters, context, feedback): # Get vector layer geometry type # And compare it with the spatial_layer type - source_type = QgsWkbTypes.geometryDisplayString(sourcelayer.geometryType()).lower() - source_wtype = QgsWkbTypes.displayString(sourcelayer.wkbType()).lower() + if Qgis.versionInt() < 33400: + source_type = QgsWkbTypes.geometryDisplayString(int(sourcelayer.geometryType())).lower() + source_wtype = QgsWkbTypes.displayString(int(sourcelayer.wkbType())).lower() + else: + source_type = QgsWkbTypes.geometryDisplayString(sourcelayer.geometryType()).lower() + source_wtype = QgsWkbTypes.displayString(sourcelayer.wkbType()).lower() + if not target_type.endswith(source_type): msg = tr('Source vector layer and target spatial layer do not have compatible geometry types') msg+= ' - SOURCE: {}, TARGET: {}'.format(