Skip to content
Permalink
Browse files
Homogenize toMapLayer function definition
  • Loading branch information
nicogodet authored and nyalldawson committed Nov 8, 2021
1 parent 0ed6309 commit 9586466d0b0ff51f24afe1ba955a3c5b114d985a
@@ -308,7 +308,7 @@ def mimeUri(self):
uri = u"raster:gdal:%s:%s" % (self.name, self.uri().database())
return uri

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
from qgis.core import QgsRasterLayer, QgsContrastEnhancement

# QGIS has no provider to load rasters, let's use GDAL
@@ -378,7 +378,7 @@ def mimeUri(self):
uri = u"raster:postgresraster:{}:{}".format(self.name, re.sub(":", r"\:", self.uri()))
return uri

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
from qgis.core import QgsRasterLayer, QgsContrastEnhancement, QgsDataSourceUri, QgsCredentials

rl = QgsRasterLayer(self.uri(), self.name, "postgresraster")
@@ -192,7 +192,7 @@ def ogrUri(self):
def mimeUri(self):
return Table.mimeUri(self)

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
from qgis.core import QgsVectorLayer

provider = self.database().dbplugin().providerName()
@@ -278,7 +278,7 @@ def mimeUri(self):
uri = u"raster:gdal:%s:%s" % (self.name, self.uri().database())
return uri

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
from qgis.core import QgsRasterLayer, QgsContrastEnhancement

# QGIS has no provider to load Rasterlite rasters, let's use GDAL
@@ -185,7 +185,7 @@ def refreshTableEstimatedExtent(self):
def runAction(self, action):
return

def toMapLayer(self):
def toMapLayer(self, geometryType=None, crs=None):
return QgsProject.instance().mapLayer(self.geomTableName)


0 comments on commit 9586466

Please sign in to comment.