39 #ifdef HAVE_SERVER_PYTHON_PLUGINS 43 const QDomDocument *describeDocument =
nullptr;
45 #ifdef HAVE_SERVER_PYTHON_PLUGINS 47 if ( cacheManager && cacheManager->
getCachedDocument( &doc, project, request, accessControl ) )
49 describeDocument = &doc;
59 describeDocument = &doc;
63 describeDocument = &doc;
65 response.
setHeader(
"Content-Type",
"text/xml; charset=utf-8" );
66 response.
write( describeDocument->toByteArray() );
79 #ifdef HAVE_SERVER_PYTHON_PLUGINS 86 QDomElement coveDescElement = doc.createElement( QStringLiteral(
"CoverageDescription" ) );
87 coveDescElement.setAttribute( QStringLiteral(
"xmlns" ),
WCS_NAMESPACE );
88 coveDescElement.setAttribute( QStringLiteral(
"xmlns:xsi" ), QStringLiteral(
"http://www.w3.org/2001/XMLSchema-instance" ) );
89 coveDescElement.setAttribute( QStringLiteral(
"xsi:schemaLocation" ),
WCS_NAMESPACE +
" http://schemas.opengis.net/wcs/1.0.0/describeCoverage.xsd" );
90 coveDescElement.setAttribute( QStringLiteral(
"xmlns:gml" ),
GML_NAMESPACE );
91 coveDescElement.setAttribute( QStringLiteral(
"xmlns:xlink" ), QStringLiteral(
"http://www.w3.org/1999/xlink" ) );
92 coveDescElement.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0.0" ) );
93 coveDescElement.setAttribute( QStringLiteral(
"updateSequence" ), QStringLiteral(
"0" ) );
94 doc.appendChild( coveDescElement );
99 QMap<QString, QString>::const_iterator cove_name_it = parameters.constFind( QStringLiteral(
"COVERAGE" ) );
100 if ( cove_name_it != parameters.constEnd() )
102 coveNames = cove_name_it.value();
104 if ( coveNames.isEmpty() )
106 QMap<QString, QString>::const_iterator cove_name_it = parameters.constFind( QStringLiteral(
"IDENTIFIER" ) );
107 if ( cove_name_it != parameters.constEnd() )
109 coveNames = cove_name_it.value();
113 QStringList coveNameList;
114 if ( !coveNames.isEmpty() )
116 coveNameList = coveNames.split(
',' );
117 for (
int i = 0; i < coveNameList.size(); ++i )
119 coveNameList.replace( i, coveNameList.at( i ).trimmed() );
124 for (
int i = 0; i < wcsLayersId.size(); ++i )
131 if ( layer->
type() != QgsMapLayer::LayerType::RasterLayer )
135 #ifdef HAVE_SERVER_PYTHON_PLUGINS 141 QString name = layer->
name();
144 name = name.replace(
' ',
'_' );
146 if ( coveNameList.size() == 0 || coveNameList.contains( name ) )
149 coveDescElement.appendChild(
getCoverageOffering( doc, const_cast<QgsRasterLayer *>( rLayer ), project ) );
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...
Base class for all map layer types.
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.
QgsMapLayer::LayerType type() const
Returns the type of the layer.
QString shortName() const
Returns the short name of the layer used by QGIS Server to identify the layer.
const QString WCS_NAMESPACE
bool setCachedDocument(const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl) const
Updates or inserts the document in cache like capabilities.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
void writeDescribeCoverage(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response)
Output WCS DescribeCoverage response.
QDomDocument createDescribeCoverageDocument(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request)
Create describe coverage document.
virtual void write(const QString &data)
Write string This is a convenient method that will write directly to the underlying I/O device...
const QString GML_NAMESPACE
SERVER_EXPORT QStringList wcsLayerIds(const QgsProject &project)
Returns the Layer ids list defined in a QGIS project as published in WCS.
A helper class that centralizes caches accesses given by all the server cache filter plugins...
Reads and writes project states.
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
QDomElement getCoverageOffering(QDomDocument &doc, const QgsRasterLayer *layer, const QgsProject *project, bool brief)
CoverageOffering or CoverageOfferingBrief element.
QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
virtual QgsServerCacheManager * cacheManager() const =0
Gets the registered server cache filters.
A helper class that centralizes restrictions given by all the access control filter plugins...
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...
virtual QgsAccessControl * accessControls() const =0
Gets the registered access control filters.
QgsServerRequest::Parameters parameters() const
Returns a map of query parameters with keys converted to uppercase.
QMap< QString, QString > Parameters
bool layerReadPermission(const QgsMapLayer *layer) const
Returns the layer read right.