QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsvectorlayerserverproperties.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayerserverproperties.h
3  ------------------
4  begin : August 23, 2019
5  copyright : (C) 2019 by RenĂ©-Luc D'Hont
6  email : rldhont at 3liz dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSVECTORLAYERSERVERPROPERTIES_H
19 #define QGSVECTORLAYERSERVERPROPERTIES_H
20 
21 #include "qgis_sip.h"
22 #include "qgis_core.h"
23 #include <QMap>
24 #include <QString>
25 #include <QMetaType>
26 #include <QVariant>
27 
28 class QgsVectorLayer;
29 
30 class QDomNode;
31 class QDomDocument;
32 
39 {
40  Q_GADGET
41 
42  public:
43 
49  {
52  ELEVATION
53  };
54  Q_ENUM( PredefinedWmsDimensionName )
55 
56 
60  struct CORE_EXPORT WmsDimensionInfo
61  {
62 
68  {
69  AllValues = 0,
70  MinValue = 1,
71  MaxValue = 2,
72  ReferenceValue = 3,
73  };
74 
78  explicit WmsDimensionInfo( const QString &dimName,
79  const QString &dimFieldName,
80  const QString &dimEndFieldName = QString(),
81  const QString &dimUnits = QString(),
82  const QString &dimUnitSymbol = QString(),
83  const int &dimDefaultDisplayType = QgsVectorLayerServerProperties::WmsDimensionInfo::AllValues,
84  const QVariant &dimReferenceValue = QVariant() )
85  : name( dimName )
86  , fieldName( dimFieldName )
87  , endFieldName( dimEndFieldName )
88  , units( dimUnits )
89  , unitSymbol( dimUnitSymbol )
90  , defaultDisplayType( dimDefaultDisplayType )
91  , referenceValue( dimReferenceValue )
92  {}
93  QString name;
94  QString fieldName;
95  QString endFieldName;
96  QString units;
97  QString unitSymbol;
99  QVariant referenceValue;
100  };
101 
108 
113  static QMap<int, QString> wmsDimensionDefaultDisplayLabels();
114 
121  bool addWmsDimension( const QgsVectorLayerServerProperties::WmsDimensionInfo &wmsDimInfo );
122 
128  bool removeWmsDimension( const QString &wmsDimName );
129 
134  const QList<QgsVectorLayerServerProperties::WmsDimensionInfo> wmsDimensions() const;
135 
136 
141  void writeXml( QDomNode &layer_node, QDomDocument &document ) const;
142 
147  void readXml( const QDomNode &layer_node );
148 
149  private: // Private attributes
150 
151  QgsVectorLayer *mLayer = nullptr;
152 
154  QList<QgsVectorLayerServerProperties::WmsDimensionInfo> mWmsDimensions;
155 };
156 
157 #endif // QGSVECTORLAYERSERVERPROPERTIES_H
QgsVectorLayerServerProperties::WmsDimensionInfo::WmsDimensionInfo
WmsDimensionInfo(const QString &dimName, const QString &dimFieldName, const QString &dimEndFieldName=QString(), const QString &dimUnits=QString(), const QString &dimUnitSymbol=QString(), const int &dimDefaultDisplayType=QgsVectorLayerServerProperties::WmsDimensionInfo::AllValues, const QVariant &dimReferenceValue=QVariant())
Constructor for WmsDimensionInfo.
Definition: qgsvectorlayerserverproperties.h:78
QgsVectorLayerServerProperties::WmsDimensionInfo::defaultDisplayType
int defaultDisplayType
Definition: qgsvectorlayerserverproperties.h:98
QgsVectorLayerServerProperties
Manages QGIS Server properties for a vector layer.
Definition: qgsvectorlayerserverproperties.h:39
QgsVectorLayerServerProperties::WmsDimensionInfo
Setting to define QGIS Server WMS Dimension.
Definition: qgsvectorlayerserverproperties.h:61
QgsVectorLayerServerProperties::TIME
@ TIME
Definition: qgsvectorlayerserverproperties.h:50
QgsVectorLayerServerProperties::PredefinedWmsDimensionName
PredefinedWmsDimensionName
Predefined/Restricted WMS Dimension name.
Definition: qgsvectorlayerserverproperties.h:49
QgsVectorLayerServerProperties::WmsDimensionInfo::referenceValue
QVariant referenceValue
Definition: qgsvectorlayerserverproperties.h:99
QgsVectorLayerServerProperties::WmsDimensionInfo::name
QString name
Definition: qgsvectorlayerserverproperties.h:93
qgis_sip.h
QgsVectorLayerServerProperties::WmsDimensionInfo::DefaultDisplay
DefaultDisplay
Selection behavior for QGIS Server WMS Dimension default display.
Definition: qgsvectorlayerserverproperties.h:68
QgsVectorLayerServerProperties::WmsDimensionInfo::endFieldName
QString endFieldName
Definition: qgsvectorlayerserverproperties.h:95
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
QgsVectorLayerServerProperties::WmsDimensionInfo::fieldName
QString fieldName
Definition: qgsvectorlayerserverproperties.h:94
QgsVectorLayerServerProperties::DATE
@ DATE
Definition: qgsvectorlayerserverproperties.h:51
QgsVectorLayerServerProperties::WmsDimensionInfo::AllValues
@ AllValues
Display all values of the dimension.
Definition: qgsvectorlayerserverproperties.h:69
QgsVectorLayerServerProperties::WmsDimensionInfo::units
QString units
Definition: qgsvectorlayerserverproperties.h:96
QgsVectorLayerServerProperties::WmsDimensionInfo::unitSymbol
QString unitSymbol
Definition: qgsvectorlayerserverproperties.h:97