Commit 2f6bea60 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files

increased version to 1.14


mapcanvas.py: modified context menu
timeseries.py + mapcanvas.py: changed export of layers to QGIS

Signed-off-by: Benjamin Jakimow's avatarBenjamin Jakimow benjamin.jakimow@geo.hu-berlin.de <benjamin.jakimow@geo.hu-berlin.de>
parent c332cf1c
Pipeline #12582 failed
......@@ -21,7 +21,7 @@
# noinspection PyPep8Naming
__version__ = '1.13' # sub-subversion number is added automatically
__version__ = '1.14' # sub-subversion number is added automatically
LICENSE = 'GNU GPL-3'
TITLE = 'EO Time Series Viewer'
LOG_MESSAGE_TAG = TITLE
......
......@@ -1157,7 +1157,9 @@ class MapCanvas(QgsMapCanvas):
ts = eotsv.timeSeries()
action = menu.addAction('Focus on Spatial Extent')
action = menu.addAction('Update date visibility')
action.setToolTip('Updates the visibility of observation dates and source images according its '
'presence of unmasked pixels for this spatial extent')
action.triggered.connect(lambda *args,
ext=self.spatialExtent():
ts.focusVisibilityToExtent(ext=ext))
......@@ -1186,19 +1188,22 @@ class MapCanvas(QgsMapCanvas):
layers = []
for l in mapLayers:
if isinstance(l, SensorProxyLayer):
lyr = QgsRasterLayer(l.source(), l.name(), l.dataProvider().name())
lyr = QgsRasterLayer(l.source(), os.path.basename(l.source()), l.dataProvider().name())
r = l.renderer().clone()
r.setInput(lyr.dataProvider())
lyr.setRenderer(r)
tprop: QgsRasterLayerTemporalProperties = lyr.temporalProperties()
tprop.setMode(QgsRasterLayerTemporalProperties.ModeFixedTemporalRange)
tprop.setIsActive(True)
if isinstance(l.mTSS, TimeSeriesSource):
dtg = QDateTime(l.mTSS.date().astype(object))
dtg = l.mTSS.date().astype(object)
else:
dtg = QDateTime(self.tsd().date().astype(object))
tprop.setFixedTemporalRange(QgsDateTimeRange(dtg, dtg))
dtg = self.tsd().date().astype(object)
dt1 = QDateTime(dtg, QTime(0, 0))
dt2 = QDateTime(dtg, QTime(QTime(23, 59, 59)))
print(f'## LAYER DTG: {dtg}')
tprop.setFixedTemporalRange(QgsDateTimeRange(dt1, dt2))
layers.append(l)
else:
......
......@@ -666,9 +666,12 @@ class TimeSeriesSource(object):
loptions = QgsRasterLayer.LayerOptions(loadDefaultStyle=loadDefaultStyle)
lyr = QgsRasterLayer(self.uri(), self.name(), 'gdal', options=loptions)
tprop: QgsRasterLayerTemporalProperties = lyr.temporalProperties()
tprop.setActive(True)
tprop.setMode(QgsRasterLayerTemporalProperties.ModeFixedTemporalRange)
dtg = QDateTime(self.date().astype(object))
tprop.setFixedTemporalRange(QgsDateTimeRange(dtg, dtg))
dtg = self.date().astype(object)
dt1 = QDateTime(dtg, QTime(0, 0))
dt2 = QDateTime(dtg, QTime(QTime(23, 59, 59)))
tprop.setFixedTemporalRange(QgsDateTimeRange(dt1, dt2))
return lyr
def crsWkt(self) -> str:
......
Supports Markdown
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