Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Server][Feature][needs-docs] Update WMTS service: Add GetFeatureInfo
Support GetFeatureInfo Request in WMTS.
- Loading branch information
Showing
8 changed files
with
315 additions
and
181 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
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,52 @@ | ||
/*************************************************************************** | ||
qgswmsgetfeatureinfo.cpp | ||
------------------------- | ||
begin : July 23 , 2017 | ||
copyright : (C) 2018 by René-Luc D'Hont | ||
email : rldhont at 3liz dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* 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 "qgswmtsutils.h" | ||
#include "qgswmtsgetfeatureinfo.h" | ||
|
||
#include <QImage> | ||
|
||
namespace QgsWmts | ||
{ | ||
|
||
void writeGetFeatureInfo( QgsServerInterface *serverIface, const QgsProject *project, | ||
const QString &version, const QgsServerRequest &request, | ||
QgsServerResponse &response ) | ||
{ | ||
Q_UNUSED( version ); | ||
|
||
QgsServerRequest::Parameters params = request.parameters(); | ||
|
||
// WMS query | ||
QUrlQuery query = translateWmtsParamToWmsQueryItem( QStringLiteral( "GetFeatureInfo" ), params, project, serverIface ); | ||
|
||
// GetFeatureInfo query items | ||
query.addQueryItem( QStringLiteral( "query_layers" ), query.queryItemValue( QStringLiteral( "layers" ) ) ); | ||
query.addQueryItem( QStringLiteral( "i" ), params.value( QStringLiteral( "I" ) ) ); | ||
query.addQueryItem( QStringLiteral( "j" ), params.value( QStringLiteral( "J" ) ) ); | ||
query.addQueryItem( QStringLiteral( "info_format" ), params.value( QStringLiteral( "INFOFORMAT" ) ) ); | ||
|
||
QgsServerParameters wmsParams( query ); | ||
QgsServerRequest wmsRequest( "?" + query.query( QUrl::FullyDecoded ) ); | ||
QgsService *service = serverIface->serviceRegistry()->getService( wmsParams.service(), wmsParams.version() ); | ||
service->executeRequest( wmsRequest, response, project ); | ||
} | ||
|
||
} // namespace QgsWmts | ||
|
||
|
||
|
||
|
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,28 @@ | ||
/*************************************************************************** | ||
qgswmsgetfeatureinfo.h | ||
------------------------- | ||
begin : July 23 , 2017 | ||
copyright : (C) 2018 by René-Luc D'Hont | ||
email : rldhont at 3liz dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* 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. * | ||
* * | ||
***************************************************************************/ | ||
|
||
namespace QgsWmts | ||
{ | ||
|
||
/** | ||
* Output GetFeatureInfo response | ||
*/ | ||
void writeGetFeatureInfo( QgsServerInterface *serverIface, const QgsProject *project, | ||
const QString &version, const QgsServerRequest &request, | ||
QgsServerResponse &response ); | ||
|
||
} // namespace QgsWmts |
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
Oops, something went wrong.