Skip to content

Commit

Permalink
db manager: fix setting of contrast enhancement for spatialite rasters (
Browse files Browse the repository at this point in the history
fixes #12497)
  • Loading branch information
jef-n committed Apr 4, 2015
1 parent bef4059 commit 8889559
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions python/plugins/db_manager/db_plugins/spatialite/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
except ImportError:
pass



def classFactory():
return SpatiaLiteDBPlugin

Expand Down Expand Up @@ -86,7 +84,6 @@ def __init__(self, connection, uri):
def connectorsFactory(self, uri):
return SpatiaLiteDBConnector(uri)


def dataTablesFactory(self, row, db, schema=None):
return SLTable(row, db, schema)

Expand All @@ -96,7 +93,6 @@ def vectorTablesFactory(self, row, db, schema=None):
def rasterTablesFactory(self, row, db, schema=None):
return SLRasterTable(row, db, schema)


def info(self):
from .info_model import SLDatabaseInfo
return SLDatabaseInfo(self)
Expand Down Expand Up @@ -224,10 +220,10 @@ def mimeUri(self):
return uri

def toMapLayer(self):
from qgis.core import QgsRasterLayer
from qgis.core import QgsRasterLayer, QgsContrastEnhancement
rl = QgsRasterLayer(self.gdalUri(), self.name)
if rl.isValid():
rl.setContrastEnhancementAlgorithm("StretchToMinimumMaximum")
rl.setContrastEnhancement(QgsContrastEnhancement.StretchToMinimumMaximum)
return rl


Expand Down

0 comments on commit 8889559

Please sign in to comment.