35#ifdef HAVE_SERVER_PYTHON_PLUGINS
39 const QDomDocument *describeDocument =
nullptr;
41#ifdef HAVE_SERVER_PYTHON_PLUGINS
43 if ( cacheManager && cacheManager->
getCachedDocument( &doc, project, request, accessControl ) )
45 describeDocument = &doc;
55 describeDocument = &doc;
59 describeDocument = &doc;
61 response.
setHeader(
"Content-Type",
"text/xml; charset=utf-8" );
62 response.
write( describeDocument->toByteArray() );
74#ifdef HAVE_SERVER_PYTHON_PLUGINS
81 QDomElement coveDescElement = doc.createElement( QStringLiteral(
"CoverageDescription" ) );
82 coveDescElement.setAttribute( QStringLiteral(
"xmlns" ),
WCS_NAMESPACE );
83 coveDescElement.setAttribute( QStringLiteral(
"xmlns:xsi" ), QStringLiteral(
"http://www.w3.org/2001/XMLSchema-instance" ) );
84 coveDescElement.setAttribute( QStringLiteral(
"xsi:schemaLocation" ),
WCS_NAMESPACE +
" http://schemas.opengis.net/wcs/1.0.0/describeCoverage.xsd" );
85 coveDescElement.setAttribute( QStringLiteral(
"xmlns:gml" ),
GML_NAMESPACE );
86 coveDescElement.setAttribute( QStringLiteral(
"xmlns:xlink" ), QStringLiteral(
"http://www.w3.org/1999/xlink" ) );
87 coveDescElement.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0.0" ) );
88 coveDescElement.setAttribute( QStringLiteral(
"updateSequence" ), QStringLiteral(
"0" ) );
89 doc.appendChild( coveDescElement );
94 const QMap<QString, QString>::const_iterator cove_name_it = parameters.constFind( QStringLiteral(
"COVERAGE" ) );
95 if ( cove_name_it != parameters.constEnd() )
97 coveNames = cove_name_it.value();
99 if ( coveNames.isEmpty() )
101 const QMap<QString, QString>::const_iterator cove_name_it = parameters.constFind( QStringLiteral(
"IDENTIFIER" ) );
102 if ( cove_name_it != parameters.constEnd() )
104 coveNames = cove_name_it.value();
108 QStringList coveNameList;
109 if ( !coveNames.isEmpty() )
111 coveNameList = coveNames.split(
',' );
112 for (
int i = 0; i < coveNameList.size(); ++i )
114 coveNameList.replace( i, coveNameList.at( i ).trimmed() );
119 for (
int i = 0; i < wcsLayersId.size(); ++i )
130#ifdef HAVE_SERVER_PYTHON_PLUGINS
136 QString name = layer->
name();
139 name = name.replace(
' ',
'_' );
141 if ( coveNameList.size() == 0 || coveNameList.contains( name ) )
A helper class that centralizes restrictions given by all the access control filter plugins.
bool layerReadPermission(const QgsMapLayer *layer) const
Returns the layer read right.
QString shortName() const
Returns the short name of the layer used by QGIS Server to identify the layer.
Base class for all map layer types.
QgsMapLayerServerProperties * serverProperties()
Returns QGIS Server Properties for the map layer.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
Represents a raster layer.
A helper class that centralizes caches accesses given by all the server cache filter plugins.
bool setCachedDocument(const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Updates or inserts the document in cache like capabilities.
bool getCachedDocument(QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Returns cached document (or 0 if document not in cache) like capabilities.
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
virtual QgsServerCacheManager * cacheManager() const =0
Gets the registered server cache filters.
virtual QgsAccessControl * accessControls() const =0
Gets the registered access control filters.
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
QgsServerRequest::Parameters parameters() const
Returns a map of query parameters with keys converted to uppercase.
QMap< QString, QString > Parameters
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...
virtual void write(const QString &data)
Write string This is a convenient method that will write directly to the underlying I/O device.
virtual void setHeader(const QString &key, const QString &value)=0
Set Header entry Add Header entry to the response Note that it is usually an error to set Header afte...
SERVER_EXPORT QStringList wcsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WCS.
QDomElement getCoverageOffering(QDomDocument &doc, const QgsRasterLayer *layer, const QgsProject *project, bool brief)
CoverageOffering or CoverageOfferingBrief element.
void writeDescribeCoverage(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response)
Output WCS DescribeCoverage response.
const QString WCS_NAMESPACE
QDomDocument createDescribeCoverageDocument(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request)
Create describe coverage document.
const QString GML_NAMESPACE