Skip to content
Permalink
Browse files

More QgsMapLayer python fixes

  • Loading branch information
nyalldawson committed Mar 26, 2019
1 parent ac651ee commit ef8d89339302436dff0000d8cc2226da2cfbf359
@@ -278,7 +278,7 @@ def uniqueIdFunction(self):
return "row_number() over ()"

def toSqlLayer(self, sql, geomCol, uniqueCol, layerName="QueryLayer", layerType=None, avoidSelectById=False, filter=""):
from qgis.core import QgsMapLayer, QgsVectorLayer, QgsRasterLayer
from qgis.core import QgsVectorLayer, QgsRasterLayer

if uniqueCol is None:
if hasattr(self, 'uniqueIdFunction'):
@@ -306,8 +306,6 @@ def _getSqlLayer(self, _filter):
if query.strip().endswith(';'):
query = query.strip()[:-1]

from qgis.core import QgsMapLayer

layerType = QgsMapLayerType.VectorLayer if self.vectorRadio.isChecked() else QgsMapLayerType.RasterLayer

# get a new layer name
@@ -407,8 +407,6 @@ def _getSqlLayer(self, _filter):
if query.strip().endswith(';'):
query = query.strip()[:-1]

from qgis.core import QgsMapLayer

layerType = QgsMapLayerType.VectorLayer if self.vectorRadio.isChecked() else QgsMapLayerType.RasterLayer

# get a new layer name
@@ -44,6 +44,7 @@
QgsWkbTypes,
QgsSettings,
QgsProject,
QgsMapLayer,
QgsMapLayerType,
QgsVectorLayer,
QgsProcessing,

0 comments on commit ef8d893

Please sign in to comment.
You can’t perform that action at this time.