31 QMap<QString, QString> parseFormatOptions(
const QString &optionString )
33 QMap<QString, QString> options;
35 QStringList optionsList = optionString.split(
';' );
36 for (
auto optionsIt = optionsList.constBegin(); optionsIt != optionsList.constEnd(); ++optionsIt )
38 int equalIdx = optionsIt->indexOf(
':' );
39 if ( equalIdx > 0 && equalIdx < ( optionsIt->length() - 1 ) )
41 options.insert( optionsIt->left( equalIdx ).toUpper(),
42 optionsIt->right( optionsIt->length() - equalIdx - 1 ).toUpper() );
59 QgsRenderer renderer( serverIface, project, wmsParameters );
61 QMap<QString, QString> formatOptionsMap = parseFormatOptions( params.value( QStringLiteral(
"FORMAT_OPTIONS" ) ) );
65 QString codec = QStringLiteral(
"ISO-8859-1" );
66 QMap<QString, QString>::const_iterator codecIt = formatOptionsMap.find( QStringLiteral(
"CODEC" ) );
67 if ( codecIt != formatOptionsMap.constEnd() )
69 codec = formatOptionsMap.value( QStringLiteral(
"CODEC" ) );
73 response.
setHeader(
"Content-Type",
"application/dxf" );
74 dxf.writeToFile( response.
io(), codec );
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...
void writeAsDxf(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response)
Output GetMap response in DXF format.
QgsDxfExport getDxf(const QMap< QString, QString > &options)
Returns the map as DXF data.
Provides an interface to retrieve and manipulate WMS parameters received from the client...
Reads and writes project states.
Median cut implementation.
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
Map renderer for WMS requests.
virtual QIODevice * io()=0
Returns the underlying QIODevice.
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...
QgsServerRequest::Parameters parameters() const
Returns a map of query parameters with keys converted to uppercase.
QMap< QString, QString > Parameters