Commit b7fbd6c2 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files

fixed temporal properties for raster layer export to QGIS


Signed-off-by: Benjamin Jakimow's avatarBenjamin Jakimow benjamin.jakimow@geo.hu-berlin.de <benjamin.jakimow@geo.hu-berlin.de>
parent c9e0f768
Pipeline #12590 failed
......@@ -21,7 +21,7 @@
# noinspection PyPep8Naming
__version__ = '1.14' # sub-subversion number is added automatically
__version__ = '1.13' # sub-subversion number is added automatically
LICENSE = 'GNU GPL-3'
TITLE = 'EO Time Series Viewer'
LOG_MESSAGE_TAG = TITLE
......
......@@ -1212,13 +1212,13 @@ class MapCanvas(QgsMapCanvas):
dtg = self.tsd().date().astype(object)
dt1 = QDateTime(dtg, QTime(0, 0))
dt2 = QDateTime(dtg, QTime(QTime(23, 59, 59)))
tprop.setFixedTemporalRange(QgsDateTimeRange(dt1, dt2))
layers.append(l)
range = QgsDateTimeRange(dt1, dt2)
tprop.setFixedTemporalRange(range)
layers.append(lyr)
else:
layers.append(l)
if len(layers) > 0 and isinstance(qgis.utils.iface, QgisInterface):
QgsProject.instance().addMapLayers(layers)
QgsProject.instance().addMapLayers(layers, True)
def onPasteStyleFromClipboard(self, lyr):
from .externals.qps.layerproperties import pasteStyleFromClipboard
......
......@@ -36,7 +36,9 @@ from qgis.core import QgsContrastEnhancement, QgsRasterShader, QgsColorRampShade
QgsRectangle, QgsRasterRenderer, QgsMapLayerStore, QgsMapLayerStyle, \
QgsLayerTreeModel, QgsLayerTreeGroup, \
QgsLayerTree, QgsLayerTreeLayer, \
QgsRasterLayer, QgsVectorLayer, QgsMapLayer, QgsMapLayerProxyModel, QgsColorRamp, QgsSingleBandPseudoColorRenderer
QgsRasterLayer, QgsVectorLayer, QgsMapLayer, QgsMapLayerProxyModel, QgsColorRamp, \
QgsSingleBandPseudoColorRenderer, \
QgsPointXY, QgsReadWriteContext
from qgis.gui import *
from qgis.gui import QgsDockWidget, QgsMapCanvas, QgsMapTool, QgsCollapsibleGroupBox, QgsLayerTreeView, \
......@@ -1739,7 +1741,7 @@ class MapWidget(QFrame):
#mapCanvas.mapTools().mtCursorLocation.sigLocationRequest.disconnect(
# self.sigCurrentLocationChanged)
def onCanvasLocationRequest(self, canvas: QgsMapCanvas, crs: QgsCoordinateReferenceSystem, pt:QgsPointXY):
def onCanvasLocationRequest(self, canvas: QgsMapCanvas, crs: QgsCoordinateReferenceSystem, pt: QgsPointXY):
spt = SpatialPoint(crs, pt)
self.sigCurrentLocationChanged.emit(spt, canvas)
......
......@@ -2465,12 +2465,11 @@ class TimeSeriesTreeView(QTreeView):
self.sigMoveToExtent.emit(extent)
def openInQGIS(self, tssList: typing.List[TimeSeriesSource]):
import qgis.utils
iface = qgis.utils.iface
if isinstance(iface, QgisInterface):
layers = [tss.asRasterLayer() for tss in tssList]
QgsProject.instance().addMapLayers(layers)
QgsProject.instance().addMapLayers(layers, True)
def setClipboardUris(self, tssList: typing.List[TimeSeriesSource]):
urls = []
......
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