mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
112 lines
4.6 KiB
Plaintext
112 lines
4.6 KiB
Plaintext
/***************************************************************************
|
|
qgswmsserver.sip
|
|
-------------------
|
|
begin : May 2, 2015
|
|
copyright : (C) 2015 by Alessandro Pasotti
|
|
email : a dot pasotti at itopen dot it
|
|
***************************************************************************/
|
|
|
|
/***************************************************************************
|
|
* *
|
|
* 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 "qgsowsserver.h"
|
|
#include "qgswmsconfigparser.h"
|
|
#include <QDomDocument>
|
|
#include <QMap>
|
|
#include <QPair>
|
|
#include <QString>
|
|
#include <map>
|
|
|
|
class QgsCapabilitiesCache;
|
|
class QgsCoordinateReferenceSystem;
|
|
class QgsComposerLayerItem;
|
|
class QgsComposerLegendItem;
|
|
class QgsComposition;
|
|
class QgsConfigParser;
|
|
class QgsFeature;
|
|
class QgsFeatureRendererV2;
|
|
class QgsMapLayer;
|
|
class QgsMapRenderer;
|
|
class QgsPoint;
|
|
class QgsRasterLayer;
|
|
class QgsRasterRenderer;
|
|
class QgsRectangle;
|
|
class QgsRenderContext;
|
|
class QgsVectorLayer;
|
|
class QgsSymbol;
|
|
class QgsSymbolV2;
|
|
class QColor;
|
|
class QFile;
|
|
class QFont;
|
|
class QImage;
|
|
class QPaintDevice;
|
|
class QPainter;
|
|
class QStandardItem;
|
|
|
|
/** This class handles all the wms server requests. The parameters and values have to be passed in the form of
|
|
a map<QString, QString>. This map is usually generated by a subclass of QgsWMSRequestHandler, which makes QgsWMSServer
|
|
independent from any server side technology*/
|
|
|
|
class QgsWMSServer: public QgsOWSServer
|
|
{
|
|
public:
|
|
/** Constructor. Does _NOT_ take ownership of
|
|
QgsConfigParser, QgsCapabilitiesCache and QgsMapRenderer*/
|
|
QgsWMSServer( const QString& configFilePath, QMap<QString, QString> ¶meters, QgsWMSConfigParser* cp, QgsRequestHandler* rh,
|
|
QgsMapRenderer* renderer, QgsCapabilitiesCache* capCache );
|
|
~QgsWMSServer();
|
|
|
|
void executeRequest() override;
|
|
|
|
/** Returns an XML file with the capabilities description (as described in the WMS specs)
|
|
@param version WMS version (1.1.1 or 1.3.0)
|
|
@param fullProjectInformation If true: add extended project information (does not validate against WMS schema)*/
|
|
QDomDocument getCapabilities( QString version = "1.3.0", bool fullProjectInformation = false );
|
|
|
|
QDomDocument getContext();
|
|
/** Returns the map legend as an image (or a null pointer in case of error). The caller takes ownership
|
|
of the image object*/
|
|
QImage* getLegendGraphics();
|
|
|
|
typedef QSet<QgsSymbolV2*> SymbolV2Set;
|
|
typedef QMap<QgsVectorLayer*, SymbolV2Set> HitTest;
|
|
|
|
/** Returns the map as an image (or a null pointer in case of error). The caller takes ownership
|
|
of the image object). If an instance to existing hit test structure is passed, instead of rendering
|
|
it will fill the structure with symbols that would be used for rendering */
|
|
QImage* getMap( HitTest* hitTest = 0 );
|
|
/** Returns an SLD file with the style of the requested layer. Exception is raised in case of troubles :-)*/
|
|
QDomDocument getStyle();
|
|
/** Returns an SLD file with the styles of the requested layers. Exception is raised in case of troubles :-)*/
|
|
QDomDocument getStyles();
|
|
/** Returns a describeLayer file with the onlineResource of the requested layers. Exception is raised in case of troubles :-)*/
|
|
QDomDocument describeLayer();
|
|
|
|
/** Returns printed page as binary
|
|
@param formatString out: format of the print output (e.g. pdf, svg, png, ...)
|
|
@return printed page as binary or 0 in case of error*/
|
|
QByteArray* getPrint( const QString& formatString );
|
|
|
|
/** Creates an xml document that describes the result of the getFeatureInfo request.
|
|
@return 0 in case of success*/
|
|
int getFeatureInfo( QDomDocument& result, QString version = "1.3.0" );
|
|
|
|
/** Sets configuration parser for administration settings. Does not take ownership*/
|
|
void setAdminConfigParser( QgsWMSConfigParser* parser ) { mConfigParser = parser; }
|
|
|
|
/** Returns the schemaExtension for WMS 1.3.0 capabilities*/
|
|
QDomDocument getSchemaExtension();
|
|
|
|
private:
|
|
/** Don't use the default constructor*/
|
|
QgsWMSServer();
|
|
|
|
};
|
|
|