28 QMap<QString, QString> parseFormatOptions(
const QString &optionString )
30 QMap<QString, QString> options;
32 QStringList optionsList = optionString.split(
';' );
33 for (
auto optionsIt = optionsList.constBegin(); optionsIt != optionsList.constEnd(); ++optionsIt )
35 int equalIdx = optionsIt->indexOf(
':' );
36 if ( equalIdx > 0 && equalIdx < ( optionsIt->length() - 1 ) )
38 options.insert( optionsIt->left( equalIdx ).toUpper(),
39 optionsIt->right( optionsIt->length() - equalIdx - 1 ).toUpper() );
56 QgsRenderer renderer( serverIface, project, wmsParameters );
58 QMap<QString, QString> formatOptionsMap = parseFormatOptions( params.value( QStringLiteral(
"FORMAT_OPTIONS" ) ) );
62 QString codec = QStringLiteral(
"ISO-8859-1" );
63 QMap<QString, QString>::const_iterator codecIt = formatOptionsMap.find( QStringLiteral(
"CODEC" ) );
64 if ( codecIt != formatOptionsMap.constEnd() )
66 codec = formatOptionsMap.value( QStringLiteral(
"CODEC" ) );
70 response.
setHeader(
"Content-Type",
"application/dxf" );
71 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.
QgsServerRequest::Parameters parameters() const
Returns a map of query parameters with keys converted to uppercase.
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...
QMap< QString, QString > Parameters