Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
134 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*************************************************************************** | ||
qgsdimensionfilter.cpp | ||
------------------- | ||
begin : September 2021 | ||
copyright : (C) 2021 Matthias Kuhn | ||
email : matthias@opengis.ch | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* 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 "qgsdimensionfilter.h" | ||
|
||
QgsDimensionFilter::QgsDimensionFilter( const QMap<const QgsVectorLayer *, QStringList> dimensionFilter ) | ||
: mDimensionFilter( dimensionFilter ) | ||
{ | ||
|
||
} | ||
|
||
void QgsDimensionFilter::filterFeatures( const QgsVectorLayer *layer, QgsFeatureRequest &featureRequest ) const | ||
{ | ||
const QStringList dimFilters = mDimensionFilter.value( layer ); | ||
|
||
for ( const QString &flt : dimFilters ) | ||
featureRequest.combineFilterExpression( flt ); | ||
} | ||
|
||
QStringList QgsDimensionFilter::layerAttributes( const QgsVectorLayer *layer, const QStringList &attributes ) const | ||
{ | ||
Q_UNUSED( layer ) | ||
return attributes; | ||
} | ||
|
||
QgsDimensionFilter *QgsDimensionFilter::clone() const | ||
{ | ||
return new QgsDimensionFilter( mDimensionFilter ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*************************************************************************** | ||
qgsdimensionfilter.h | ||
------------------- | ||
begin : September 2021 | ||
copyright : (C) 2021 Matthias Kuhn | ||
email : matthias@opengis.ch | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* 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 QGSDIMENSIONFILTER_H | ||
#define QGSDIMENSIONFILTER_H | ||
|
||
#define SIP_NO_FILE | ||
|
||
#include "qgsfeaturefilterprovider.h" | ||
#include "qgis_server.h" | ||
|
||
/** | ||
* \ingroup server | ||
* \class QgsDimensionFilter | ||
* \brief A server filter to apply a dimension filter to a request | ||
* \since QGIS 3.22 | ||
*/ | ||
class SERVER_EXPORT QgsDimensionFilter : public QgsFeatureFilterProvider | ||
{ | ||
public: | ||
|
||
/** | ||
* Creates a new dimension filter object with a list of filters to be applied to | ||
* vector layers. | ||
*/ | ||
QgsDimensionFilter( const QMap<const QgsVectorLayer *, QStringList> dimensionFilter ); | ||
|
||
void filterFeatures( const QgsVectorLayer *layer, QgsFeatureRequest &filterFeatures ) const override; | ||
QStringList layerAttributes( const QgsVectorLayer *layer, const QStringList &attributes ) const override; | ||
QgsDimensionFilter *clone() const override; | ||
private: | ||
QMap<const QgsVectorLayer *, QStringList> mDimensionFilter; | ||
}; | ||
|
||
#endif // QGSDIMENSIONFILTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+87.9 KB
...ta/control_images/qgis_server/WMS_GetPrint_Dimension/WMS_GetPrint_Dimension.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.