QGIS API Documentation 4.3.0-Master (0cfde48c85b)
Loading...
Searching...
No Matches
qgswmsutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgswms.h
3
4 Define WMS service utility functions
5 ------------------------------------
6 begin : December 20 , 2016
7 copyright : (C) 2007 by Marco Hugentobler ( parts from qgswmshandler)
8 (C) 2014 by Alessandro Pasotti ( parts from qgswmshandler)
9 (C) 2016 by David Marteau
10 email : marco dot hugentobler at karto dot baug dot ethz dot ch
11 a dot pasotti at itopen dot it
12 david dot marteau at 3liz dot com
13 ***************************************************************************/
14
15/***************************************************************************
16 * *
17 * This program is free software; you can redistribute it and/or modify *
18 * it under the terms of the GNU General Public License as published by *
19 * the Free Software Foundation; either version 2 of the License, or *
20 * (at your option) any later version. *
21 * *
22 ***************************************************************************/
23#ifndef QGSWMSUTILS_H
24#define QGSWMSUTILS_H
25
26#include "qgslayertreegroup.h"
27#include "qgsmodule.h"
28#include "qgsserversettings.h"
29#include "qgswmslayerinfos.h"
30
31class QgsRectangle;
32
37
39namespace QgsWms
40{
52
57 QString implementationVersion();
58
62 QUrl serviceUrl( const QgsServerRequest &request, const QgsProject *project, const QgsServerSettings &settings );
63
68 ImageOutputFormat parseImageFormat( const QString &format );
69
73 void writeImage( QgsServerResponse &response, QImage &img, const QString &formatStr, int imageQuality = -1 );
74
81 void collectAcceptableLayersAndRequestNames( QHash<const QgsMapLayer *, QStringList> &acceptableLayersAndRequestNames, const QgsProject &project, const QStringList &requestedLayerNames = QStringList() );
82
88 void getChildRanges( const QgsLayerTreeGroup *layerTreeGroup, const QMap<QString, QgsWmsLayerInfos> &wmsLayerInfos, const QStringList &restrictedLayers, QList<QgsDateTimeRange> &dateRanges );
89
90} // namespace QgsWms
91
92#endif
Layer tree group node serves as a container for layers and further groups.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:114
A rectangle specified with double values.
Defines requests passed to QgsService classes.
Defines the response interface passed to QgsService.
Provides a way to retrieve settings by prioritizing according to environment variables,...
Median cut implementation.
void writeImage(QgsServerResponse &response, QImage &img, const QString &formatStr, int imageQuality)
Write image response.
void collectAcceptableLayersAndRequestNames(QHash< const QgsMapLayer *, QStringList > &acceptableLayersAndRequestNames, const QgsProject &project, const QStringList &requestedLayerNames)
Collects the acceptableLayersAndRequestNames, a hash of all the layers that can be rendered and for e...
QString implementationVersion()
Returns the highest version supported by this implementation.
void getChildRanges(const QgsLayerTreeGroup *layerTreeGroup, const QMap< QString, QgsWmsLayerInfos > &wmsLayerInfos, const QStringList &restrictedLayers, QList< QgsDateTimeRange > &dateRanges)
Update recursively dateRanges with all layerTreeGroup children date ranges.
ImageOutputFormat
Supported image output format.
Definition qgswmsutils.h:43
@ Unknown
Unknown/invalid format.
Definition qgswmsutils.h:44
ImageOutputFormat parseImageFormat(const QString &format)
Parse image format parameter.
QUrl serviceUrl(const QgsServerRequest &request, const QgsProject *project, const QgsServerSettings &settings)
Returns WMS service URL.