mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
added abstract temporal class
updates on tests and abstract temporal class updates on qgsabstracttemporal sip and tests update qgsabstracttemporal test updated docs moved qgsabstracttemporal class to qgstemporalrangeobject class as per review suggestions edits per review on qgs map canvas remove access of private members from qgstemporalrangeobject updated render context test and fix travis tests added new temporal property class added tests for temporal property added tests for temporal property added temporal widget ui temporal support in raster layers, from wms provider temporal properties in raster layer properties added abstract temporal class updates on tests and abstract temporal class updates on qgsabstracttemporal sip and tests update qgsabstracttemporal test updated docs temporal support in raster layers, from wms provider update qgsabstracttemporal test updated docs moved qgsabstracttemporal class to qgstemporalrangeobject class as per review suggestions edits per review on qgs map canvas updated render context test and fix travis tests added new temporal property class added new map layer temporal properties sub classes with tests updates on map layers temporal properties classes fix travis tests add read and write xml tests added abstract temporal class updates on tests and abstract temporal class updates on qgsabstracttemporal sip and tests update qgsabstracttemporal test updated docs edits per review on qgs map canvas temporal properties in raster layer properties temporal support in raster layers, from wms provider moved qgsabstracttemporal class to qgstemporalrangeobject class as per review suggestions edits per review on qgs map canvas remove access of private members from qgstemporalrangeobject updated render context test and fix travis tests added new temporal property class added new map layer temporal properties sub classes with tests updated layer times ui added advanced options in layer time constrains ui fix for refreshing wms layer after temporal properties update update on wms-t temporal properties added support for bi-temporal WMS-T
This commit is contained in:
parent
923dabd86a
commit
6352d6889c
115
doc/INSTALL.t2t.tmp
Normal file
115
doc/INSTALL.t2t.tmp
Normal file
@ -0,0 +1,115 @@
|
||||
QGIS
|
||||
Building QGIS from source - step by step
|
||||
2020-02-24
|
||||
|
||||
%! target : html
|
||||
%! style : style.css
|
||||
%! Options : --toc --toc-level 2 --enum-title
|
||||
%! preproc : TUT_URL https://qgis.org
|
||||
%! PostProc(html): '(?i)(<pre>)' '<div class="code">\1'
|
||||
%! PostProc(html): '(?i)(</pre>)' '\1</div>'
|
||||
%! PostProc(html): \(R\) ®
|
||||
% Next line will replace tabs with 2 spaces in txt generated outputs
|
||||
%! PostProc(txt): '(?i)(\t)' ' '
|
||||
%! encoding: utf-8
|
||||
%
|
||||
% Tex processing
|
||||
%
|
||||
% Make sure this is first
|
||||
%! PostProc(tex): '\\includegraphics' '\\includegraphics[width=100mm]'
|
||||
% scartcl is from the koma script document class (apt-get install texlive-latex-recommended ttf-komatuna)
|
||||
% setlength parindent suppresses first line of paragraph idents
|
||||
% parskip puts blank space between paragraphs
|
||||
% title pic stuff used to put a logo on the front page
|
||||
%! PostProc(tex): '\\documentclass{article}' '\\documentclass{scrartcl}\n\\setlength{\\parindent}{0pt}\n\\setlength{\\parskip}{2ex}'
|
||||
% use the color table and table packages so we can pimp the tables a little
|
||||
%! PostProc(tex): '\\usepackage{style.css} % user defined' '\\usepackage{fancyvrb}\n\\usepackage{colortbl} \n\\usepackage [table]{xcolor}\n\\definecolor{tableShade}{HTML}{cecece}\n\\definecolor{qgis-green}{HTML}{0E7300}\n\\usepackage{wallpaper}\n\\LRCornerWallPaper{1}{WALLPAPER-IMAGE}\n\\usepackage{hyperref}\n\\hypersetup{linkcolor=qgis-green,urlcolor=qgis-green}\\renewcommand\\thesection{\\color{qgis-green}\\thechapter\\arabic{section}}'
|
||||
% Make the header row of tables have a dark background. light text
|
||||
%! PostProc(tex): '\\hline \\textbf' '\\hline \\rowcolor[rgb]{0,0,0} \\color{white} \\textbf'
|
||||
%! PostProc(tex): '& \\textbf' '& \\color{white} \\textbf'
|
||||
% Make verbatim text a little smaller and use fancyvrb package to draw it in a box
|
||||
% Note Verbatim with capital V for fancyvrb to work
|
||||
%! PostProc(tex): '\\begin{verbatim}' '{\\scriptsize\\begin{Verbatim}[frame=single,rulecolor=\\color{qgis-green}, framesep=4mm, label=\\fbox{\\small\\emph{Listing}}]'
|
||||
%! PostProc(tex): '\\end{verbatim}' '\\end{Verbatim}\n}'
|
||||
%! PostProc(tex): '\\section' '\\newpage\\section'
|
||||
%! PostProc(tex): 'section{' 'section{\\color{qgis-green}'
|
||||
%! PostProc(tex): NEWPAGE '\\newpage'
|
||||
% Give alternating table rows different colors and use a smaller font in tables (\tiny)
|
||||
%! PostProc(tex): '\\begin{tabular}' '\\rowcolors{2}{tableShade}{white} \n\\tiny\\begin{tabular}'
|
||||
%! encoding: utf-8
|
||||
|
||||
%! PostProc(tex): WALLPAPER-IMAGE 'qgis-footer.png'
|
||||
% These are comments and will not be generated in any output
|
||||
% -------------------
|
||||
|
||||
%This document is in txt2tags format. You can generate html, plain text and
|
||||
%moinmoin formatted documentation by running txt2tags on this document. See the
|
||||
%txt2tags home page for more details. Please insert manual line breaks in this
|
||||
%document as it makes diffing for changes much easier. To do this in vim
|
||||
%automatically, select a section then issue (gq) command. Please don't
|
||||
%apply vim formatting to the whole document as it screws up some formatting
|
||||
%rather apply it selectively to paragraphs where needed.
|
||||
|
||||
% To generate output files from this document:
|
||||
% cmake --build $YOURBUILDDIR --target t2tdoc
|
||||
|
||||
% End of comments
|
||||
% -------------------
|
||||
|
||||
Last Updated: 2020-02-24
|
||||
Last Change : 2020-02-24
|
||||
|
||||
%%toc
|
||||
|
||||
= Introduction =
|
||||
|
||||
This document is the original installation guide of the described software
|
||||
QGIS. The software and hardware descriptions named in this
|
||||
document are in most cases registered trademarks and are therefore subject
|
||||
to the legal requirements. QGIS is subject to the GNU General Public
|
||||
License. Find more information on the QGIS Homepage:
|
||||
http://qgis.org
|
||||
|
||||
The details, that are given in this document have been written and verified
|
||||
to the best of knowledge and responsibility of the editors. Nevertheless,
|
||||
mistakes concerning the content are possible. Therefore, all data are not
|
||||
liable to any duties or guarantees. The editors and publishers do not take
|
||||
any responsibility or liability for failures and their consequences. You are
|
||||
always welcome for indicating possible mistakes.
|
||||
|
||||
Because the code of QGIS evolves from release to release, These instructions are
|
||||
regularly updated to match the corresponding release. Instructions for the current
|
||||
master branch are available at
|
||||
http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/doc/INSTALL.html.
|
||||
If you wish to build another version of QGIS, ensure to checkout the appropriate
|
||||
release branch. The QGIS source code can be found [in the repository https://github.com/qgis/QGIS].
|
||||
|
||||
Please visit http://qgis.org for information on joining our mailing lists
|
||||
and getting involved in the project further.
|
||||
|
||||
/!\ **Note to document writers:** Please use this document as the central
|
||||
place for describing build procedures. Please do not remove this notice.
|
||||
|
||||
/!\ **Note to document writers:** This document is generated from
|
||||
doc/INSTALL.t2t - if you need to edit this document, be sure to edit that
|
||||
file rather than the generated INSTALL document found in the root of the
|
||||
source directory.
|
||||
|
||||
%!include: overview.t2t
|
||||
|
||||
%!include: linux.t2t
|
||||
|
||||
= Building on Windows =
|
||||
%!include: msvc.t2t
|
||||
%!include: msys.t2t
|
||||
%!include: mxe.t2t
|
||||
|
||||
%!include: osx.t2t
|
||||
|
||||
%!include: wcs-test-server.t2t
|
||||
|
||||
%!include: jenkins.t2t
|
||||
|
||||
%!include: debug-tests.t2t
|
||||
|
||||
%!include: iauthors.t2t
|
3260
doc/NEWS.t2t.tmp
Normal file
3260
doc/NEWS.t2t.tmp
Normal file
File diff suppressed because it is too large
Load Diff
@ -114,6 +114,13 @@ Set the data source specification.
|
||||
Gets the data source specification.
|
||||
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
virtual QgsDataProviderTemporalProperties *temporalProperties();
|
||||
%Docstring
|
||||
Returns data provider temporal properties. This may be ``None``, depending on the data provider.
|
||||
|
||||
.. versionadded:: 3.14
|
||||
%End
|
||||
|
||||
virtual QgsRectangle extent() const = 0;
|
||||
|
@ -0,0 +1,42 @@
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/core/qgsdataprovidertemporalproperties.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class QgsDataProviderTemporalProperties : QgsTemporalProperty
|
||||
{
|
||||
%Docstring
|
||||
Class for handling data providers temporal properties.
|
||||
|
||||
.. versionadded:: 3.14
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgsdataprovidertemporalproperties.h"
|
||||
%End
|
||||
public:
|
||||
|
||||
QgsDataProviderTemporalProperties( bool enabled = false );
|
||||
%Docstring
|
||||
Constructor for QgsDataProviderTemporalProperties.
|
||||
%End
|
||||
|
||||
virtual ~QgsDataProviderTemporalProperties();
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/core/qgsdataprovidertemporalproperties.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
@ -36,6 +36,7 @@ Constructor for a label blocking region
|
||||
|
||||
|
||||
class QgsMapSettings : QgsTemporalRangeObject
|
||||
|
||||
{
|
||||
%Docstring
|
||||
The QgsMapSettings class contains configuration for rendering of the map.
|
||||
|
@ -28,6 +28,11 @@ Base class for objects with an associated (optional) temporal range.
|
||||
Constructor QgsTemporalRangeObject.
|
||||
|
||||
The ``enabled`` argument specifies whether the temporal range is initially enabled or not (see isTemporal()).
|
||||
%End
|
||||
|
||||
QgsTemporalRangeObject( const QgsRenderContext &rh );
|
||||
%Docstring
|
||||
Copies render context temporal members
|
||||
%End
|
||||
|
||||
virtual ~QgsTemporalRangeObject();
|
||||
|
@ -0,0 +1,88 @@
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/core/qgstemporalrangeobject.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class QgsTemporalRangeObject
|
||||
{
|
||||
%Docstring
|
||||
Base class for temporal based classes.
|
||||
|
||||
Subclasses may wish to update the abstract temporal functions.
|
||||
|
||||
.. versionadded:: 3.14
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgstemporalrangeobject.h"
|
||||
%End
|
||||
public:
|
||||
|
||||
QgsTemporalRangeObject();
|
||||
%Docstring
|
||||
Constructor for QgsTemporalRangeObject.
|
||||
%End
|
||||
|
||||
QgsTemporalRangeObject( bool enabled );
|
||||
%Docstring
|
||||
Creates temporal range object with the specified temporal state.
|
||||
%End
|
||||
|
||||
QgsTemporalRangeObject( const QgsRenderContext &rh );
|
||||
%Docstring
|
||||
Copies render context temporal members
|
||||
%End
|
||||
|
||||
virtual ~QgsTemporalRangeObject();
|
||||
|
||||
void setIsTemporal( bool enabled );
|
||||
%Docstring
|
||||
Sets object as a temporal based one, which will be considered when rendering maps with a specific time range set.
|
||||
|
||||
.. seealso:: :py:func:`isTemporal`
|
||||
%End
|
||||
|
||||
bool isTemporal() const;
|
||||
%Docstring
|
||||
Returns true if the object is a temporal one, and will be filtered when rendering maps with a specific time range set.
|
||||
|
||||
For map settings, If false is returned, then any other temporal settings relating to the map will be ignored during rendering.
|
||||
|
||||
.. seealso:: :py:func:`setIsTemporal`
|
||||
%End
|
||||
|
||||
void setTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
%Docstring
|
||||
Set datetime range for a temporal object.
|
||||
|
||||
It updates object temporal state to true if it was false.
|
||||
|
||||
When set, can be used to filter and request time base objects.
|
||||
|
||||
.. seealso:: :py:func:`temporalRange`
|
||||
%End
|
||||
|
||||
const QgsDateTimeRange &temporalRange() const;
|
||||
%Docstring
|
||||
Returns datetime range if object is a temporal object.
|
||||
|
||||
.. seealso:: :py:func:`setTemporalRange`
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/core/qgstemporalrangeobject.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
@ -191,6 +191,11 @@ Returns a list of user no data value ranges.
|
||||
%Docstring
|
||||
Returns the sublayers of this layer - useful for providers that manage
|
||||
their own layers, such as WMS
|
||||
%End
|
||||
|
||||
virtual QgsRasterDataProviderTemporalProperties *temporalProperties();
|
||||
%Docstring
|
||||
Returns temporal properties associated with data provider.
|
||||
%End
|
||||
|
||||
virtual bool supportsLegendGraphic() const;
|
||||
|
@ -0,0 +1,128 @@
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/core/raster/qgsrasterdataprovidertemporalproperties.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class QgsRasterDataProviderTemporalProperties : QgsDataProviderTemporalProperties
|
||||
{
|
||||
%Docstring
|
||||
Implementation raster data provider temporal properties.
|
||||
|
||||
.. versionadded:: 3.14
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgsrasterdataprovidertemporalproperties.h"
|
||||
%End
|
||||
public:
|
||||
|
||||
QgsRasterDataProviderTemporalProperties( bool enabled = false );
|
||||
%Docstring
|
||||
Constructor for QgsRasterDataProviderTemporalProperties.
|
||||
%End
|
||||
|
||||
virtual ~QgsRasterDataProviderTemporalProperties();
|
||||
|
||||
|
||||
void setTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
%Docstring
|
||||
Sets the current active datetime range for the temporal properties.
|
||||
|
||||
.. seealso:: :py:func:`temporalRange`
|
||||
%End
|
||||
|
||||
const QgsDateTimeRange &temporalRange() const;
|
||||
%Docstring
|
||||
Returns the current active datetime range for these temporal properties.
|
||||
|
||||
.. seealso:: :py:func:`setTemporalRange`
|
||||
%End
|
||||
|
||||
void setReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
%Docstring
|
||||
Sets the current active reference datetime range for the temporal properties.
|
||||
|
||||
This will be used by bi-temporal dimensional data providers.
|
||||
|
||||
.. seealso:: :py:func:`referenceTemporalRange`
|
||||
%End
|
||||
|
||||
const QgsDateTimeRange &referenceTemporalRange() const;
|
||||
%Docstring
|
||||
Returns the current active reference datetime range for these temporal properties.
|
||||
|
||||
.. seealso:: :py:func:`setReferenceTemporalRange`
|
||||
%End
|
||||
|
||||
void setFixedTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
%Docstring
|
||||
Sets the fixed datetime range for the temporal properties.
|
||||
|
||||
.. seealso:: :py:func:`fixedTemporalRange`
|
||||
%End
|
||||
|
||||
const QgsDateTimeRange &fixedTemporalRange() const;
|
||||
%Docstring
|
||||
Returns the fixed datetime range for these temporal properties.
|
||||
|
||||
.. seealso:: :py:func:`setFixedTemporalRange`
|
||||
%End
|
||||
|
||||
void setFixedReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
%Docstring
|
||||
Sets the fixed reference datetime range for the temporal properties.
|
||||
|
||||
.. seealso:: :py:func:`fixedReferenceTemporalRange`
|
||||
%End
|
||||
|
||||
const QgsDateTimeRange &fixedReferenceTemporalRange() const;
|
||||
%Docstring
|
||||
Returns the fixed reference datetime range for these temporal properties.
|
||||
|
||||
.. seealso:: :py:func:`setFixedReferenceTemporalRange`
|
||||
%End
|
||||
|
||||
void setEnableTime( bool enabled );
|
||||
%Docstring
|
||||
Sets the time enabled status.
|
||||
|
||||
.. seealso:: :py:func:`isTimeEnabled`
|
||||
%End
|
||||
|
||||
bool isTimeEnabled() const;
|
||||
%Docstring
|
||||
Returns the temporal property status.
|
||||
|
||||
.. seealso:: :py:func:`setEnableTime`
|
||||
%End
|
||||
|
||||
void setHasReference( bool enabled );
|
||||
%Docstring
|
||||
Sets the reference range status.
|
||||
|
||||
.. seealso:: :py:func:`hasReference`
|
||||
%End
|
||||
|
||||
bool hasReference() const;
|
||||
%Docstring
|
||||
Returns the reference range presence status.
|
||||
|
||||
.. seealso:: :py:func:`setHasReference`
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/core/raster/qgsrasterdataprovidertemporalproperties.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
@ -41,6 +41,7 @@
|
||||
%Include auto_generated/qgsdataitemprovider.sip
|
||||
%Include auto_generated/qgsdataitemproviderregistry.sip
|
||||
%Include auto_generated/qgsdataprovider.sip
|
||||
%Include auto_generated/qgsdataprovidertemporalproperties.sip
|
||||
%Include auto_generated/qgsdatasourceuri.sip
|
||||
%Include auto_generated/qgsdatetimestatisticalsummary.sip
|
||||
%Include auto_generated/qgsdatumtransform.sip
|
||||
@ -447,6 +448,7 @@
|
||||
%Include auto_generated/raster/qgsrasterblock.sip
|
||||
%Include auto_generated/raster/qgsrasterchecker.sip
|
||||
%Include auto_generated/raster/qgsrasterdataprovider.sip
|
||||
%Include auto_generated/raster/qgsrasterdataprovidertemporalproperties.sip
|
||||
%Include auto_generated/raster/qgsrasterdrawer.sip
|
||||
%Include auto_generated/raster/qgsrasterfilewriter.sip
|
||||
%Include auto_generated/raster/qgsrasterfilewritertask.sip
|
||||
|
@ -1048,6 +1048,11 @@ start of the pan and the current pan position.
|
||||
Emitted whenever a tap and hold ``gesture`` occurs at the specified map point.
|
||||
|
||||
.. versionadded:: 3.12
|
||||
void temporalRangeChanged();
|
||||
%Docstring
|
||||
Emitted when the map canvas temporal range changes.
|
||||
|
||||
.. versionadded:: 3.14
|
||||
%End
|
||||
|
||||
void temporalRangeChanged();
|
||||
|
@ -232,6 +232,7 @@ SET(QGIS_CORE_SRCS
|
||||
qgsdataitemproviderregistry.cpp
|
||||
qgsdatasourceuri.cpp
|
||||
qgsdataprovider.cpp
|
||||
qgsdataprovidertemporalproperties.cpp
|
||||
qgsdatetimestatisticalsummary.cpp
|
||||
qgsdatumtransform.cpp
|
||||
qgsdbfilterproxymodel.cpp
|
||||
@ -407,6 +408,7 @@ SET(QGIS_CORE_SRCS
|
||||
qgsvectorlayerjoinbuffer.cpp
|
||||
qgsvectorlayerjoininfo.cpp
|
||||
qgsvectorlayerrenderer.cpp
|
||||
qgsvectorlayertemporalproperties.cpp
|
||||
qgsvectorlayertools.cpp
|
||||
qgsvectorlayerundocommand.cpp
|
||||
qgsvectorlayerundopassthroughcommand.cpp
|
||||
@ -508,6 +510,7 @@ SET(QGIS_CORE_SRCS
|
||||
raster/qgsrasterblock.cpp
|
||||
raster/qgsrasterchecker.cpp
|
||||
raster/qgsrasterdataprovider.cpp
|
||||
raster/qgsrasterdataprovidertemporalproperties.cpp
|
||||
raster/qgsrasterfilewritertask.cpp
|
||||
raster/qgsrasteridentifyresult.cpp
|
||||
raster/qgsrasterinterface.cpp
|
||||
@ -727,6 +730,7 @@ SET(QGIS_CORE_HDRS
|
||||
qgsdataitemprovider.h
|
||||
qgsdataitemproviderregistry.h
|
||||
qgsdataprovider.h
|
||||
qgsdataprovidertemporalproperties.h
|
||||
qgsdatasourceuri.h
|
||||
qgsdatetimestatisticalsummary.h
|
||||
qgsdatumtransform.h
|
||||
@ -926,6 +930,7 @@ SET(QGIS_CORE_HDRS
|
||||
qgsvectorlayerjoininfo.h
|
||||
qgsvectorlayerrenderer.h
|
||||
qgsvectorlayerserverproperties.h
|
||||
qgsvectorlayertemporalproperties.h
|
||||
qgsvectorlayertools.h
|
||||
qgsvectorlayerundocommand.h
|
||||
qgsvectorlayerundopassthroughcommand.h
|
||||
@ -1216,6 +1221,7 @@ SET(QGIS_CORE_HDRS
|
||||
raster/qgsrasterblock.h
|
||||
raster/qgsrasterchecker.h
|
||||
raster/qgsrasterdataprovider.h
|
||||
raster/qgsrasterdataprovidertemporalproperties.h
|
||||
raster/qgsrasterdrawer.h
|
||||
raster/qgsrasterfilewriter.h
|
||||
raster/qgsrasterfilewritertask.h
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "qgscoordinatetransformcontext.h"
|
||||
#include "qgslayermetadata.h"
|
||||
#include "qgserror.h"
|
||||
#include "qgsdataprovidertemporalproperties.h"
|
||||
|
||||
class QgsRectangle;
|
||||
class QgsCoordinateReferenceSystem;
|
||||
@ -171,6 +172,13 @@ class CORE_EXPORT QgsDataProvider : public QObject
|
||||
return QgsDataSourceUri( mDataSourceURI );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns data provider temporal properties. This may be NULLPTR, depending on the data provider.
|
||||
*
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
virtual QgsDataProviderTemporalProperties *temporalProperties() { return nullptr; }
|
||||
|
||||
/**
|
||||
* Returns the extent of the layer
|
||||
* \returns QgsRectangle containing the extent of the layer
|
||||
|
24
src/core/qgsdataprovidertemporalproperties.cpp
Normal file
24
src/core/qgsdataprovidertemporalproperties.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/***************************************************************************
|
||||
qgsdataprovidertemporalproperties.cpp
|
||||
---------------
|
||||
begin : February 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsdataprovidertemporalproperties.h"
|
||||
|
||||
QgsDataProviderTemporalProperties::QgsDataProviderTemporalProperties( bool enabled )
|
||||
: QgsTemporalProperty( enabled )
|
||||
{
|
||||
}
|
||||
|
48
src/core/qgsdataprovidertemporalproperties.h
Normal file
48
src/core/qgsdataprovidertemporalproperties.h
Normal file
@ -0,0 +1,48 @@
|
||||
/***************************************************************************
|
||||
qgsdataprovidertemporalproperties.h
|
||||
---------------
|
||||
begin : February 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef QGSDATAPROVIDERTEMPORALPROPERTIES_H
|
||||
#define QGSDATAPROVIDERTEMPORALPROPERTIES_H
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgstemporalproperty.h"
|
||||
|
||||
#include <QDomElement>
|
||||
|
||||
/**
|
||||
* \class QgsDataProviderTemporalProperties
|
||||
* \ingroup core
|
||||
* Class for handling data providers temporal properties.
|
||||
*
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
|
||||
class CORE_EXPORT QgsDataProviderTemporalProperties : public QgsTemporalProperty
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for QgsDataProviderTemporalProperties.
|
||||
*/
|
||||
QgsDataProviderTemporalProperties( bool enabled = false );
|
||||
|
||||
virtual ~QgsDataProviderTemporalProperties() = default;
|
||||
};
|
||||
|
||||
#endif // QGSDATAPROVIDERTEMPORALPROPERTIES_H
|
@ -1871,6 +1871,7 @@ bool QgsMapLayer::accept( QgsStyleEntityVisitorInterface * ) const
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void QgsMapLayer::setProviderType( const QString &providerType )
|
||||
{
|
||||
mProviderKey = providerType;
|
||||
|
@ -32,7 +32,11 @@
|
||||
#include "qgsexpressioncontext.h"
|
||||
#include "qgsmaplayer.h"
|
||||
#include "qgsgeometry.h"
|
||||
<<<<<<< HEAD
|
||||
#include "qgstemporalrangeobject.h"
|
||||
=======
|
||||
#include "temporal/qgsabstracttemporal.h"
|
||||
>>>>>>> de9992479d... updates on tests and abstract temporal class
|
||||
|
||||
class QPainter;
|
||||
|
||||
@ -83,7 +87,11 @@ class CORE_EXPORT QgsLabelBlockingRegion
|
||||
*
|
||||
* \since QGIS 2.4
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
class CORE_EXPORT QgsMapSettings : public QgsTemporalRangeObject
|
||||
=======
|
||||
class CORE_EXPORT QgsMapSettings : public QgsAbstractTemporal
|
||||
>>>>>>> de9992479d... updates on tests and abstract temporal class
|
||||
{
|
||||
public:
|
||||
QgsMapSettings();
|
||||
|
@ -34,7 +34,11 @@
|
||||
#include "qgscoordinatetransformcontext.h"
|
||||
#include "qgspathresolver.h"
|
||||
#include "qgssymbollayerreference.h"
|
||||
<<<<<<< HEAD
|
||||
#include "qgstemporalrangeobject.h"
|
||||
=======
|
||||
#include "temporal/qgsabstracttemporal.h"
|
||||
>>>>>>> de9992479d... updates on tests and abstract temporal class
|
||||
|
||||
class QPainter;
|
||||
class QgsAbstractGeometry;
|
||||
@ -53,7 +57,11 @@ class QgsMaskIdProvider;
|
||||
* the conversion ratio between screen and map units, the extents
|
||||
* to be rendered etc.
|
||||
**/
|
||||
<<<<<<< HEAD
|
||||
class CORE_EXPORT QgsRenderContext : public QgsTemporalRangeObject
|
||||
=======
|
||||
class CORE_EXPORT QgsRenderContext : public QgsAbstractTemporal
|
||||
>>>>>>> de9992479d... updates on tests and abstract temporal class
|
||||
{
|
||||
public:
|
||||
QgsRenderContext();
|
||||
|
@ -19,10 +19,87 @@
|
||||
#include "qgstemporalproperty.h"
|
||||
|
||||
QgsTemporalProperty::QgsTemporalProperty( bool enabled )
|
||||
: mActive( enabled )
|
||||
: mActive( enabled )
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalProperty::QgsTemporalProperty( const QgsDateTimeRange dateTimeRange, bool enabled )
|
||||
: mDateTimeRange( dateTimeRange )
|
||||
, mActive( enabled )
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalProperty::QgsTemporalProperty( const QDateTime dateTime, bool enabled )
|
||||
: mDateTime( dateTime )
|
||||
, mActive( enabled )
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalProperty::QgsTemporalProperty( const QDate date, bool enabled )
|
||||
: mDate( date )
|
||||
, mActive( enabled )
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalProperty::QgsTemporalProperty( const QString date, bool enabled )
|
||||
:mActive ( enabled )
|
||||
{
|
||||
// parseDate( date );
|
||||
}
|
||||
|
||||
QgsTemporalProperty::QgsTemporalProperty( const QgsTemporalProperty &temporalProperty )
|
||||
{
|
||||
mDateTimeRange = temporalProperty.mDateTimeRange;
|
||||
mDateTime = temporalProperty.mDateTime;
|
||||
mDate = temporalProperty.mDate;
|
||||
}
|
||||
|
||||
bool QgsTemporalProperty::equal(const QgsTemporalProperty &otherTemporalProperty ) const
|
||||
{
|
||||
return mDateTimeRange == otherTemporalProperty.mDateTimeRange
|
||||
&& mDateTime == otherTemporalProperty.mDateTime
|
||||
&& mDate == otherTemporalProperty.mDate;
|
||||
}
|
||||
|
||||
void QgsTemporalProperty::setTemporalRange( const QgsDateTimeRange &dateTimeRange )
|
||||
{
|
||||
if ( dateTimeRange == mDateTimeRange )
|
||||
return;
|
||||
|
||||
mDateTimeRange = dateTimeRange;
|
||||
}
|
||||
|
||||
const QgsDateTimeRange &QgsTemporalProperty::temporalRange() const
|
||||
{
|
||||
return mDateTimeRange;
|
||||
}
|
||||
|
||||
void QgsTemporalProperty::setTemporalDateTimeInstant( const QDateTime &dateTime )
|
||||
{
|
||||
if ( dateTime == mDateTime )
|
||||
return;
|
||||
|
||||
mDateTime = dateTime;
|
||||
}
|
||||
|
||||
const QDateTime &QgsTemporalProperty::temporalDateTimeInstant() const
|
||||
{
|
||||
return mDateTime;
|
||||
}
|
||||
|
||||
void QgsTemporalProperty::setTemporalDateInstant( const QDate &date )
|
||||
{
|
||||
if ( date == mDate )
|
||||
return;
|
||||
|
||||
mDate = date;
|
||||
}
|
||||
|
||||
const QDate &QgsTemporalProperty::temporalDateInstant() const
|
||||
{
|
||||
return mDate;
|
||||
}
|
||||
|
||||
void QgsTemporalProperty::setIsActive( bool enabled )
|
||||
{
|
||||
mActive = enabled;
|
||||
@ -33,3 +110,13 @@ bool QgsTemporalProperty::isActive() const
|
||||
return mActive;
|
||||
}
|
||||
|
||||
void parseDate()
|
||||
{
|
||||
// For single value
|
||||
|
||||
// QDateTime dateTime = QDateTime::fromString( date, "YYYY-MM-DDTHH:MM:SS");
|
||||
|
||||
// For list values
|
||||
|
||||
// For interval values
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgsrange.h"
|
||||
|
||||
|
||||
/**
|
||||
@ -37,29 +38,130 @@ class CORE_EXPORT QgsTemporalProperty
|
||||
|
||||
/**
|
||||
* Constructor for QgsTemporalProperty.
|
||||
*
|
||||
* The \a active argument specifies whether the property is initially active (see isActive()).
|
||||
*/
|
||||
QgsTemporalProperty( bool active = false );
|
||||
QgsTemporalProperty( bool enabled = true );
|
||||
|
||||
/**
|
||||
* Creates temporal property with the specified temporal state.
|
||||
*/
|
||||
QgsTemporalProperty( const QgsDateTimeRange dateTimeRange, bool enabled = true );
|
||||
|
||||
/**
|
||||
* Initialize the temporal property with datetime instant.
|
||||
*/
|
||||
QgsTemporalProperty( const QDateTime dateTime, bool enabled = true );
|
||||
|
||||
/**
|
||||
* Initialize the temporal property with date instant.
|
||||
*/
|
||||
QgsTemporalProperty( const QDate date, bool enabled = true );
|
||||
|
||||
/**
|
||||
* Initialize temporal property with ISO 8601 date string
|
||||
*
|
||||
* This will support initializing WMS-T layers with right temporal property range
|
||||
*
|
||||
*
|
||||
*/
|
||||
QgsTemporalProperty( const QString date, bool enabled = true );
|
||||
|
||||
virtual ~QgsTemporalProperty() = default;
|
||||
|
||||
/**
|
||||
* Sets whether the temporal property is \a active.
|
||||
* Compare temporal property objects
|
||||
*/
|
||||
bool equal(const QgsTemporalProperty &temporalProperty ) const;
|
||||
|
||||
/**
|
||||
* Set datetime range for the temporal property.
|
||||
*
|
||||
* \see temporalRange()
|
||||
*/
|
||||
void setTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
|
||||
/**
|
||||
* Returns datetime range for the temporal property.
|
||||
*
|
||||
* \see setTemporalRange()
|
||||
*/
|
||||
const QgsDateTimeRange &temporalRange() const;
|
||||
|
||||
/**
|
||||
* Set datetime for the temporal property.
|
||||
*
|
||||
* \see temporalDateTimeInstant()
|
||||
*/
|
||||
void setTemporalDateTimeInstant( const QDateTime &dateTime );
|
||||
|
||||
/**
|
||||
* Returns datetime instant for the temporal property.
|
||||
*
|
||||
* \see setTemporalDateTimeInstant()
|
||||
*/
|
||||
const QDateTime& temporalDateTimeInstant() const;
|
||||
|
||||
/**
|
||||
* Set date for the temporal property.
|
||||
*
|
||||
* \see temporalDateInstant()
|
||||
*/
|
||||
void setTemporalDateInstant( const QDate &date );
|
||||
|
||||
/**
|
||||
* Returns date instant for the temporal property.
|
||||
*
|
||||
* \see setTemporalDateInstant()
|
||||
*/
|
||||
const QDate& temporalDateInstant() const;
|
||||
|
||||
/**
|
||||
* Sets temporal property status.
|
||||
*
|
||||
* \see isActive()
|
||||
*/
|
||||
void setIsActive( bool active );
|
||||
void setIsActive( bool enabled );
|
||||
|
||||
/**
|
||||
* Returns TRUE if the temporal property is active.
|
||||
* Returns true temporal property status.
|
||||
* \see setIsActive()
|
||||
*/
|
||||
bool isActive() const;
|
||||
|
||||
/**
|
||||
* Sets temporal property status.
|
||||
*
|
||||
* \see isActive()
|
||||
*/
|
||||
void setIsActive( bool enabled );
|
||||
|
||||
/**
|
||||
* Returns true temporal property status.
|
||||
* \see setIsActive()
|
||||
*/
|
||||
bool isActive() const;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Parse the given string date into one of either date instant or range.
|
||||
*
|
||||
*/
|
||||
void parseDate( QString date );
|
||||
|
||||
|
||||
//! \brief Represents datetime range member.
|
||||
QgsDateTimeRange mDateTimeRange;
|
||||
|
||||
//! \brief Datetime instant
|
||||
QDateTime mDateTime;
|
||||
|
||||
//! \brief Date instant
|
||||
QDate mDate;
|
||||
|
||||
//! \brief Stores temporal status
|
||||
bool mActive = false;
|
||||
|
||||
//! \brief Stores temporal status
|
||||
bool mActive = false;
|
||||
|
||||
};
|
||||
|
@ -22,6 +22,12 @@ QgsTemporalRangeObject::QgsTemporalRangeObject( bool enabled )
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalRangeObject::QgsTemporalRangeObject( const QgsRenderContext &rh )
|
||||
: mTemporal( rh.isTemporal() )
|
||||
, mDateTimeRange( rh.temporalRange() )
|
||||
{
|
||||
}
|
||||
|
||||
void QgsTemporalRangeObject::setIsTemporal( bool enabled )
|
||||
{
|
||||
mTemporal = enabled;
|
||||
|
60
src/core/qgstemporalrangeobject.cpp~HEAD
Normal file
60
src/core/qgstemporalrangeobject.cpp~HEAD
Normal file
@ -0,0 +1,60 @@
|
||||
/***************************************************************************
|
||||
qgstemporalrangeobject.cpp
|
||||
---------------
|
||||
begin : January 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "qgstemporalrangeobject.h"
|
||||
#include "qgsrendercontext.h"
|
||||
|
||||
QgsTemporalRangeObject::QgsTemporalRangeObject()
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalRangeObject::QgsTemporalRangeObject( bool enabled )
|
||||
: mTemporal( enabled )
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalRangeObject::QgsTemporalRangeObject( const QgsRenderContext &rh )
|
||||
: mTemporal( rh.isTemporal() )
|
||||
, mDateTimeRange( rh.temporalRange() )
|
||||
{
|
||||
}
|
||||
|
||||
void QgsTemporalRangeObject::setIsTemporal( bool enabled )
|
||||
{
|
||||
mTemporal = enabled;
|
||||
}
|
||||
|
||||
bool QgsTemporalRangeObject::isTemporal() const
|
||||
{
|
||||
return mTemporal;
|
||||
}
|
||||
|
||||
void QgsTemporalRangeObject::setTemporalRange( const QgsDateTimeRange &dateTimeRange )
|
||||
{
|
||||
if ( !isTemporal() )
|
||||
setIsTemporal( true );
|
||||
|
||||
mDateTimeRange = dateTimeRange;
|
||||
|
||||
}
|
||||
|
||||
const QgsDateTimeRange &QgsTemporalRangeObject::temporalRange() const
|
||||
{
|
||||
return mDateTimeRange;
|
||||
}
|
||||
|
63
src/core/qgstemporalrangeobject.cpp~HEAD~HEAD
Normal file
63
src/core/qgstemporalrangeobject.cpp~HEAD~HEAD
Normal file
@ -0,0 +1,63 @@
|
||||
/***************************************************************************
|
||||
qgstemporalrangeobject.cpp
|
||||
---------------
|
||||
begin : January 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "qgstemporalrangeobject.h"
|
||||
#include "qgsrendercontext.h"
|
||||
|
||||
QgsTemporalRangeObject::QgsTemporalRangeObject()
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalRangeObject::QgsTemporalRangeObject( bool enabled )
|
||||
: mTemporal( enabled )
|
||||
{
|
||||
}
|
||||
|
||||
QgsTemporalRangeObject::QgsTemporalRangeObject( const QgsRenderContext &rh )
|
||||
: mTemporal( rh.isTemporal() )
|
||||
, mDateTimeRange( rh.temporalRange() )
|
||||
{
|
||||
}
|
||||
|
||||
void QgsTemporalRangeObject::setIsTemporal( bool enabled )
|
||||
{
|
||||
mTemporal = enabled;
|
||||
}
|
||||
|
||||
bool QgsTemporalRangeObject::isTemporal() const
|
||||
{
|
||||
return mTemporal;
|
||||
}
|
||||
|
||||
void QgsTemporalRangeObject::setTemporalRange( const QgsDateTimeRange &dateTimeRange )
|
||||
{
|
||||
if ( dateTimeRange == mDateTimeRange )
|
||||
return;
|
||||
|
||||
if ( !isTemporal() )
|
||||
setIsTemporal( true );
|
||||
|
||||
mDateTimeRange = dateTimeRange;
|
||||
|
||||
}
|
||||
|
||||
const QgsDateTimeRange &QgsTemporalRangeObject::temporalRange() const
|
||||
{
|
||||
return mDateTimeRange;
|
||||
}
|
||||
|
@ -41,6 +41,11 @@ class CORE_EXPORT QgsTemporalRangeObject
|
||||
*/
|
||||
QgsTemporalRangeObject( bool enabled = false );
|
||||
|
||||
/**
|
||||
* Copies render context temporal members
|
||||
*/
|
||||
QgsTemporalRangeObject( const QgsRenderContext &rh );
|
||||
|
||||
virtual ~QgsTemporalRangeObject() = default;
|
||||
|
||||
/**
|
||||
|
102
src/core/qgstemporalrangeobject.h~HEAD
Normal file
102
src/core/qgstemporalrangeobject.h~HEAD
Normal file
@ -0,0 +1,102 @@
|
||||
/***************************************************************************
|
||||
qgstemporalrangeobject.h
|
||||
---------------
|
||||
begin : January 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef QGSTEMPORALRANGEOBJECT_H
|
||||
#define QGSTEMPORALRANGEOBJECT_H
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgsrange.h"
|
||||
|
||||
class QgsRenderContext;
|
||||
|
||||
/**
|
||||
* \class QgsTemporalRangeObject
|
||||
* \ingroup core
|
||||
* Base class for temporal based classes.
|
||||
*
|
||||
* Subclasses may wish to update the abstract temporal functions.
|
||||
*
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
class CORE_EXPORT QgsTemporalRangeObject
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for QgsTemporalRangeObject.
|
||||
*/
|
||||
QgsTemporalRangeObject();
|
||||
|
||||
/**
|
||||
* Creates temporal range object with the specified temporal state.
|
||||
*/
|
||||
QgsTemporalRangeObject( bool enabled );
|
||||
|
||||
/**
|
||||
* Copies render context temporal members
|
||||
*/
|
||||
QgsTemporalRangeObject( const QgsRenderContext &rh );
|
||||
|
||||
virtual ~QgsTemporalRangeObject() = default;
|
||||
|
||||
/**
|
||||
* Sets object as a temporal based one, which will be considered when rendering maps with a specific time range set.
|
||||
*
|
||||
* \see isTemporal()
|
||||
*/
|
||||
void setIsTemporal( bool enabled );
|
||||
|
||||
/**
|
||||
* Returns true if the object is a temporal one, and will be filtered when rendering maps with a specific time range set.
|
||||
*
|
||||
* For map settings, If false is returned, then any other temporal settings relating to the map will be ignored during rendering.
|
||||
*
|
||||
* \see setIsTemporal()
|
||||
*/
|
||||
bool isTemporal() const;
|
||||
|
||||
/**
|
||||
* Set datetime range for a temporal object.
|
||||
*
|
||||
* It updates object temporal state to true if it was false.
|
||||
*
|
||||
* When set, can be used to filter and request time base objects.
|
||||
*
|
||||
* \see temporalRange()
|
||||
*/
|
||||
void setTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
|
||||
/**
|
||||
* Returns datetime range if object is a temporal object.
|
||||
*
|
||||
* \see setTemporalRange()
|
||||
*/
|
||||
const QgsDateTimeRange &temporalRange() const;
|
||||
|
||||
private:
|
||||
|
||||
//! Temporal state
|
||||
bool mTemporal = false;
|
||||
|
||||
//! Represents datetime range member.
|
||||
QgsDateTimeRange mDateTimeRange;
|
||||
|
||||
};
|
||||
|
||||
#endif // QGSTEMPORALRANGEOBJECT_H
|
62
src/core/qgsvectorlayertemporalproperties.cpp
Normal file
62
src/core/qgsvectorlayertemporalproperties.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
/***************************************************************************
|
||||
qgsvectorlayertemporalproperties.cpp
|
||||
---------------
|
||||
begin : February 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsvectorlayertemporalproperties.h"
|
||||
|
||||
QgsVectorLayerTemporalProperties::QgsVectorLayerTemporalProperties( bool enabled )
|
||||
: QgsMapLayerTemporalProperties( enabled )
|
||||
{
|
||||
}
|
||||
|
||||
QgsVectorLayerTemporalProperties::TemporalMode QgsVectorLayerTemporalProperties::mode() const
|
||||
{
|
||||
return mMode;
|
||||
}
|
||||
|
||||
void QgsVectorLayerTemporalProperties::setMode( QgsVectorLayerTemporalProperties::TemporalMode mode )
|
||||
{
|
||||
if ( mMode == mode )
|
||||
return;
|
||||
mMode = mode;
|
||||
}
|
||||
|
||||
void QgsVectorLayerTemporalProperties::setFixedTemporalRange( const QgsDateTimeRange &range )
|
||||
{
|
||||
if ( range == mRange )
|
||||
return;
|
||||
|
||||
mRange = range;
|
||||
}
|
||||
|
||||
const QgsDateTimeRange &QgsVectorLayerTemporalProperties::fixedTemporalRange() const
|
||||
{
|
||||
return mRange;
|
||||
}
|
||||
|
||||
void QgsVectorLayerTemporalProperties::setStartTimeField( const QString &field )
|
||||
{
|
||||
if ( field == mStartTimeField )
|
||||
return;
|
||||
|
||||
mStartTimeField = field;
|
||||
}
|
||||
|
||||
QString QgsVectorLayerTemporalProperties::startTimeField() const
|
||||
{
|
||||
return mStartTimeField;
|
||||
}
|
||||
|
125
src/core/qgsvectorlayertemporalproperties.h
Normal file
125
src/core/qgsvectorlayertemporalproperties.h
Normal file
@ -0,0 +1,125 @@
|
||||
/***************************************************************************
|
||||
qgsvectorlayertemporalproperties.h
|
||||
---------------
|
||||
begin : February 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSVECTORLAYERTEMPORALPROPERTIES_H
|
||||
#define QGSVECTORLAYERTEMPORALPROPERTIES_H
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgsrange.h"
|
||||
#include "qgsmaplayertemporalproperties.h"
|
||||
|
||||
/**
|
||||
* \class QgsVectorLayerTemporalProperties
|
||||
* \ingroup core
|
||||
* Implementation of map layer temporal properties for vector layers.
|
||||
*
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
|
||||
class CORE_EXPORT QgsVectorLayerTemporalProperties : public QgsMapLayerTemporalProperties
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for QgsVectorLayerTemporalProperties.
|
||||
*/
|
||||
QgsVectorLayerTemporalProperties( bool enabled = false );
|
||||
|
||||
virtual ~QgsVectorLayerTemporalProperties() = default;
|
||||
|
||||
enum TemporalMode
|
||||
{
|
||||
ModeFixedTemporalRange,
|
||||
ModeTemporalRangeFromDateTimeFields,
|
||||
ModeTemporalRangeFromExpressions,
|
||||
ModeTemporalRangeFromFixedReferenceTimeAndOffsetField
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the temporal properties mode
|
||||
*
|
||||
*\see setMode()
|
||||
**/
|
||||
TemporalMode mode() const;
|
||||
|
||||
/**
|
||||
* Set the temporal properties mode
|
||||
*
|
||||
*\see mode()
|
||||
**/
|
||||
void setMode( TemporalMode mode );
|
||||
|
||||
/**
|
||||
* Sets the temporal \a range to apply to the whole layer. Allfeatures from
|
||||
* the layer will be rendered whenever the current datetime range of
|
||||
* a render context intersects the specified \a range.
|
||||
*
|
||||
* \warning This setting is only effective when mode() is
|
||||
* QgsVectorLayerTemporalProperties::ModeFixedTemporalRange
|
||||
*
|
||||
* \see fixedTemporalRange()
|
||||
*/
|
||||
void setFixedTemporalRange( const QgsDateTimeRange &range );
|
||||
|
||||
/**
|
||||
* Return fixed temporal range for these properties
|
||||
*
|
||||
* \warning To be used only when mode() is
|
||||
* QgsVectorLayerTemporalProperties::ModeFixedTemporalRange
|
||||
*
|
||||
*\see setFixedTemporalRange()
|
||||
**/
|
||||
const QgsDateTimeRange &fixedTemporalRange() const;
|
||||
|
||||
/**
|
||||
* Sets the start date \a field. Features will only be rendered if
|
||||
* their datetime value contained in this field is earlier than
|
||||
* the current datetime range of the render context.
|
||||
*
|
||||
* \warning This setting is only effective when mode() is
|
||||
* QgsVectorLayerTemporalProperties::ModeTemporalRangeFromDateTimeFields
|
||||
*
|
||||
* \see startTimeField()
|
||||
*/
|
||||
void setStartTimeField( const QString &field );
|
||||
|
||||
/**
|
||||
* Returns start time field
|
||||
*
|
||||
* \warning To be used only when mode() is
|
||||
* QgsVectorLayerTemporalProperties::ModeTemporalRangeFromDateTimeFields
|
||||
*
|
||||
*\see ssetStartTimeField()
|
||||
**/
|
||||
QString startTimeField() const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! Temporal layer mode.
|
||||
TemporalMode mMode;
|
||||
|
||||
//! Represents datetime range member.
|
||||
QgsDateTimeRange mRange;
|
||||
|
||||
//! Start time field for the layer
|
||||
QString mStartTimeField;
|
||||
|
||||
};
|
||||
|
||||
#endif // QGSVECTORLAYERTEMPORALPROPERTIES_H
|
@ -217,12 +217,14 @@ QgsRasterDataProvider::QgsRasterDataProvider()
|
||||
: QgsDataProvider( QString(), QgsDataProvider::ProviderOptions() )
|
||||
, QgsRasterInterface( nullptr )
|
||||
{
|
||||
mTemporalProperties = std::unique_ptr< QgsRasterDataProviderTemporalProperties >( new QgsRasterDataProviderTemporalProperties() );
|
||||
}
|
||||
|
||||
QgsRasterDataProvider::QgsRasterDataProvider( const QString &uri, const ProviderOptions &options )
|
||||
: QgsDataProvider( uri, options )
|
||||
, QgsRasterInterface( nullptr )
|
||||
{
|
||||
mTemporalProperties = std::unique_ptr< QgsRasterDataProviderTemporalProperties >( new QgsRasterDataProviderTemporalProperties() );
|
||||
}
|
||||
|
||||
QgsRasterDataProvider::ProviderCapabilities QgsRasterDataProvider::providerCapabilities() const
|
||||
@ -514,6 +516,12 @@ void QgsRasterDataProvider::copyBaseSettings( const QgsRasterDataProvider &other
|
||||
mUseSrcNoDataValue = other.mUseSrcNoDataValue;
|
||||
mUserNoDataValue = other.mUserNoDataValue;
|
||||
mExtent = other.mExtent;
|
||||
|
||||
// copy temporal properties
|
||||
mTemporalProperties->setIsActive( other.mTemporalProperties->isActive() );
|
||||
mTemporalProperties->setTemporalRange( other.mTemporalProperties->temporalRange() );
|
||||
mTemporalProperties->setFixedTemporalRange( other.mTemporalProperties->fixedTemporalRange() );
|
||||
mTemporalProperties->setEnableTime( other.mTemporalProperties->isTimeEnabled() );
|
||||
}
|
||||
|
||||
// ENDS
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "qgsrasterrange.h"
|
||||
#include "qgsrectangle.h"
|
||||
#include "qgsrasteriterator.h"
|
||||
#include "qgsrasterdataprovidertemporalproperties.h"
|
||||
|
||||
class QImage;
|
||||
class QByteArray;
|
||||
@ -47,6 +48,7 @@ class QByteArray;
|
||||
class QgsPointXY;
|
||||
class QgsRasterIdentifyResult;
|
||||
class QgsMapSettings;
|
||||
class QgsWmsProvider;
|
||||
|
||||
/**
|
||||
* \brief Handles asynchronous download of images
|
||||
@ -260,6 +262,11 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns temporal properties associated with data provider.
|
||||
*/
|
||||
QgsRasterDataProviderTemporalProperties *temporalProperties() override { return mTemporalProperties.get(); }
|
||||
|
||||
//! \brief Returns whether the provider supplies a legend graphic
|
||||
virtual bool supportsLegendGraphic() const { return false; }
|
||||
|
||||
@ -611,6 +618,13 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
|
||||
|
||||
mutable QgsRectangle mExtent;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Data provider temporal properties
|
||||
*/
|
||||
std::unique_ptr< QgsRasterDataProviderTemporalProperties > mTemporalProperties;
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsRasterDataProvider::ProviderCapabilities )
|
||||
|
113
src/core/raster/qgsrasterdataprovidertemporalproperties.cpp
Normal file
113
src/core/raster/qgsrasterdataprovidertemporalproperties.cpp
Normal file
@ -0,0 +1,113 @@
|
||||
/***************************************************************************
|
||||
qgsrasterdataprovidertemporalproperties.cpp
|
||||
---------------
|
||||
begin : February 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsrasterdataprovidertemporalproperties.h"
|
||||
|
||||
QgsRasterDataProviderTemporalProperties::QgsRasterDataProviderTemporalProperties( bool enabled )
|
||||
: QgsDataProviderTemporalProperties( enabled )
|
||||
{
|
||||
}
|
||||
|
||||
//QgsRasterDataProviderTemporalProperties &QgsRasterDataProviderTemporalProperties::operator=( const QgsRasterDataProviderTemporalProperties &other )
|
||||
//{
|
||||
// mRange = other.mRange;
|
||||
// mFixedRange = other.mFixedRange;
|
||||
// mEnableTime = other.mEnableTime;
|
||||
|
||||
// return *this;
|
||||
//}
|
||||
|
||||
void QgsRasterDataProviderTemporalProperties::setTemporalRange( const QgsDateTimeRange &dateTimeRange )
|
||||
{
|
||||
if ( !isActive() )
|
||||
setIsActive( true );
|
||||
|
||||
mRange = dateTimeRange;
|
||||
|
||||
}
|
||||
|
||||
const QgsDateTimeRange &QgsRasterDataProviderTemporalProperties::temporalRange() const
|
||||
{
|
||||
return mRange;
|
||||
}
|
||||
|
||||
void QgsRasterDataProviderTemporalProperties::setFixedTemporalRange( const QgsDateTimeRange &dateTimeRange )
|
||||
{
|
||||
if ( !isActive() )
|
||||
setIsActive( true );
|
||||
|
||||
mFixedRange = dateTimeRange;
|
||||
|
||||
}
|
||||
|
||||
const QgsDateTimeRange &QgsRasterDataProviderTemporalProperties::fixedTemporalRange() const
|
||||
{
|
||||
return mFixedRange;
|
||||
}
|
||||
|
||||
void QgsRasterDataProviderTemporalProperties::setEnableTime( bool enabled )
|
||||
{
|
||||
mEnableTime = enabled;
|
||||
}
|
||||
|
||||
bool QgsRasterDataProviderTemporalProperties::isTimeEnabled() const
|
||||
{
|
||||
return mEnableTime;
|
||||
}
|
||||
|
||||
void QgsRasterDataProviderTemporalProperties::setReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange )
|
||||
{
|
||||
if ( !isActive() )
|
||||
setIsActive( true );
|
||||
|
||||
if ( !hasReference() )
|
||||
setHasReference( true );
|
||||
|
||||
mReferenceRange = dateTimeRange;
|
||||
|
||||
}
|
||||
|
||||
const QgsDateTimeRange &QgsRasterDataProviderTemporalProperties::referenceTemporalRange() const
|
||||
{
|
||||
return mReferenceRange;
|
||||
}
|
||||
|
||||
void QgsRasterDataProviderTemporalProperties::setFixedReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange )
|
||||
{
|
||||
if ( !isActive() )
|
||||
setIsActive( true );
|
||||
|
||||
mFixedReferenceRange = dateTimeRange;
|
||||
|
||||
}
|
||||
|
||||
const QgsDateTimeRange &QgsRasterDataProviderTemporalProperties::fixedReferenceTemporalRange() const
|
||||
{
|
||||
return mFixedReferenceRange;
|
||||
}
|
||||
|
||||
|
||||
void QgsRasterDataProviderTemporalProperties::setHasReference( bool enabled )
|
||||
{
|
||||
mHasReferenceRange = enabled;
|
||||
}
|
||||
|
||||
bool QgsRasterDataProviderTemporalProperties::hasReference() const
|
||||
{
|
||||
return mHasReferenceRange;
|
||||
}
|
||||
|
174
src/core/raster/qgsrasterdataprovidertemporalproperties.h
Normal file
174
src/core/raster/qgsrasterdataprovidertemporalproperties.h
Normal file
@ -0,0 +1,174 @@
|
||||
/***************************************************************************
|
||||
qgsrasterdataprovidertemporalproperties.h
|
||||
---------------
|
||||
begin : February 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSRASTERDATAPROVIDERTEMPORALPROPERTIES_H
|
||||
#define QGSRASTERDATAPROVIDERTEMPORALPROPERTIES_H
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgsrange.h"
|
||||
#include "qgsdataprovidertemporalproperties.h"
|
||||
|
||||
/**
|
||||
* \class QgsRasterDataProviderTemporalProperties
|
||||
* \ingroup core
|
||||
* Implementation raster data provider temporal properties.
|
||||
*
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
|
||||
class CORE_EXPORT QgsRasterDataProviderTemporalProperties : public QgsDataProviderTemporalProperties
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for QgsRasterDataProviderTemporalProperties.
|
||||
*/
|
||||
QgsRasterDataProviderTemporalProperties( bool enabled = false );
|
||||
|
||||
virtual ~QgsRasterDataProviderTemporalProperties() = default;
|
||||
|
||||
// QgsRasterDataProviderTemporalProperties &operator=( const QgsRasterDataProviderTemporalProperties &other );
|
||||
|
||||
/**
|
||||
* Sets the current active datetime range for the temporal properties.
|
||||
*
|
||||
* \see temporalRange()
|
||||
*/
|
||||
void setTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
|
||||
/**
|
||||
* Returns the current active datetime range for these temporal properties.
|
||||
*
|
||||
* \see setTemporalRange()
|
||||
*/
|
||||
const QgsDateTimeRange &temporalRange() const;
|
||||
|
||||
/**
|
||||
* Sets the current active reference datetime range for the temporal properties.
|
||||
*
|
||||
* This will be used by bi-temporal dimensional data providers.
|
||||
*
|
||||
* \see referenceTemporalRange()
|
||||
*/
|
||||
void setReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
|
||||
/**
|
||||
* Returns the current active reference datetime range for these temporal properties.
|
||||
*
|
||||
* \see setReferenceTemporalRange()
|
||||
*/
|
||||
const QgsDateTimeRange &referenceTemporalRange() const;
|
||||
|
||||
/**
|
||||
* Sets the fixed datetime range for the temporal properties.
|
||||
*
|
||||
* \see fixedTemporalRange()
|
||||
*/
|
||||
void setFixedTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
|
||||
/**
|
||||
* Returns the fixed datetime range for these temporal properties.
|
||||
*
|
||||
* \see setFixedTemporalRange()
|
||||
*/
|
||||
const QgsDateTimeRange &fixedTemporalRange() const;
|
||||
|
||||
/**
|
||||
* Sets the fixed reference datetime range for the temporal properties.
|
||||
*
|
||||
* \see fixedReferenceTemporalRange()
|
||||
*/
|
||||
void setFixedReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange );
|
||||
|
||||
/**
|
||||
* Returns the fixed reference datetime range for these temporal properties.
|
||||
*
|
||||
* \see setFixedReferenceTemporalRange()
|
||||
*/
|
||||
const QgsDateTimeRange &fixedReferenceTemporalRange() const;
|
||||
|
||||
/**
|
||||
* Sets the time enabled status.
|
||||
*
|
||||
* \see isTimeEnabled()
|
||||
*/
|
||||
void setEnableTime( bool enabled );
|
||||
|
||||
/**
|
||||
* Returns the temporal property status.
|
||||
*
|
||||
* \see setEnableTime()
|
||||
*/
|
||||
bool isTimeEnabled() const;
|
||||
|
||||
/**
|
||||
* Sets the reference range status.
|
||||
*
|
||||
* \see hasReference()
|
||||
*/
|
||||
void setHasReference( bool enabled );
|
||||
|
||||
/**
|
||||
* Returns the reference range presence status.
|
||||
*
|
||||
* \see setHasReference()
|
||||
*/
|
||||
bool hasReference() const;
|
||||
|
||||
private:
|
||||
//! Represents current active datetime range member.
|
||||
QgsDateTimeRange mRange;
|
||||
|
||||
/**
|
||||
* Represents fixed data provider datetime range.
|
||||
*
|
||||
* This is for determing the providers lower and upper datetime bounds,
|
||||
* any updates on the mRange should get out the range bound defined
|
||||
* by this member.
|
||||
*
|
||||
*/
|
||||
QgsDateTimeRange mFixedRange;
|
||||
|
||||
/**
|
||||
* If the stored time part in temporal ranges should be taked into account.
|
||||
*
|
||||
* This is to enable data providers that use dates only and no datetime, to
|
||||
* configure their temporal properties to consider their state.
|
||||
*
|
||||
* eg. some WMS-T providers only require date with "YYYY-MM-DD" format with
|
||||
* no time part.
|
||||
*/
|
||||
bool mEnableTime = true;
|
||||
|
||||
/**
|
||||
* Stores reference temporal range
|
||||
*/
|
||||
QgsDateTimeRange mReferenceRange;
|
||||
|
||||
/**
|
||||
* Stores the fixed reference temporal range
|
||||
*/
|
||||
QgsDateTimeRange mFixedReferenceRange;
|
||||
|
||||
//! If these properties has reference temporal range
|
||||
bool mHasReferenceRange = false;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // QGSRASTERDATAPROVIDERTEMPORALPROPERTIES_H
|
@ -54,6 +54,8 @@ email : tim at linfiniti.com
|
||||
#include "qgsbilinearrasterresampler.h"
|
||||
#include "qgscubicrasterresampler.h"
|
||||
|
||||
#include "../../providers/wms/qgswmsprovider.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <limits>
|
||||
@ -79,6 +81,8 @@ email : tim at linfiniti.com
|
||||
#include <QRegExp>
|
||||
#include <QSlider>
|
||||
|
||||
|
||||
|
||||
#define ERR(message) QGS_ERROR_MESSAGE(message,"Raster layer")
|
||||
|
||||
const double QgsRasterLayer::SAMPLE_SIZE = 250000;
|
||||
@ -125,6 +129,8 @@ QgsRasterLayer::QgsRasterLayer( const QString &uri,
|
||||
|
||||
setDataSource( uri, baseName, providerKey, providerOptions, options.loadDefaultStyle );
|
||||
|
||||
setTemporalState();
|
||||
|
||||
} // QgsRasterLayer ctor
|
||||
|
||||
QgsRasterLayer::~QgsRasterLayer()
|
||||
@ -173,6 +179,21 @@ bool QgsRasterLayer::isValidRasterFileName( QString const &fileNameQString )
|
||||
return isValidRasterFileName( fileNameQString, retErrMsg );
|
||||
}
|
||||
|
||||
void QgsRasterLayer::setTemporalState()
|
||||
{
|
||||
if ( mProviderKey == QLatin1String( "wms" ) )
|
||||
{
|
||||
const QgsWmsProvider *wmsProvider = qobject_cast<const QgsWmsProvider* >( mDataProvider );
|
||||
if ( wmsProvider->layerIsTemporal( mLayerName ) )
|
||||
{
|
||||
setIsTemporal( true );
|
||||
QgsDateTimeRange dateTimeRange = wmsProvider->layerTemporalRange( mLayerName );
|
||||
setTemporalRange( dateTimeRange );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
QDateTime QgsRasterLayer::lastModified( QString const &name )
|
||||
{
|
||||
QgsDebugMsgLevel( "name=" + name, 4 );
|
||||
@ -577,7 +598,8 @@ void QgsRasterLayer::init()
|
||||
mLastViewPort.mWidth = 0;
|
||||
mLastViewPort.mHeight = 0;
|
||||
|
||||
mTemporalProperties = qgis::make_unique<QgsRasterLayerTemporalProperties>();
|
||||
// Initialize temporal properties
|
||||
mTemporalProperties = std::unique_ptr<QgsRasterLayerTemporalProperties>( new QgsRasterLayerTemporalProperties() );
|
||||
}
|
||||
|
||||
void QgsRasterLayer::setDataProvider( QString const &provider, const QgsDataProvider::ProviderOptions &options )
|
||||
@ -945,9 +967,16 @@ bool QgsRasterLayer::ignoreExtents() const
|
||||
return mDataProvider ? mDataProvider->ignoreExtents() : false;
|
||||
}
|
||||
|
||||
QgsRasterLayerTemporalProperties *QgsRasterLayer::temporalProperties()
|
||||
void QgsRasterLayer::setTemporalProperty( const QgsTemporalProperty &temporalProperty )
|
||||
{
|
||||
return mTemporalProperties.get();
|
||||
if( mTemporalProperty.equal( temporalProperty ) )
|
||||
return;
|
||||
mTemporalProperty = temporalProperty;
|
||||
}
|
||||
|
||||
const QgsTemporalProperty &QgsRasterLayer::temporalProperty() const
|
||||
{
|
||||
return mTemporalProperty;
|
||||
}
|
||||
|
||||
void QgsRasterLayer::setContrastEnhancement( QgsContrastEnhancement::ContrastEnhancementAlgorithm algorithm, QgsRasterMinMaxOrigin::Limits limits, const QgsRectangle &extent, int sampleSize, bool generateLookupTableFlag )
|
||||
@ -2336,3 +2365,34 @@ bool QgsRasterLayer::update()
|
||||
}
|
||||
return mValid;
|
||||
}
|
||||
|
||||
void QgsRasterLayer::setTemporalState()
|
||||
{
|
||||
// TODO add check for other raster based data providers with possible temporal properties
|
||||
if ( mProviderKey == QLatin1String( "wms" ) )
|
||||
{
|
||||
if ( mDataSource.contains( QLatin1String( "time=" ) ) ||
|
||||
mDataSource.contains( QLatin1String( "reference_time=" ) ) )
|
||||
{
|
||||
QString extent;
|
||||
|
||||
QString sourceUri( mDataSource );
|
||||
QStringList parts = sourceUri.split( ',' );
|
||||
|
||||
QStringListIterator iter( parts );
|
||||
while ( iter.hasNext() )
|
||||
{
|
||||
QString item = iter.next();
|
||||
if ( item.startsWith( QLatin1String( "time=" ) ) )
|
||||
{
|
||||
extent = item.mid( 5 );
|
||||
}
|
||||
else if ( item.startsWith( QLatin1String( "reference_time=" ) ) )
|
||||
{
|
||||
extent = item.mid( 15 );
|
||||
}
|
||||
}
|
||||
setTemporalProperty( QgsTemporalProperty());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,12 +38,11 @@
|
||||
#include "qgsrasterviewport.h"
|
||||
#include "qgsrasterminmaxorigin.h"
|
||||
#include "qgscontrastenhancement.h"
|
||||
#include "qgsrasterlayertemporalproperties.h"
|
||||
#include "qgstemporalproperty.h"
|
||||
|
||||
class QgsMapToPixel;
|
||||
class QgsRasterRenderer;
|
||||
class QgsRectangle;
|
||||
|
||||
class QImage;
|
||||
class QPixmap;
|
||||
class QSlider;
|
||||
@ -52,14 +51,43 @@ typedef QList < QPair< QString, QColor > > QgsLegendColorList;
|
||||
|
||||
/**
|
||||
* \ingroup core
|
||||
* This class provides qgis with the ability to render raster datasets
|
||||
* onto the mapcanvas.
|
||||
*
|
||||
* Represents a raster layer.
|
||||
* The qgsrasterlayer class makes use of gdal for data io, and thus supports
|
||||
* any gdal supported format. The constructor attempts to infer what type of
|
||||
* file (LayerType) is being opened - not in terms of the file format (tif, ascii grid etc.)
|
||||
* but rather in terms of whether the image is a GRAYSCALE, PaletteD or Multiband.
|
||||
*
|
||||
* A QgsRasterLayer is instantiated by specifying the name of a data provider,
|
||||
* such as "gdal" or "wms", and a url defining the specific data set to connect to.
|
||||
* The raster layer constructor in turn instantiates a QgsRasterDataProvider subclass
|
||||
* corresponding to the provider type, and passes it the url. The data provider
|
||||
* connects to the data source.
|
||||
* Within the three allowable raster layer types, there are 8 permutations of
|
||||
* how a layer can actually be rendered. These are defined in the DrawingStyle enum
|
||||
* and consist of:
|
||||
*
|
||||
* - SingleBandGray -> a GRAYSCALE layer drawn as a range of gray colors (0-255)
|
||||
* - SingleBandPseudoColor -> a GRAYSCALE layer drawn using a pseudocolor algorithm
|
||||
* - PalettedSingleBandGray -> a PaletteD layer drawn in gray scale (using only one of the color components)
|
||||
* - PalettedSingleBandPseudoColor -> a PaletteD layer having only one of its color components rendered as pseudo color
|
||||
* - PalettedMultiBandColor -> a PaletteD image where the bands contains 24bit color info and 8 bits is pulled out per color
|
||||
* - MultiBandSingleBandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
|
||||
* - MultiBandSingleBandPseudoColor -> a layer containing 2 or more bands, but using only one band to produce a pseudocolor image
|
||||
* - MultiBandColor -> a layer containing 2 or more bands, mapped to the three RGBcolors. In the case of a multiband with only two bands, one band will have to be mapped to more than one color
|
||||
*
|
||||
* Each of the above mentioned drawing styles is implemented in its own draw* function.
|
||||
* Some of the drawing styles listed above require statistics about the layer such
|
||||
* as the min / max / mean / stddev etc. statistics for a band can be gathered using the
|
||||
* bandStatistics function. Note that statistics gathering is a slow process and
|
||||
* every effort should be made to call this function as few times as possible. For this
|
||||
* reason, qgsraster has a vector class member to store stats for each band. The
|
||||
* constructor initializes this vector on startup, but only populates the band name and
|
||||
* number fields.
|
||||
*
|
||||
* Note that where bands are of gdal 'undefined' type, their values may exceed the
|
||||
* renderable range of 0-255. Because of this a linear scaling histogram enhanceContrast is
|
||||
* applied to undefined layers to normalise the data into the 0-255 range.
|
||||
*
|
||||
* A qgsrasterlayer band can be referred to either by name or by number (base=1). It
|
||||
* should be noted that band names as stored in datafiles may not be unique, and
|
||||
* so the rasterlayer class appends the band number in brackets behind each band name.
|
||||
*
|
||||
* Sample usage of the QgsRasterLayer class:
|
||||
*
|
||||
@ -68,7 +96,45 @@ typedef QList < QPair< QString, QColor > > QgsLegendColorList;
|
||||
* QString myBaseNameQString = "my layer";
|
||||
* QgsRasterLayer *myRasterLayer = new QgsRasterLayer(myFileNameQString, myBaseNameQString);
|
||||
* \endcode
|
||||
*
|
||||
* In order to automate redrawing of a raster layer, you should link it to a map canvas like this:
|
||||
*
|
||||
* \code{.cpp}
|
||||
* QObject::connect( myRasterLayer, SIGNAL(repaintRequested()), mapCanvas, SLOT(refresh()) );
|
||||
* \endcode
|
||||
*
|
||||
* Once a layer has been created you can find out what type of layer it is (GrayOrUndefined, Palette or Multiband):
|
||||
*
|
||||
* \code{.cpp}
|
||||
* if (rasterLayer->rasterType()==QgsRasterLayer::Multiband)
|
||||
* {
|
||||
* //do something
|
||||
* }
|
||||
* else if (rasterLayer->rasterType()==QgsRasterLayer::Palette)
|
||||
* {
|
||||
* //do something
|
||||
* }
|
||||
* else // QgsRasterLayer::GrayOrUndefined
|
||||
* {
|
||||
* //do something.
|
||||
* }
|
||||
* \endcode
|
||||
*
|
||||
* Raster layers can also have an arbitrary level of transparency defined, and have their
|
||||
* color palettes inverted using the setTransparency and setInvertHistogram methods.
|
||||
*
|
||||
* Pseudocolor images can have their output adjusted to a given number of standard
|
||||
* deviations using the setStandardDeviations method.
|
||||
*
|
||||
* The final area of functionality you may be interested in is band mapping. Band mapping
|
||||
* allows you to choose arbitrary band -> color mappings and is applicable only to Palette
|
||||
* and Multiband rasters, There are four mappings that can be made: red, green, blue and gray.
|
||||
* Mappings are non-exclusive. That is a given band can be assigned to no, some or all
|
||||
* color mappings. The constructor sets sensible defaults for band mappings but these can be
|
||||
* overridden at run time using the setRedBandName, setGreenBandName, setBlueBandName and setGrayBandName
|
||||
* methods.
|
||||
*/
|
||||
|
||||
class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -430,9 +496,20 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
|
||||
bool ignoreExtents() const;
|
||||
|
||||
/**
|
||||
* Returns temporal properties associated with the raster layer.
|
||||
*/
|
||||
QgsRasterLayerTemporalProperties *temporalProperties() override;
|
||||
* Set the temporal property.
|
||||
*
|
||||
* \see temporalProperty()
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
void setTemporalProperty( const QgsTemporalProperty &temporalProperty );
|
||||
|
||||
/**
|
||||
* Returns the layer temporal property.
|
||||
*
|
||||
* \see setTemporalProperty()
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
const QgsTemporalProperty &temporalProperty() const;
|
||||
|
||||
public slots:
|
||||
void showStatusMessage( const QString &message );
|
||||
@ -489,9 +566,6 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
|
||||
//! Pointer to data provider
|
||||
QgsRasterDataProvider *mDataProvider = nullptr;
|
||||
|
||||
//! Pointer to temporal properties
|
||||
std::unique_ptr< QgsRasterLayerTemporalProperties > mTemporalProperties;
|
||||
|
||||
//! [ data provider interface ] Timestamp, the last modified time of the data source when the layer was created
|
||||
QDateTime mLastModified;
|
||||
|
||||
@ -506,6 +580,9 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
|
||||
|
||||
QDomDocument mOriginalStyleDocument;
|
||||
QDomElement mOriginalStyleElement;
|
||||
|
||||
//! Stores layer temporal state
|
||||
QgsTemporalProperty mTemporalProperty;
|
||||
};
|
||||
|
||||
// clazy:excludeall=qstring-allocations
|
||||
|
@ -29,11 +29,16 @@ QgsRasterLayerTemporalProperties::TemporalMode QgsRasterLayerTemporalProperties:
|
||||
|
||||
void QgsRasterLayerTemporalProperties::setMode( QgsRasterLayerTemporalProperties::TemporalMode mode )
|
||||
{
|
||||
if ( mMode == mode )
|
||||
return;
|
||||
mMode = mode;
|
||||
}
|
||||
|
||||
void QgsRasterLayerTemporalProperties::setFixedTemporalRange( const QgsDateTimeRange &range )
|
||||
{
|
||||
if ( range == mRange )
|
||||
return;
|
||||
|
||||
mRange = range;
|
||||
}
|
||||
|
||||
@ -42,6 +47,25 @@ const QgsDateTimeRange &QgsRasterLayerTemporalProperties::fixedTemporalRange() c
|
||||
return mRange;
|
||||
}
|
||||
|
||||
//void QgsRasterLayerTemporalProperties::setProviderTemporalRange( const QgsDateTimeRange &range )
|
||||
//{
|
||||
// if ( range == mRange )
|
||||
// return;
|
||||
|
||||
// QgsWmsProvider *wmsProvider = qobject_cast<QgsWmsProvider*> (mDataProvider);
|
||||
|
||||
// if ( wmsProvider)
|
||||
// wmsProvider->setTemporalRange( range );
|
||||
|
||||
// mRange = range;
|
||||
|
||||
//}
|
||||
|
||||
//void QgsRasterLayerTemporalProperties::setDataProvider( QgsRasterDataProvider *provider)
|
||||
//{
|
||||
// mDataProvider = provider;
|
||||
//}
|
||||
|
||||
void QgsRasterLayerTemporalProperties::setWmstRelatedSettings( const QString &dimension )
|
||||
{
|
||||
Q_UNUSED( dimension )
|
||||
@ -77,7 +101,7 @@ bool QgsRasterLayerTemporalProperties::readXml( const QDomElement &element, cons
|
||||
|
||||
QDomElement QgsRasterLayerTemporalProperties::writeXml( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context )
|
||||
{
|
||||
Q_UNUSED( context )
|
||||
Q_UNUSED( context );
|
||||
if ( element.isNull() )
|
||||
return QDomElement();
|
||||
|
||||
@ -116,6 +140,6 @@ QgsRasterLayerTemporalProperties::TemporalMode QgsRasterLayerTemporalProperties:
|
||||
case 2:
|
||||
return TemporalMode::ModeTemporalRangesList;
|
||||
default:
|
||||
return TemporalMode::ModeTemporalRangesList;
|
||||
return TemporalMode::ModeFixedTemporalRange;
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "qgis_sip.h"
|
||||
#include "qgsrange.h"
|
||||
#include "qgsmaplayertemporalproperties.h"
|
||||
#include "qgsrasterdataprovider.h"
|
||||
|
||||
/**
|
||||
* \class QgsRasterLayerTemporalProperties
|
||||
@ -49,9 +50,9 @@ class CORE_EXPORT QgsRasterLayerTemporalProperties : public QgsMapLayerTemporalP
|
||||
**/
|
||||
enum TemporalMode
|
||||
{
|
||||
ModeFixedTemporalRange = 0, //! Mode when temporal properties have fixed start and end datetimes.
|
||||
ModeTemporalRangeFromDataProvider = 1, //! Mode when raster layer depends on temporal range from its dataprovider.
|
||||
ModeTemporalRangesList = 2 //! To be used when raster layer has list of temporal ranges.
|
||||
ModeFixedTemporalRange, //! Mode when temporal properties have fixed start and end datetimes.
|
||||
ModeTemporalRangeFromDataProvider, //! Mode when raster layer depends on temporal range from its data provider.
|
||||
ModeTemporalRangesList //! To be used when raster layer has list of temporal ranges.
|
||||
};
|
||||
|
||||
/**
|
||||
@ -93,6 +94,26 @@ class CORE_EXPORT QgsRasterLayerTemporalProperties : public QgsMapLayerTemporalP
|
||||
**/
|
||||
const QgsDateTimeRange &fixedTemporalRange() const;
|
||||
|
||||
/**
|
||||
* Sets the temporal \a range to apply to the whole layer.
|
||||
*
|
||||
* \warning To be used only when mode() is
|
||||
* QgsRasterLayerTemporalProperties::ModeProviderTemporalRange
|
||||
*
|
||||
* \see providerTemporalRange()
|
||||
*/
|
||||
void setProviderTemporalRange( const QgsDateTimeRange &range );
|
||||
|
||||
/**
|
||||
* Returns the provider temporal range for these properties
|
||||
*
|
||||
* \warning To be used only when mode() is
|
||||
* QgsRasterLayerTemporalProperties::ModeProviderTemporalRange
|
||||
*
|
||||
*\see setProviderTemporalRange()
|
||||
**/
|
||||
const QgsDateTimeRange &providerTemporalRange() const;
|
||||
|
||||
/**
|
||||
* Sets the raster layer properties with WMS-T temporal settings.
|
||||
*
|
||||
@ -105,6 +126,13 @@ class CORE_EXPORT QgsRasterLayerTemporalProperties : public QgsMapLayerTemporalP
|
||||
**/
|
||||
void setWmstRelatedSettings( const QString &dimension );
|
||||
|
||||
/**
|
||||
* Sets the raster layer properties with WMS-T temporal settings.
|
||||
*
|
||||
* \param dimension contains text content indicating WMS layer available time value(s).
|
||||
*/
|
||||
void setDataProvider( QgsRasterDataProvider *provider );
|
||||
|
||||
QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
|
||||
|
||||
bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
|
||||
@ -117,6 +145,9 @@ class CORE_EXPORT QgsRasterLayerTemporalProperties : public QgsMapLayerTemporalP
|
||||
//! Represents datetime range member.
|
||||
QgsDateTimeRange mRange;
|
||||
|
||||
//! Raster layer data provider with temporal properties
|
||||
QgsRasterDataProvider *mDataProvider = nullptr;
|
||||
|
||||
/**
|
||||
* Returns the temporal mode given index
|
||||
**/
|
||||
|
@ -457,6 +457,7 @@ SET(QGIS_GUI_SRCS
|
||||
qgstabwidget.cpp
|
||||
qgstablewidgetitem.cpp
|
||||
qgstaskmanagerwidget.cpp
|
||||
qgstemporallayerwidget.cpp
|
||||
qgstextformatwidget.cpp
|
||||
qgstextpreview.cpp
|
||||
qgstreewidgetitem.cpp
|
||||
@ -667,6 +668,7 @@ SET(QGIS_GUI_HDRS
|
||||
qgstablewidgetitem.h
|
||||
qgstabwidget.h
|
||||
qgstaskmanagerwidget.h
|
||||
qgstemporallayerwidget.h
|
||||
qgstextformatwidget.h
|
||||
qgstextpreview.h
|
||||
qgstreewidgetitem.h
|
||||
|
@ -26,7 +26,11 @@
|
||||
#include "qgsfeatureid.h"
|
||||
#include "qgsgeometry.h"
|
||||
#include "qgscustomdrophandler.h"
|
||||
<<<<<<< HEAD
|
||||
#include "qgstemporalrangeobject.h"
|
||||
=======
|
||||
#include "temporal/qgsabstracttemporal.h"
|
||||
>>>>>>> de9992479d... updates on tests and abstract temporal class
|
||||
|
||||
#include <QDomDocument>
|
||||
#include <QGraphicsView>
|
||||
@ -941,13 +945,12 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
|
||||
*/
|
||||
void tapAndHoldGestureOccurred( const QgsPointXY &mapPoint, QTapAndHoldGesture *gesture );
|
||||
|
||||
/**
|
||||
* Emitted when the map canvas temporal range changes.
|
||||
/** Emitted when the map canvas temporal range changes.
|
||||
*
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
void temporalRangeChanged();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
bool event( QEvent *e ) override;
|
||||
|
182
src/gui/qgstemporallayerwidget.cpp
Normal file
182
src/gui/qgstemporallayerwidget.cpp
Normal file
@ -0,0 +1,182 @@
|
||||
/***************************************************************************
|
||||
qgstemporallayerwidget.cpp
|
||||
------------------------------
|
||||
begin : January 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgstemporallayerwidget.h"
|
||||
#include "qgsgui.h"
|
||||
#include "qgsproject.h"
|
||||
|
||||
QgsTemporalLayerWidget::QgsTemporalLayerWidget( QWidget *parent, QgsMapLayer *layer )
|
||||
: QWidget( parent )
|
||||
, mLayer( layer )
|
||||
{
|
||||
setupUi( this );
|
||||
connect( mSetEndAsStartNormalButton, &QPushButton::clicked, this, &QgsTemporalLayerWidget::setEndAsStartNormalButton_clicked );
|
||||
connect( mSetEndAsStartReferenceButton, &QPushButton::clicked, this, &QgsTemporalLayerWidget::setEndAsStartReferenceButton_clicked );
|
||||
connect( mLayerRadioButton, &QRadioButton::clicked, this, &QgsTemporalLayerWidget::layerRadioButton_clicked );
|
||||
connect( mProjectRadioButton, &QRadioButton::clicked, this, &QgsTemporalLayerWidget::projectRadioButton_clicked );
|
||||
connect( mReferenceCheckBox, &QCheckBox::clicked, this, &QgsTemporalLayerWidget::referenceCheckBox_clicked );
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::setEndAsStartNormalButton_clicked()
|
||||
{
|
||||
mEndTemporalDateTimeEdit->setDateTime( mStartTemporalDateTimeEdit->dateTime() );
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::setEndAsStartReferenceButton_clicked()
|
||||
{
|
||||
mEndReferenceDateTimeEdit->setDateTime( mStartReferenceDateTimeEdit->dateTime() );
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::layerRadioButton_clicked()
|
||||
{
|
||||
if ( mLayerRadioButton->isChecked() )
|
||||
{
|
||||
setInputWidgetState( "normal", true );
|
||||
updateRangeLabel( "layer", mRangeLabel );
|
||||
mProjectRadioButton->setChecked( false );
|
||||
}
|
||||
else
|
||||
setInputWidgetState( "normal", false );
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::projectRadioButton_clicked()
|
||||
{
|
||||
if ( mProjectRadioButton->isChecked() )
|
||||
{
|
||||
mLayerRadioButton->setChecked( false );
|
||||
setInputWidgetState( "normal", false );
|
||||
updateRangeLabel( "project", mRangeLabel );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::referenceCheckBox_clicked()
|
||||
{
|
||||
if ( mReferenceCheckBox->isChecked() )
|
||||
setInputWidgetState( "reference", true );
|
||||
else
|
||||
setInputWidgetState( "reference", false );
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::init()
|
||||
{
|
||||
mLayerRadioButton->setChecked( true );
|
||||
setInputWidgetState( "reference", false );
|
||||
setDateTimeInputsLimit();
|
||||
|
||||
updateRangeLabel( "layer", mRangeLabel );
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::setDateTimeInputsLimit()
|
||||
{
|
||||
QgsRasterLayer *layer = qobject_cast<QgsRasterLayer *>( mLayer );
|
||||
QgsDateTimeRange range = layer->dataProvider()->temporalProperties()->fixedTemporalRange();
|
||||
QgsDateTimeRange referenceRange = layer->dataProvider()->temporalProperties()->fixedReferenceTemporalRange();
|
||||
|
||||
if ( range.begin().isValid() && range.end().isValid() )
|
||||
{
|
||||
mStartTemporalDateTimeEdit->setDateTime( range.begin() );
|
||||
mEndTemporalDateTimeEdit->setDateTime( range.end() );
|
||||
}
|
||||
if ( referenceRange.begin().isValid() && referenceRange.end().isValid() )
|
||||
{
|
||||
mStartReferenceDateTimeEdit->setDateTime( referenceRange.begin() );
|
||||
mEndReferenceDateTimeEdit->setDateTime( referenceRange.end() );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::setInputWidgetState( QString type, bool enabled )
|
||||
{
|
||||
if ( type == "normal" )
|
||||
{
|
||||
mStartTemporalDateTimeEdit->setEnabled( enabled );
|
||||
mEndTemporalDateTimeEdit->setEnabled( enabled );
|
||||
mSetEndAsStartNormalButton->setEnabled( enabled );
|
||||
}
|
||||
else if ( type == "reference" )
|
||||
{
|
||||
mStartReferenceDateTimeEdit->setEnabled( enabled );
|
||||
mEndReferenceDateTimeEdit->setEnabled( enabled );
|
||||
mSetEndAsStartReferenceButton->setEnabled( enabled );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::setMapCanvas( QgsMapCanvas *canvas )
|
||||
{
|
||||
mCanvas = canvas;
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::saveTemporalProperties()
|
||||
{
|
||||
if ( mLayerRadioButton->isChecked() )
|
||||
{
|
||||
if ( mLayer->type() == QgsMapLayerType::RasterLayer &&
|
||||
mLayer->providerType() == "wms" )
|
||||
{
|
||||
QgsDateTimeRange normalRange = QgsDateTimeRange( mStartTemporalDateTimeEdit->dateTime(),
|
||||
mEndTemporalDateTimeEdit->dateTime() );
|
||||
QgsRasterLayer *rasterLayer = qobject_cast<QgsRasterLayer *>( mLayer );
|
||||
rasterLayer->dataProvider()->temporalProperties()->setTemporalRange( normalRange );
|
||||
|
||||
if ( mDisableTime->isChecked() )
|
||||
rasterLayer->dataProvider()->temporalProperties()->setEnableTime( false );
|
||||
else
|
||||
rasterLayer->dataProvider()->temporalProperties()->setEnableTime( true );
|
||||
|
||||
if ( mReferenceCheckBox->isChecked() )
|
||||
{
|
||||
QgsDateTimeRange referenceRange = QgsDateTimeRange( mStartReferenceDateTimeEdit->dateTime(),
|
||||
mEndReferenceDateTimeEdit->dateTime() );
|
||||
rasterLayer->dataProvider()->temporalProperties()->setReferenceTemporalRange( referenceRange );
|
||||
}
|
||||
}
|
||||
|
||||
if ( mProjectRadioButton->isChecked() )
|
||||
{
|
||||
if ( mLayer->type() == QgsMapLayerType::RasterLayer &&
|
||||
mLayer->providerType() == "wms" )
|
||||
{
|
||||
QgsDateTimeRange projectRange = mCanvas->mapSettings().temporalRange();
|
||||
QgsRasterLayer *rasterLayer = qobject_cast<QgsRasterLayer *> ( mLayer );
|
||||
rasterLayer->dataProvider()->temporalProperties()->setTemporalRange( projectRange );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QgsTemporalLayerWidget::updateRangeLabel( QString type, QLabel *label )
|
||||
{
|
||||
if ( type == "layer" )
|
||||
label->setText( tr( "Current selection range: %1 to %2" ).arg(
|
||||
mStartReferenceDateTimeEdit->dateTime().toString(),
|
||||
mEndReferenceDateTimeEdit->dateTime().toString() ) );
|
||||
else if ( type == "project" )
|
||||
{
|
||||
QgsDateTimeRange range = mCanvas->mapSettings().temporalRange();
|
||||
|
||||
if ( range.begin().isValid() && range.end().isValid() )
|
||||
label->setText( tr( "Current selection range: %1 to %2 from the project settings" ).arg(
|
||||
range.begin().toString(),
|
||||
range.end().toString() ) );
|
||||
else
|
||||
label->setText( tr( "Date time range from the project is invalid, change it in Project options before using it here." ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
134
src/gui/qgstemporallayerwidget.h
Normal file
134
src/gui/qgstemporallayerwidget.h
Normal file
@ -0,0 +1,134 @@
|
||||
/***************************************************************************
|
||||
qgstemporallayerwidget.h
|
||||
------------------------------
|
||||
begin : January 2020
|
||||
copyright : (C) 2020 by Samweli Mwakisambwe
|
||||
email : samweli at kartoza dot com
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSTEMPORALLAYERWIDGET_H
|
||||
#define QGSTEMPORALLAYERWIDGET_H
|
||||
|
||||
#include "ui_qgstemporallayerwidgetbase.h"
|
||||
#include "qgis_gui.h"
|
||||
#include "qgsmapcanvas.h"
|
||||
#include "qgsrasterlayer.h"
|
||||
|
||||
|
||||
class QgsMapLayer;
|
||||
|
||||
/**
|
||||
* \ingroup gui
|
||||
* \class QgsTemporalLayerWidget
|
||||
* A widget for filtering temporal layer based on its available time values
|
||||
*
|
||||
* \since QGIS 3.14
|
||||
*/
|
||||
|
||||
class GUI_EXPORT QgsTemporalLayerWidget : public QWidget, private Ui::QgsTemporalLayerWidgetBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for QgsTemporalLayerWidget.
|
||||
*/
|
||||
QgsTemporalLayerWidget( QWidget *parent = nullptr, QgsMapLayer *layer = nullptr );
|
||||
|
||||
/**
|
||||
* Sets the map canvas associtated with this temporal widget.
|
||||
*
|
||||
*/
|
||||
void setMapCanvas( QgsMapCanvas *canvas );
|
||||
|
||||
/**
|
||||
* Save widget temporal properties inputs.
|
||||
*/
|
||||
void saveTemporalProperties();
|
||||
|
||||
private slots:
|
||||
|
||||
/**
|
||||
* Sets the input end datetime the same as start datetime input.
|
||||
**/
|
||||
void setEndAsStartNormalButton_clicked();
|
||||
|
||||
/**
|
||||
* Sets the reference input end datetime the same as start datetime input, from
|
||||
* advance options.
|
||||
*/
|
||||
void setEndAsStartReferenceButton_clicked();
|
||||
|
||||
/**
|
||||
* Handles actions to follow when layer radio button is clicked.
|
||||
**/
|
||||
void layerRadioButton_clicked();
|
||||
|
||||
/**
|
||||
* Handles actions to follow when project radio button is clicked.
|
||||
**/
|
||||
void projectRadioButton_clicked();
|
||||
|
||||
/**
|
||||
* Handles actions to follow when reference checkbox is clicked.
|
||||
**/
|
||||
void referenceCheckBox_clicked();
|
||||
|
||||
/**
|
||||
* Sets the input widgets enable state in this temporal widget.
|
||||
*
|
||||
* \param type widget type
|
||||
* \param enabled new enable status
|
||||
*/
|
||||
void setInputWidgetState( QString type, bool enabled );
|
||||
|
||||
/**
|
||||
* Updates the range label with current set datetime range.
|
||||
*
|
||||
**/
|
||||
void updateRangeLabel( QString type, QLabel *label );
|
||||
|
||||
/**
|
||||
* Sets the temporal date time inputs with layer's lower and upper
|
||||
* temporal range limits.
|
||||
*
|
||||
**/
|
||||
void setDateTimeInputsLimit();
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Initialize the widget with default state behaviour.
|
||||
*/
|
||||
void init();
|
||||
|
||||
/**
|
||||
* Map canvas associtated with this temporal widget.
|
||||
*
|
||||
* This can be used to get current project map settings.
|
||||
*/
|
||||
QgsMapCanvas *mCanvas = nullptr;
|
||||
|
||||
/**
|
||||
* Update temporal layer Uri
|
||||
*
|
||||
*/
|
||||
QString updateTemporalDataSource( QString sourceUri, QgsDateTimeRange sourceRange );
|
||||
|
||||
/**
|
||||
* The corresponding map layer with temporal attributes
|
||||
*/
|
||||
QgsMapLayer *mLayer = nullptr;
|
||||
|
||||
|
||||
};
|
||||
#endif // QGSTEMPORALLAYERWIDGET_H
|
@ -59,6 +59,8 @@
|
||||
#include "qgsfileutils.h"
|
||||
#include "qgswebview.h"
|
||||
|
||||
#include "qgstemporallayerwidget.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QHeaderView>
|
||||
@ -269,6 +271,20 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv
|
||||
layout->addWidget( mMetadataWidget );
|
||||
metadataFrame->setLayout( layout );
|
||||
|
||||
// Temporal options
|
||||
|
||||
if ( mRasterLayer->temporalProperties()->isActive() ||
|
||||
mRasterLayer->dataProvider()->temporalProperties()->isActive() )
|
||||
{
|
||||
QVBoxLayout *temporalLayout = new QVBoxLayout( temporalFrame );
|
||||
mTemporalLayerWidget = new QgsTemporalLayerWidget( this, mRasterLayer );
|
||||
mTemporalLayerWidget->setMapCanvas( mMapCanvas );
|
||||
temporalLayout->addWidget( mTemporalLayerWidget );
|
||||
|
||||
// TODO set lower and upper limits in datetimeedit inputs
|
||||
|
||||
}
|
||||
|
||||
QgsDebugMsg( "Setting crs to " + mRasterLayer->crs().toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ) );
|
||||
QgsDebugMsg( "Setting crs to " + mRasterLayer->crs().userFriendlyIdentifier() );
|
||||
mCrsSelector->setCrs( mRasterLayer->crs() );
|
||||
@ -1094,6 +1110,9 @@ void QgsRasterLayerProperties::apply()
|
||||
mRasterLayer->setCustomProperty( "WMSPublishDataSourceUrl", mPublishDataSourceUrlCheckBox->isChecked() );
|
||||
mRasterLayer->setCustomProperty( "WMSBackgroundLayer", mBackgroundLayerCheckBox->isChecked() );
|
||||
|
||||
// Update temporal properties
|
||||
mTemporalLayerWidget->saveTemporalProperties();
|
||||
|
||||
// Force a redraw of the legend
|
||||
mRasterLayer->setLegend( QgsMapLayerLegend::defaultRasterLegend( mRasterLayer ) );
|
||||
|
||||
|
@ -37,6 +37,7 @@ class QgsMetadataWidget;
|
||||
class QgsRasterRenderer;
|
||||
class QgsRasterRendererWidget;
|
||||
class QgsRasterHistogramWidget;
|
||||
class QgsTemporalLayerWidget;
|
||||
class QgsWebView;
|
||||
|
||||
|
||||
@ -200,6 +201,11 @@ class GUI_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private
|
||||
QgsRasterRendererWidget *mRendererWidget = nullptr;
|
||||
QgsMetadataWidget *mMetadataWidget = nullptr;
|
||||
|
||||
/**
|
||||
* Widget with temporal inputs, to be used by temporal based raster layers.
|
||||
*/
|
||||
QgsTemporalLayerWidget *mTemporalLayerWidget = nullptr;
|
||||
|
||||
bool rasterIsMultiBandColor();
|
||||
|
||||
/**
|
||||
@ -207,6 +213,11 @@ class GUI_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private
|
||||
*/
|
||||
void updateInformationContent();
|
||||
|
||||
/**
|
||||
* Updates the temporal properties for temporal based raster layers.
|
||||
*/
|
||||
void updateTemporalProperties();
|
||||
|
||||
void setupTransparencyTable( int nBands );
|
||||
|
||||
//! \brief Clear the current transparency table and populate the table with the correct types for current drawing mode and data type
|
||||
|
@ -82,6 +82,20 @@ bool QgsWmsSettings::parseUri( const QString &uriString )
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( uri.param( QStringLiteral( "type" ) ) == QLatin1String( "wmst" ) )
|
||||
{
|
||||
mIsTemporal = true;
|
||||
mTemporalExtent = uri.param( QStringLiteral( "time" ) );
|
||||
mFixedRange = parseTemporalExtent( mTimeDimensionExtent, mTemporalExtent );
|
||||
|
||||
if ( uri.param( QStringLiteral( "reference_time" ) ) != QLatin1String( "" ) )
|
||||
{
|
||||
QString referenceExtent = uri.param( QStringLiteral( "reference_time" ) );
|
||||
mFixedReferenceRange = parseTemporalExtent( mReferenceTimeDimensionExtent,
|
||||
referenceExtent );
|
||||
}
|
||||
}
|
||||
|
||||
mTiled = false;
|
||||
mTileDimensionValues.clear();
|
||||
|
||||
@ -161,6 +175,179 @@ bool QgsWmsSettings::parseUri( const QString &uriString )
|
||||
return true;
|
||||
}
|
||||
|
||||
QgsDateTimeRange QgsWmsSettings::parseTemporalExtent( QgsWmstDimensionExtent dimensionExtent,
|
||||
QString extent )
|
||||
{
|
||||
if ( extent.isNull() )
|
||||
return QgsDateTimeRange();
|
||||
|
||||
bool containResolution = false;
|
||||
|
||||
QStringList parts;
|
||||
|
||||
if ( extent.contains( ',' ) )
|
||||
parts = extent.split( ',' );
|
||||
else
|
||||
parts.append( extent );
|
||||
|
||||
QStringListIterator iter( parts );
|
||||
|
||||
QgsWmstExtentPair pair;
|
||||
|
||||
QgsWmstResolution resolution = pair.resolution;
|
||||
QgsWmstDates datesList = pair.dates;
|
||||
|
||||
while ( iter.hasNext() )
|
||||
{
|
||||
QString item = iter.next();
|
||||
QStringList itemParts;
|
||||
|
||||
// If item contain '/' content separator, it is an interval
|
||||
if ( item.contains( '/' ) )
|
||||
{
|
||||
itemParts = item.split( '/' );
|
||||
QStringListIterator itemIter( itemParts );
|
||||
QgsWmstExtentPair itemPair;
|
||||
|
||||
QgsWmstResolution itemResolution = itemPair.resolution;
|
||||
QgsWmstDates itemDatesList = itemPair.dates;
|
||||
|
||||
bool itemContainResolution = false;
|
||||
|
||||
while ( itemIter.hasNext() )
|
||||
{
|
||||
QString itemContent = itemIter.next();
|
||||
|
||||
if ( itemContent.startsWith( 'P' ) )
|
||||
{
|
||||
itemResolution = parseWmstResolution( itemContent );
|
||||
itemContainResolution = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemDatesList.dateTimes.append( parseWmstDateTimes( itemContent ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( itemContainResolution )
|
||||
dimensionExtent.datesResolutionList.append( QgsWmstExtentPair( itemDatesList, itemResolution ) );
|
||||
else
|
||||
dimensionExtent.datesResolutionList.append( QgsWmstExtentPair( itemDatesList, QgsWmstResolution() ) );
|
||||
itemContainResolution = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( item.startsWith( 'P' ) )
|
||||
{
|
||||
resolution = parseWmstResolution( item );
|
||||
containResolution = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
datesList.dateTimes.append( parseWmstDateTimes( item ) );
|
||||
}
|
||||
|
||||
if ( containResolution )
|
||||
dimensionExtent.datesResolutionList.append( QgsWmstExtentPair( datesList, resolution ) );
|
||||
else
|
||||
dimensionExtent.datesResolutionList.append( QgsWmstExtentPair( datesList, QgsWmstResolution() ) );
|
||||
containResolution = false;
|
||||
}
|
||||
|
||||
|
||||
// Return the provider temporal take the begin date in first temporal range and
|
||||
// and the end date in last temporal range
|
||||
|
||||
if ( dimensionExtent.datesResolutionList.first().dates.dateTimes.size() > 0 )
|
||||
{
|
||||
QDateTime begin = dimensionExtent.datesResolutionList.first().dates.dateTimes.first();
|
||||
QDateTime end = dimensionExtent.datesResolutionList.first().dates.dateTimes.last();
|
||||
|
||||
return QgsDateTimeRange( begin, end );
|
||||
}
|
||||
|
||||
return QgsDateTimeRange();
|
||||
}
|
||||
|
||||
QgsWmstResolution QgsWmsSettings::parseWmstResolution( QString item )
|
||||
{
|
||||
QgsWmstResolution resolution;
|
||||
char datesSymbols[] = { 'Y', 'M', 'D' };
|
||||
char timesSymbols[] = { 'H', 'M', 'S' };
|
||||
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
{
|
||||
QString number = item.left( item.indexOf( datesSymbols[i] ) );
|
||||
int resolutionValue = number.remove( 'P' ).toInt();
|
||||
|
||||
if ( datesSymbols[i] == 'Y' && item.contains( 'Y' ) )
|
||||
{
|
||||
resolution.year = resolutionValue;
|
||||
item = item.remove( number );
|
||||
}
|
||||
if ( datesSymbols[i] == 'M' && item.contains( 'M' ) )
|
||||
{
|
||||
resolution.month = resolutionValue;
|
||||
item = item.remove( number );
|
||||
}
|
||||
if ( datesSymbols[i] == 'D' && item.contains( 'D' ) )
|
||||
{
|
||||
resolution.day = resolutionValue;
|
||||
item = item.remove( number );
|
||||
}
|
||||
|
||||
}
|
||||
if ( !item.contains( 'T' ) )
|
||||
return resolution;
|
||||
else
|
||||
item.remove( 'T' );
|
||||
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
{
|
||||
QString number = item.left( item.indexOf( timesSymbols[i] ) );
|
||||
int resolutionValue = number.remove( 'P' ).toInt();
|
||||
|
||||
if ( timesSymbols[i] == 'H' && item.contains( 'H' ) )
|
||||
{
|
||||
resolution.hour = resolutionValue;
|
||||
item = item.remove( number );
|
||||
}
|
||||
if ( timesSymbols[i] == 'M' && item.contains( 'M' ) )
|
||||
{
|
||||
resolution.minutes = resolutionValue;
|
||||
item = item.remove( number );
|
||||
}
|
||||
if ( timesSymbols[i] == 'S' && item.contains( 'S' ) )
|
||||
{
|
||||
resolution.seconds = resolutionValue;
|
||||
item = item.remove( number );
|
||||
}
|
||||
|
||||
}
|
||||
return resolution;
|
||||
}
|
||||
|
||||
QDateTime QgsWmsSettings::parseWmstDateTimes( QString item )
|
||||
{
|
||||
// Standard item will have YYYY-MM-DDThh:mm:ss.SSSZ
|
||||
// format a Qt::ISODateWithMs
|
||||
|
||||
QString format = "YYYY-MM-DDThh:mm:ss.SSSZ";
|
||||
|
||||
// Check if it does not have time part
|
||||
if ( !item.contains( 'T' ) )
|
||||
return QDateTime::fromString( item, "YYYY-MM-DD" );
|
||||
else
|
||||
{
|
||||
if ( item.contains( '.' ) )
|
||||
return QDateTime::fromString( item, Qt::ISODateWithMs );
|
||||
else
|
||||
return QDateTime::fromString( item, Qt::ISODate );
|
||||
}
|
||||
|
||||
return QDateTime::fromString( item, format );
|
||||
}
|
||||
|
||||
|
||||
// ----------------------
|
||||
|
||||
|
@ -186,6 +186,23 @@ struct QgsWmsDimensionProperty
|
||||
//! Optional, valid only for temporal exents, determines whether data are normally kept current.
|
||||
bool current = false;
|
||||
|
||||
//! Parse the dimension extent to QgsDateTimeRange instance
|
||||
QgsDateTimeRange parseExtent() const
|
||||
{
|
||||
if ( extent.contains( '/' ) )
|
||||
{
|
||||
QStringList extentContent = extent.split( '/' );
|
||||
int extentSize = extentContent.size();
|
||||
|
||||
QDateTime start = QDateTime::fromString( extentContent.at( 0 ), Qt::ISODateWithMs );
|
||||
QDateTime end = QDateTime::fromString( extentContent.at( extentSize - 2 ), Qt::ISODateWithMs );
|
||||
|
||||
if ( start.isValid() & end.isValid() )
|
||||
return QgsDateTimeRange( start, end );
|
||||
}
|
||||
|
||||
return QgsDateTimeRange();
|
||||
}
|
||||
};
|
||||
|
||||
//! Logo URL Property structure
|
||||
@ -300,7 +317,6 @@ struct QgsWmsLayerProperty
|
||||
QStringList crs; // coord ref sys
|
||||
QgsRectangle ex_GeographicBoundingBox;
|
||||
QVector<QgsWmsBoundingBoxProperty> boundingBoxes;
|
||||
QVector<QgsWmsDimensionProperty> dimension;
|
||||
QgsWmsAttributionProperty attribution;
|
||||
QVector<QgsWmsAuthorityUrlProperty> authorityUrl;
|
||||
QVector<QgsWmsIdentifierProperty> identifier;
|
||||
@ -334,6 +350,84 @@ struct QgsWmsLayerProperty
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if it the struct has the dimension with the passed name
|
||||
*/
|
||||
bool hasDimension( QString dimensionName ) const
|
||||
{
|
||||
if ( dimensions.isEmpty() )
|
||||
return false;
|
||||
|
||||
for ( const QgsWmsDimensionProperty &dimension : qgis::as_const( dimensions ) )
|
||||
{
|
||||
if ( dimension.name == dimensionName )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Stores the dates part from the WMS-T dimension extent.
|
||||
*
|
||||
* Here a date with no time precision is not equal with
|
||||
* a date with same year, month and day but with time precision.
|
||||
* eg. 2020-01-02 is not equal to 2020-01-02T00:00:00
|
||||
*
|
||||
* Hence this struct has two hash date members to acccount for the difference.
|
||||
*
|
||||
*
|
||||
*/
|
||||
struct QgsWmstDates
|
||||
{
|
||||
QList< QDateTime > dateTimes;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stores resolution part of the WMS-T dimension extent.
|
||||
*
|
||||
* If resolution does not exist, active() will return false;
|
||||
*/
|
||||
struct QgsWmstResolution
|
||||
{
|
||||
int year = -1;
|
||||
int month = -1;
|
||||
int day = -1;
|
||||
|
||||
int hour = -1;
|
||||
int minutes = -1;
|
||||
int seconds = -1;
|
||||
|
||||
bool active()
|
||||
{
|
||||
return year != -1 && month != -1 && day != -1 &&
|
||||
hour != -1 && minutes != -1 && seconds != -1;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct QgsWmstExtentPair
|
||||
{
|
||||
QgsWmstExtentPair()
|
||||
{
|
||||
}
|
||||
QgsWmstExtentPair( QgsWmstDates otherDates, QgsWmstResolution otherResolution )
|
||||
{
|
||||
dates = otherDates;
|
||||
resolution = otherResolution;
|
||||
}
|
||||
QgsWmstDates dates;
|
||||
QgsWmstResolution resolution;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Stores the WMS-T dimension extent.
|
||||
*/
|
||||
struct QgsWmstDimensionExtent
|
||||
{
|
||||
QList <QgsWmstExtentPair> datesResolutionList;
|
||||
};
|
||||
|
||||
struct QgsWmtsTheme
|
||||
@ -595,6 +689,21 @@ class QgsWmsSettings
|
||||
|
||||
QgsWmsParserSettings parserSettings() const { return mParserSettings; }
|
||||
|
||||
/**
|
||||
* Parse the given string extent into a well defined dates and resolution structures
|
||||
*/
|
||||
QgsDateTimeRange parseTemporalExtent( QgsWmstDimensionExtent dimensionExtent, QString extent );
|
||||
|
||||
/**
|
||||
* Parse the given string item into a resolution structure
|
||||
*/
|
||||
QgsWmstResolution parseWmstResolution( QString item );
|
||||
|
||||
/**
|
||||
* Parse the given string item into QDateTime instant
|
||||
*/
|
||||
QDateTime parseWmstDateTimes( QString item );
|
||||
|
||||
protected:
|
||||
QgsWmsParserSettings mParserSettings;
|
||||
|
||||
@ -602,6 +711,25 @@ class QgsWmsSettings
|
||||
bool mTiled;
|
||||
//! whether we actually work with XYZ tiles instead of WMS / WMTS
|
||||
bool mXyz;
|
||||
|
||||
//! Whether we are dealing with WMS-T
|
||||
bool mIsTemporal = false;
|
||||
|
||||
//! Temporal extent from dimension property in WMS-T
|
||||
QString mTemporalExtent;
|
||||
|
||||
//! Fixed temporal range for the data provider
|
||||
QgsDateTimeRange mFixedRange;
|
||||
|
||||
//! Fixed reference temporal range for the data provider
|
||||
QgsDateTimeRange mFixedReferenceRange;
|
||||
|
||||
//! Stores WMS-T time dimension extent dates
|
||||
QgsWmstDimensionExtent mTimeDimensionExtent;
|
||||
|
||||
//! Stores WMS-T reference dimension extent dates
|
||||
QgsWmstDimensionExtent mReferenceTimeDimensionExtent;
|
||||
|
||||
//! whether we are dealing with MBTiles file rather than using network-based tiles
|
||||
bool mIsMBTiles = false;
|
||||
//! chosen values for dimensions in case of multi-dimensional data (key=dim id, value=dim value)
|
||||
|
@ -365,6 +365,21 @@ QString QgsWMSLayerItem::createUri()
|
||||
QString style = !mLayerProperty.style.isEmpty() ? mLayerProperty.style.at( 0 ).name : QString();
|
||||
mDataSourceUri.setParam( QStringLiteral( "styles" ), style );
|
||||
|
||||
// Check for layer dimensions
|
||||
if ( !mLayerProperty.dimensions.empty() )
|
||||
{
|
||||
for ( const QgsWmsDimensionProperty &dimension : qgis::as_const( mLayerProperty.dimensions ) )
|
||||
{
|
||||
// add temporal dimensions only
|
||||
if ( dimension.name == "time" || dimension.name == "reference_time" )
|
||||
{
|
||||
if ( !( mDataSourceUri.param( "type" ) == "wmst" ) )
|
||||
mDataSourceUri.setParam( "type", "wmst" );
|
||||
mDataSourceUri.setParam( dimension.name, dimension.extent );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString format;
|
||||
// get first supported by qt and server
|
||||
QVector<QgsWmsSupportedFormat> formats( QgsWmsProvider::supportedFormats() );
|
||||
|
@ -150,6 +150,12 @@ QgsWmsProvider::QgsWmsProvider( QString const &uri, const ProviderOptions &optio
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Setup temporal properties for layers in WMS-T
|
||||
if ( mSettings.mIsTemporal )
|
||||
{
|
||||
temporalProperties()->setFixedTemporalRange( mSettings.mFixedRange );
|
||||
}
|
||||
}
|
||||
|
||||
// setImageCrs is using mTiled !!!
|
||||
@ -208,10 +214,10 @@ QgsWmsProvider *QgsWmsProvider::clone() const
|
||||
QgsDataProvider::ProviderOptions options;
|
||||
QgsWmsProvider *provider = new QgsWmsProvider( dataSourceUri(), options, mCaps.isValid() ? &mCaps : nullptr );
|
||||
provider->copyBaseSettings( *this );
|
||||
|
||||
return provider;
|
||||
}
|
||||
|
||||
|
||||
QString QgsWmsProvider::getMapUrl() const
|
||||
{
|
||||
return mCaps.mCapabilities.capability.request.getMap.dcpType.isEmpty()
|
||||
@ -1031,6 +1037,47 @@ QUrl QgsWmsProvider::createRequestUrlWMS( const QgsRectangle &viewExtent, int pi
|
||||
setQueryItem( query, QStringLiteral( "HEIGHT" ), QString::number( pixelHeight ) );
|
||||
setQueryItem( query, QStringLiteral( "LAYERS" ), layers );
|
||||
setQueryItem( query, QStringLiteral( "STYLES" ), styles );
|
||||
|
||||
// For WMS-T layers
|
||||
if ( temporalProperties()->isActive() )
|
||||
{
|
||||
QgsDateTimeRange range = temporalProperties()->temporalRange();
|
||||
QString format = "yyyy-MM-ddThh:mm:ssZ";
|
||||
|
||||
if ( !temporalProperties()->isTimeEnabled() )
|
||||
format = "yyyy-MM-dd";
|
||||
|
||||
if ( range.begin().isValid() && range.end().isValid() )
|
||||
{
|
||||
if ( range.begin() == range.end() )
|
||||
setQueryItem( query, QStringLiteral( "TIME" ), range.begin().toString( format ) );
|
||||
else
|
||||
{
|
||||
QString extent = range.begin().toString( format );
|
||||
extent.append( "/" );
|
||||
extent.append( range.end().toString( format ) );
|
||||
|
||||
setQueryItem( query, QStringLiteral( "TIME" ), extent );
|
||||
}
|
||||
}
|
||||
// If the data provider has bi-temporal properties,
|
||||
if ( temporalProperties()->hasReference() )
|
||||
{
|
||||
QgsDateTimeRange referenceRange = temporalProperties()->referenceTemporalRange();
|
||||
|
||||
if ( referenceRange.begin() == referenceRange.end() )
|
||||
setQueryItem( query, QStringLiteral( "DIM_REFERENCE" ), range.begin().toString( format ) );
|
||||
else
|
||||
{
|
||||
QString extent = referenceRange.begin().toString( format );
|
||||
extent.append( "/" );
|
||||
extent.append( referenceRange.end().toString( format ) );
|
||||
|
||||
setQueryItem( query, QStringLiteral( "DIM_REFERENCE" ), extent );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setFormatQueryItem( query );
|
||||
|
||||
if ( mDpi != -1 )
|
||||
@ -1675,7 +1722,6 @@ bool QgsWmsProvider::isValid() const
|
||||
return mValid;
|
||||
}
|
||||
|
||||
|
||||
QString QgsWmsProvider::wmsVersion()
|
||||
{
|
||||
// TODO
|
||||
|
@ -157,6 +157,12 @@ class QgsWmsProvider final: public QgsRasterDataProvider
|
||||
|
||||
bool isValid() const override;
|
||||
|
||||
/**
|
||||
* Converts temporal dimension extent string from WMS-T capabilities
|
||||
* to a QgsDateTimeRange instant
|
||||
*/
|
||||
QgsDateTimeRange parseTemporalExtent( QString extent );
|
||||
|
||||
#if 0
|
||||
|
||||
/**
|
||||
@ -471,6 +477,9 @@ class QgsWmsProvider final: public QgsRasterDataProvider
|
||||
//! User's settings (URI, authorization, layer, style, ...)
|
||||
QgsWmsSettings mSettings;
|
||||
|
||||
//! Temporal range member
|
||||
QgsDateTimeRange mRange;
|
||||
|
||||
QList< double > mNativeResolutions;
|
||||
|
||||
friend class TestQgsWmsProvider;
|
||||
|
@ -14,6 +14,7 @@ FILE(GLOB _3D_UIS "${CMAKE_CURRENT_SOURCE_DIR}/3d/*.ui")
|
||||
FILE(GLOB CALLOUT_UIS "${CMAKE_CURRENT_SOURCE_DIR}/callouts/*.ui")
|
||||
FILE(GLOB NUMERICFORMAT_UIS "${CMAKE_CURRENT_SOURCE_DIR}/numericformats/*.ui")
|
||||
FILE(GLOB ATTRIBUTEFORMCONFIG_UIS "${CMAKE_CURRENT_SOURCE_DIR}/attributeformconfig/*.ui")
|
||||
FILE(GLOB TEMPORALWIDGET_UIS "${CMAKE_CURRENT_SOURCE_DIR}/temporalwidgets/*.ui")
|
||||
|
||||
QT5_WRAP_UI(QGIS_UIS_H
|
||||
${QGIS_UIS}
|
||||
@ -30,7 +31,11 @@ QT5_WRAP_UI(QGIS_UIS_H
|
||||
${CALLOUT_UIS}
|
||||
${LABELING_UIS}
|
||||
${NUMERICFORMAT_UIS}
|
||||
<<<<<<< HEAD
|
||||
${ATTRIBUTEFORMCONFIG_UIS}
|
||||
=======
|
||||
${TEMPORALWIDGET_UIS}
|
||||
>>>>>>> f18db092fc... added temporal widget ui
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(ui ALL DEPENDS ${QGIS_UIS_H})
|
||||
|
@ -97,7 +97,7 @@
|
||||
<string>Information</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/metadata.svg</normaloff>:/images/themes/default/propertyicons/metadata.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -106,7 +106,7 @@
|
||||
<string>Source</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/system.svg</normaloff>:/images/themes/default/propertyicons/system.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -118,7 +118,7 @@
|
||||
<string>Symbology</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/symbology.svg</normaloff>:/images/themes/default/propertyicons/symbology.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -130,7 +130,7 @@
|
||||
<string>Transparency</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/transparency.svg</normaloff>:/images/themes/default/propertyicons/transparency.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -142,7 +142,7 @@
|
||||
<string>Histogram</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/histogram.svg</normaloff>:/images/themes/default/propertyicons/histogram.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -154,7 +154,7 @@
|
||||
<string>Rendering</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/rendering.svg</normaloff>:/images/themes/default/propertyicons/rendering.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -166,7 +166,7 @@
|
||||
<string>Pyramids</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/pyramids.svg</normaloff>:/images/themes/default/propertyicons/pyramids.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -175,7 +175,7 @@
|
||||
<string>Metadata</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/editmetadata.svg</normaloff>:/images/themes/default/propertyicons/editmetadata.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -184,7 +184,7 @@
|
||||
<string>Legend</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/legend.svg</normaloff>:/images/themes/default/legend.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -196,7 +196,7 @@
|
||||
<string>Edit QGIS Server settings</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/propertyicons/overlay.svg</normaloff>:/images/themes/default/propertyicons/overlay.svg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
@ -239,7 +239,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mOptsPage_Information">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_20">
|
||||
@ -275,8 +275,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>261</width>
|
||||
<height>92</height>
|
||||
<width>643</width>
|
||||
<height>681</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
@ -329,21 +329,43 @@ border-radius: 2px;</string>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QgsProjectionSelectionWidget" name="mCrsSelector" native="true">
|
||||
<widget class="QgsProjectionSelectionWidget" name="mCrsSelector">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="temporalFrame">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>450</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>415</height>
|
||||
<width>17</width>
|
||||
<height>111</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
@ -381,8 +403,8 @@ border-radius: 2px;</string>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>512</width>
|
||||
<height>502</height>
|
||||
<width>533</width>
|
||||
<height>524</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
@ -397,7 +419,7 @@ border-radius: 2px;</string>
|
||||
<property name="title">
|
||||
<string>Band Rendering</string>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rasterstyle</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_14">
|
||||
@ -442,13 +464,13 @@ border-radius: 2px;</string>
|
||||
<property name="title">
|
||||
<string>Color Rendering</string>
|
||||
</property>
|
||||
<property name="collapsed" stdset="0">
|
||||
<property name="collapsed">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rasterstyle</string>
|
||||
</property>
|
||||
<property name="saveCollapsedState" stdset="0">
|
||||
<property name="saveCollapsedState">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
@ -701,7 +723,7 @@ border-radius: 2px;</string>
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionUndo.svg</normaloff>:/images/themes/default/mActionUndo.svg</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
@ -744,13 +766,13 @@ border-radius: 2px;</string>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="collapsed" stdset="0">
|
||||
<property name="collapsed">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rasterstyle</string>
|
||||
</property>
|
||||
<property name="saveCollapsedState" stdset="0">
|
||||
<property name="saveCollapsedState">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
@ -969,8 +991,8 @@ border-radius: 2px;</string>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>348</width>
|
||||
<height>446</height>
|
||||
<width>361</width>
|
||||
<height>476</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
@ -985,12 +1007,12 @@ border-radius: 2px;</string>
|
||||
<property name="title">
|
||||
<string>Global Opacity</string>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rastertransp</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_13">
|
||||
<item row="0" column="0">
|
||||
<widget class="QgsOpacityWidget" name="mOpacityWidget" native="true">
|
||||
<widget class="QgsOpacityWidget" name="mOpacityWidget">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
@ -1004,7 +1026,7 @@ border-radius: 2px;</string>
|
||||
<property name="title">
|
||||
<string>No Data Value</string>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rastertransp</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_11">
|
||||
@ -1076,7 +1098,7 @@ border-radius: 2px;</string>
|
||||
<property name="title">
|
||||
<string>Custom Transparency Options</string>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rastertransp</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
@ -1167,7 +1189,7 @@ border-radius: 2px;</string>
|
||||
<string>…</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/symbologyAdd.svg</normaloff>:/images/themes/default/symbologyAdd.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -1184,7 +1206,7 @@ border-radius: 2px;</string>
|
||||
<string>…</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionContextHelp.png</normaloff>:/images/themes/default/mActionContextHelp.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -1198,7 +1220,7 @@ border-radius: 2px;</string>
|
||||
<string>…</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/symbologyRemove.svg</normaloff>:/images/themes/default/symbologyRemove.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -1212,7 +1234,7 @@ border-radius: 2px;</string>
|
||||
<string>…</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionOpenTable.svg</normaloff>:/images/themes/default/mActionOpenTable.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -1226,7 +1248,7 @@ border-radius: 2px;</string>
|
||||
<string>…</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionFileOpen.svg</normaloff>:/images/themes/default/mActionFileOpen.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -1240,7 +1262,7 @@ border-radius: 2px;</string>
|
||||
<string>…</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionFileSave.svg</normaloff>:/images/themes/default/mActionFileSave.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -1317,7 +1339,7 @@ border-radius: 2px;</string>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>98</width>
|
||||
<height>42</height>
|
||||
<height>44</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
@ -1361,7 +1383,7 @@ border-radius: 2px;</string>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rastergeneral</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="_5">
|
||||
@ -1381,7 +1403,7 @@ border-radius: 2px;</string>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QgsScaleRangeWidget" name="mScaleRangeWidget" native="true">
|
||||
<widget class="QgsScaleRangeWidget" name="mScaleRangeWidget">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
@ -1481,8 +1503,8 @@ border-radius: 2px;</string>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>553</width>
|
||||
<height>193</height>
|
||||
<width>597</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
@ -1545,8 +1567,8 @@ border-radius: 2px;</string>
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:11pt;"><br /></span></p></body></html></string>
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell';"><br /></span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1681,8 +1703,8 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>324</width>
|
||||
<height>634</height>
|
||||
<width>388</width>
|
||||
<height>668</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
@ -1691,7 +1713,7 @@ p, li { white-space: pre-wrap; }
|
||||
<property name="title">
|
||||
<string>Description</string>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rastermeta</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
@ -1827,7 +1849,7 @@ p, li { white-space: pre-wrap; }
|
||||
<property name="title">
|
||||
<string>Attribution</string>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">vectormeta</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
@ -1873,7 +1895,7 @@ p, li { white-space: pre-wrap; }
|
||||
<property name="title">
|
||||
<string>MetadataUrl</string>
|
||||
</property>
|
||||
<property name="syncGroup" stdset="0">
|
||||
<property name="syncGroup">
|
||||
<string notr="true">vectormeta</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_9">
|
||||
@ -2137,29 +2159,34 @@ p, li { white-space: pre-wrap; }
|
||||
<extends>QLineEdit</extends>
|
||||
<header>qgsfilterlineedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsProjectionSelectionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsprojectionselectionwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsScrollArea</class>
|
||||
<extends>QScrollArea</extends>
|
||||
<header>qgsscrollarea.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsOpacityWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsopacitywidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsProjectionSelectionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsprojectionselectionwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsRasterBandComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>qgsrasterbandcombobox.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsScaleRangeWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsscalerangewidget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsScrollArea</class>
|
||||
<extends>QScrollArea</extends>
|
||||
<header>qgsscrollarea.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsLayerTreeEmbeddedConfigWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
@ -2171,11 +2198,6 @@ p, li { white-space: pre-wrap; }
|
||||
<extends>QComboBox</extends>
|
||||
<header>qgsblendmodecombobox.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsRasterBandComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>qgsrasterbandcombobox.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsWebView</class>
|
||||
<extends>QWidget</extends>
|
||||
@ -2186,7 +2208,6 @@ p, li { white-space: pre-wrap; }
|
||||
<tabstops>
|
||||
<tabstop>mSearchLineEdit</tabstop>
|
||||
<tabstop>mOptionsListWidget</tabstop>
|
||||
<tabstop>scrollArea_3</tabstop>
|
||||
<tabstop>mLayerOrigNameLineEd</tabstop>
|
||||
<tabstop>leDisplayName</tabstop>
|
||||
<tabstop>mCrsSelector</tabstop>
|
||||
@ -2248,7 +2269,9 @@ p, li { white-space: pre-wrap; }
|
||||
<tabstop>mPublishDataSourceUrlCheckBox</tabstop>
|
||||
<tabstop>mBackgroundLayerCheckBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../images/images.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>mOptionsListWidget</sender>
|
||||
|
591
src/ui/temporalwidgets/qgstemporallayerwidgetbase.ui
Normal file
591
src/ui/temporalwidgets/qgstemporallayerwidgetbase.ui
Normal file
@ -0,0 +1,591 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsTemporalLayerWidgetBase</class>
|
||||
<widget class="QWidget" name="QgsTemporalLayerWidgetBase">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>752</width>
|
||||
<height>787</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsScrollArea" name="scrollArea">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>752</width>
|
||||
<height>787</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsCollapsibleGroupBox" name="mTemporalGroupBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}
|
||||
background: white;QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; margin-left: 20px; margin-right: 5px; left: 0px; top: 1px;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Temporal</string>
|
||||
</property>
|
||||
<property name="collapsed">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="syncGroup">
|
||||
<string notr="true">rastertransp</string>
|
||||
</property>
|
||||
<property name="saveCollapsedState">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_5">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
<item>
|
||||
<widget class="QLabel" name="mRangeLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:rgb(46, 52, 54);
|
||||
</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="mLayerRadioButton">
|
||||
<property name="text">
|
||||
<string>Specify time range</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="startTemporalDateTimeGroupBox">
|
||||
<property name="title">
|
||||
<string>Start date</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<item>
|
||||
<widget class="QDateTimeEdit" name="mStartTemporalDateTimeEdit">
|
||||
<property name="dateTime">
|
||||
<datetime>
|
||||
<hour>0</hour>
|
||||
<minute>0</minute>
|
||||
<second>0</second>
|
||||
<year>2020</year>
|
||||
<month>1</month>
|
||||
<day>1</day>
|
||||
</datetime>
|
||||
</property>
|
||||
<property name="date">
|
||||
<date>
|
||||
<year>2020</year>
|
||||
<month>1</month>
|
||||
<day>1</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="displayFormat">
|
||||
<string>M.d.yy h:mm AP</string>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="endTemporalDateTimeGroupBox">
|
||||
<property name="title">
|
||||
<string>End date</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QDateTimeEdit" name="mEndTemporalDateTimeEdit">
|
||||
<property name="dateTime">
|
||||
<datetime>
|
||||
<hour>0</hour>
|
||||
<minute>0</minute>
|
||||
<second>0</second>
|
||||
<year>2020</year>
|
||||
<month>12</month>
|
||||
<day>31</day>
|
||||
</datetime>
|
||||
</property>
|
||||
<property name="date">
|
||||
<date>
|
||||
<year>2020</year>
|
||||
<month>12</month>
|
||||
<day>31</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="time">
|
||||
<time>
|
||||
<hour>0</hour>
|
||||
<minute>0</minute>
|
||||
<second>0</second>
|
||||
</time>
|
||||
</property>
|
||||
<property name="displayFormat">
|
||||
<string>M.d.yy h:mm AP</string>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_4">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_21">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="mDisableTime">
|
||||
<property name="text">
|
||||
<string>Use date only</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>110</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="mSetEndAsStartNormalButton">
|
||||
<property name="text">
|
||||
<string>Set end same as start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>674</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background: transparent;</string>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Note: If the capabilities of this layer move out of this time range, the range will be reset to layer's advertised default layer time range.</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="mProjectRadioButton">
|
||||
<property name="text">
|
||||
<string>Use Project time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_7">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-size:12px;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>If this option is checked, project time will be used to determine time range.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_6">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
<item>
|
||||
<widget class="QgsCollapsibleGroupBox" name="mAdvancedGroupBox">
|
||||
<property name="title">
|
||||
<string>Advanced</string>
|
||||
</property>
|
||||
<property name="collapsed">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="mReferenceCheckBox">
|
||||
<property name="text">
|
||||
<string>Use Reference time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_18">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-size:12px;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Filter layer temporal properties based on the time when product model ran. </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_10">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_9">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_19">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="startReferenceDateTimeGroupBox">
|
||||
<property name="title">
|
||||
<string>Start date</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||
<item>
|
||||
<widget class="QDateTimeEdit" name="mStartReferenceDateTimeEdit">
|
||||
<property name="dateTime">
|
||||
<datetime>
|
||||
<hour>0</hour>
|
||||
<minute>0</minute>
|
||||
<second>0</second>
|
||||
<year>2020</year>
|
||||
<month>1</month>
|
||||
<day>1</day>
|
||||
</datetime>
|
||||
</property>
|
||||
<property name="date">
|
||||
<date>
|
||||
<year>2020</year>
|
||||
<month>1</month>
|
||||
<day>1</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="displayFormat">
|
||||
<string>M.d.yy h:mm AP</string>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="endReferenceDateTimeGroupBox">
|
||||
<property name="title">
|
||||
<string>End date</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||
<item>
|
||||
<widget class="QDateTimeEdit" name="mEndReferenceDateTimeEdit">
|
||||
<property name="dateTime">
|
||||
<datetime>
|
||||
<hour>0</hour>
|
||||
<minute>0</minute>
|
||||
<second>0</second>
|
||||
<year>2020</year>
|
||||
<month>12</month>
|
||||
<day>31</day>
|
||||
</datetime>
|
||||
</property>
|
||||
<property name="date">
|
||||
<date>
|
||||
<year>2020</year>
|
||||
<month>12</month>
|
||||
<day>31</day>
|
||||
</date>
|
||||
</property>
|
||||
<property name="time">
|
||||
<time>
|
||||
<hour>0</hour>
|
||||
<minute>0</minute>
|
||||
<second>0</second>
|
||||
</time>
|
||||
</property>
|
||||
<property name="displayFormat">
|
||||
<string>M.d.yy h:mm AP</string>
|
||||
</property>
|
||||
<property name="calendarPopup">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_8">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="mSetEndAsStartReferenceButton">
|
||||
<property name="text">
|
||||
<string>Set end same as start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QgsCollapsibleGroupBox</class>
|
||||
<extends>QGroupBox</extends>
|
||||
<header>qgscollapsiblegroupbox.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsScrollArea</class>
|
||||
<extends>QScrollArea</extends>
|
||||
<header>qgsscrollarea.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -224,8 +224,12 @@ SET(TESTS
|
||||
testqgssvgmarker.cpp
|
||||
testqgssymbol.cpp
|
||||
testqgstaskmanager.cpp
|
||||
<<<<<<< HEAD
|
||||
testqgstemporalproperty.cpp
|
||||
testqgstemporalrangeobject.cpp
|
||||
=======
|
||||
testqgsabstracttemporal.cpp
|
||||
>>>>>>> de9992479d... updates on tests and abstract temporal class
|
||||
testqgstracer.cpp
|
||||
testqgstriangularmesh.cpp
|
||||
testqgsfontutils.cpp
|
||||
|
@ -113,7 +113,8 @@ class TestQgsRasterLayer : public QObject
|
||||
QgsRasterLayer *mpFloat32RasterLayer = nullptr;
|
||||
QgsRasterLayer *mPngRasterLayer = nullptr;
|
||||
QgsRasterLayer *mGeoJp2RasterLayer = nullptr;
|
||||
QgsRasterLayer *mTemporalRasterLayer = nullptr;
|
||||
|
||||
QgsRasterLayerTemporalProperties *temporalProperties = nullptr;
|
||||
|
||||
QgsMapSettings *mMapSettings = nullptr;
|
||||
QString mReport;
|
||||
@ -194,8 +195,6 @@ void TestQgsRasterLayer::initTestCase()
|
||||
mReport += QLatin1String( "<h1>Raster Layer Tests</h1>\n" );
|
||||
mReport += "<p>" + mySettings + "</p>";
|
||||
|
||||
mTemporalRasterLayer = new QgsRasterLayer();
|
||||
|
||||
}
|
||||
//runs after all tests
|
||||
void TestQgsRasterLayer::cleanupTestCase()
|
||||
@ -1005,35 +1004,40 @@ void TestQgsRasterLayer::sample()
|
||||
|
||||
void TestQgsRasterLayer::testTemporalProperties()
|
||||
{
|
||||
QgsRasterLayerTemporalProperties *temporalProperties = mTemporalRasterLayer->temporalProperties();
|
||||
QVERIFY( !mTemporalRasterLayer->temporalProperties()->isActive() );
|
||||
QgsRasterLayerTemporalProperties *temporalProperties = mpRasterLayer->temporalProperties();
|
||||
QVERIFY( !mpRasterLayer->temporalProperties()->isActive() );
|
||||
|
||||
QgsDateTimeRange dateTimeRange = QgsDateTimeRange( QDateTime( QDate( 2020, 1, 1 ) ),
|
||||
QDateTime( QDate( 2020, 12, 31 ) ) );
|
||||
|
||||
temporalProperties->setFixedTemporalRange( dateTimeRange );
|
||||
|
||||
QCOMPARE( mTemporalRasterLayer->temporalProperties()->fixedTemporalRange().begin(), dateTimeRange.begin() );
|
||||
QCOMPARE( mTemporalRasterLayer->temporalProperties()->fixedTemporalRange().end(), dateTimeRange.end() );
|
||||
QCOMPARE( mpRasterLayer->temporalProperties()->fixedTemporalRange(), dateTimeRange );
|
||||
|
||||
// writing and reading from xml
|
||||
QDomDocument document;
|
||||
QDomElement elementRoot = document.createElement( "maplayer" );
|
||||
QDomElement elementRoot = document.createElement( "qgis" );
|
||||
document.appendChild( elementRoot );
|
||||
|
||||
QCOMPARE( temporalProperties->mode(), QgsRasterLayerTemporalProperties::TemporalMode::ModeFixedTemporalRange );
|
||||
|
||||
temporalProperties->setMode( QgsRasterLayerTemporalProperties::TemporalMode::ModeTemporalRangesList );
|
||||
|
||||
// Change temporal properties, save the xml
|
||||
QDomElement element = temporalProperties->writeXml( elementRoot, document, QgsReadWriteContext() );
|
||||
|
||||
// Restore
|
||||
QVERIFY( temporalProperties->readXml( element, QgsReadWriteContext() ) );
|
||||
QCOMPARE( temporalProperties->mode(), QgsRasterLayerTemporalProperties::TemporalMode::ModeFixedTemporalRange );
|
||||
|
||||
// Change temporal properties, save the xml
|
||||
temporalProperties->setMode( QgsRasterLayerTemporalProperties::TemporalMode::ModeTemporalRangesList );
|
||||
element = temporalProperties->writeXml( elementRoot, document, QgsReadWriteContext() );
|
||||
|
||||
// set mode without saving to xml
|
||||
temporalProperties->setMode( QgsRasterLayerTemporalProperties::TemporalMode::ModeFixedTemporalRange );
|
||||
|
||||
QCOMPARE( temporalProperties->mode(), QgsRasterLayerTemporalProperties::TemporalMode::ModeFixedTemporalRange );
|
||||
|
||||
// Read the xml and test if the old saved mode is restored
|
||||
QVERIFY( temporalProperties->readXml( element, QgsReadWriteContext() ) );
|
||||
QCOMPARE( temporalProperties->mode(), QgsRasterLayerTemporalProperties::TemporalMode::ModeTemporalRangesList );
|
||||
|
||||
QCOMPARE( mTemporalRasterLayer->temporalProperties()->fixedTemporalRange().begin(), dateTimeRange.begin() );
|
||||
QCOMPARE( mTemporalRasterLayer->temporalProperties()->fixedTemporalRange().end(), dateTimeRange.end() );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user