QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
29 const QgsWmsRequest &request,
32 QgsWmsParameters parameters = request.wmsParameters();
35 if ( ( parameters.widthAsInt() <= 0
36 || parameters.heightAsInt() <= 0 )
37 && ! parameters.infoFormatIsImage() )
41 if ( ! parameters.filterGeom().isEmpty() )
44 const int defaultWidth = 800;
45 size.setWidth( defaultWidth );
46 size.setHeight( defaultWidth * bbox.
height() / bbox.
width() );
54 QgsWmsRenderContext context( project, serverIface );
59 context.setParameters( parameters );
61 const QString infoFormat = request.parameters().value( QStringLiteral(
"INFO_FORMAT" ), QStringLiteral(
"text/plain" ) );
62 response.
setHeader( QStringLiteral(
"Content-Type" ), infoFormat + QStringLiteral(
"; charset=utf-8" ) );
64 QgsRenderer renderer( context );
65 response.
write( renderer.getFeatureInfo( parameters.version() ) );
double height() const SIP_HOLDGIL
Returns the height of the rectangle.
void set(const QgsPointXY &p1, const QgsPointXY &p2, bool normalize=true)
Sets the rectangle from two QgsPoints.
static QgsGeometry fromWkt(const QString &wkt)
Creates a new geometry from a WKT string.
A rectangle specified with double values.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
virtual void write(const QString &data)
Write string This is a convenient method that will write directly to the underlying I/O device.
Median cut implementation.
double width() const SIP_HOLDGIL
Returns the width of the rectangle.
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
void writeGetFeatureInfo(QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
Output GetFeatureInfo response.
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...
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...