Commit 0fc86760 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files

removed references on obsolete TsvMimeDataUtils

parent bdcbe513
......@@ -23,7 +23,7 @@
import os, sys, fnmatch, site, re, site
VERSION = '0.5.201805141058'
VERSION = '0.5.201805141353'
LICENSE = 'GNU GPL-3'
TITLE = 'EO Time Series Viewer'
DESCRIPTION = 'A QGIS Plugin to visualize multi-sensor remote-sensing time-series data.'
......
......@@ -63,67 +63,6 @@ DEBUG = False
import pyqtgraph as pg
class TsvMimeDataUtils(QObject):
def __init__(self, mimeData):
assert isinstance(mimeData, QMimeData)
super(TsvMimeDataUtils, self).__init__()
self.mimeData = mimeData
self.xmlDoc = QDomDocument()
if self.mimeData.hasText():
self.xmlDoc.setContent(self.mimeData.text())
self.xmlRoot = self.xmlDoc.documentElement()
pass
def hasRasterStyle(self):
if self.xmlRoot.tagName() == 'qgis':
elem = self.xmlRoot.elementsByTagName('rasterrenderer')
return elem.count() != 0
return False
def rasterStyle(self, qgisDataType):
elem = self.xmlRoot.elementsByTagName('rasterrenderer').item(0).toElement()
type = str(elem.attribute('type'))
from qgis.core import QgsContrastEnhancement
def bandSettings(colorName):
band = int(elem.attribute(colorName + 'Band'))
ceNode = elem.elementsByTagName(colorName + 'ContrastEnhancement').item(0)
vMin = float(ceNode.firstChildElement('minValue').firstChild().nodeValue())
vMax = float(ceNode.firstChildElement('maxValue').firstChild().nodeValue())
ceName = ceNode.firstChildElement('algorithm').firstChild().nodeValue()
ceAlg = QgsContrastEnhancement.contrastEnhancementAlgorithmFromString(ceName)
ce = QgsContrastEnhancement(qgisDataType)
ce.setContrastEnhancementAlgorithm(ceAlg)
ce.setMinimumValue(vMin)
ce.setMaximumValue(vMax)
return band, ce
style = None
if type == 'multibandcolor':
A = int(elem.attribute('alphaBand'))
O = int(elem.attribute('opacity'))
R, ceR = bandSettings('red')
G, ceG = bandSettings('green')
B, ceB = bandSettings('blue')
style = QgsMultiBandColorRenderer(None, R, G, B)
style.setRedContrastEnhancement(ceR)
style.setGreenContrastEnhancement(ceG)
style.setBlueContrastEnhancement(ceB)
elif type == 'singlebandgrey':
pass
return style
"""
class QgisTsvBridge(QObject):
#Class to control interactions between TSV and the running QGIS instance
......
......@@ -36,7 +36,6 @@ from timeseriesviewer.utils import *
from timeseriesviewer.timeseries import SensorInstrument, TimeSeriesDatum, TimeSeries
from timeseriesviewer.ui.docks import loadUI
from timeseriesviewer.main import TsvMimeDataUtils
from timeseriesviewer.ui.mapviewscrollarea import MapViewScrollArea
from timeseriesviewer.mapcanvas import MapCanvas
from timeseriesviewer.crosshair import CrosshairStyle
......
......@@ -38,7 +38,6 @@ import sys, re, os, six
from timeseriesviewer import jp, SETTINGS
from timeseriesviewer.utils import loadUI
from timeseriesviewer.main import SpatialExtent, TsvMimeDataUtils
def maxWidgetSizes(layout, onHint=True):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment