26#include <QRegularExpression>
29#include "moc_qgswmsparameters.cpp"
31using namespace Qt::StringLiterals;
68 const QString msg = QString(
"%1 ('%2') cannot be converted into a list of geometries" ).arg(
name(
mName ),
toString() );
82 const QString msg = QString(
"%1 ('%2') cannot be converted into a rectangle" ).arg(
name(
mName ),
toString() );
105 const QUrl url =
toUrl();
112 const QString msg = QString(
"%1 request error for %2" ).arg(
name(
mName ), url.toString() );
152 const QString msg = QString(
"%1 ('%2') cannot be converted into a list of colors" ).arg(
name(
mName ),
toString() );
166 const QString msg = QString(
"%1 ('%2') cannot be converted into a list of int" ).arg(
name(
mName ),
toString() );
180 const QString msg = QString(
"%1 ('%2') cannot be converted into a list of float" ).arg(
name(
mName ),
toString() );
207 const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameter::Name>() );
208 return metaEnum.valueToKey(
name );
213 const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameter::Name>() );
253 save( pIcLabelSpace );
256 save( pItFontFamily );
262 save( pItFontItalic );
268 save( pItFontColor );
271 save( pHighlightGeom );
274 save( pShowFeatureCount );
277 save( pHighlightSymbol );
280 save( pHighlightLabel );
283 save( pHighlightColor );
286 save( pHighlightFontSize );
289 save( pHighlightFontWeight );
292 save( pHighlightFont );
295 save( pHighlightBufferColor );
298 save( pHighlightBufferSize );
301 save( pHighlightFrameBackgroundColor );
304 save( pHighlightFrameOutlineColor );
307 save( pHighlightFrameOutlineWidth );
310 save( pHighlightFrameSize );
313 save( pLabelRotation );
316 save( pLabelDistance );
355 save( pShowRuleDetails );
388 save( pQueryLayers );
391 save( pFeatureCount );
397 save( pLayerFtFamily );
400 save( pLayerFtBold );
403 save( pLayerFtItalic );
406 save( pLayerFtSize );
409 save( pLayerFtColor );
439 save( pWmsPrecision );
442 save( pTransparent );
466 save( pWithGeometry );
472 save( pWithDisplayName );
484 save( pAddLayerGroups );
493 if ( it != mWmsParameters.constEnd() && !it->toString().isEmpty() )
495 const QString
sldBody = it->loadUrl();
505 return mWmsParameters.value( name );
510 auto it = mWmsParameters.find( name );
511 if ( it == mWmsParameters.end() )
519 bool QgsWmsParameters::loadParameter(
const QString &key,
const QString &value )
523 const thread_local QRegularExpression composerParamRegExp( u
"^MAP\\d+:"_s, QRegularExpression::CaseInsensitiveOption );
524 if ( key.contains( composerParamRegExp ) )
526 const int mapId = QStringView { key }.mid( 3, key.indexOf(
':' ) - 3 ).toInt();
527 const QString theKey = key.mid( key.indexOf(
':' ) + 1 );
532 QgsWmsParameter param = mWmsParameters.value( name );
533 param.mValue =
value;
534 param.mMapId = mapId;
536 if ( !param.isValid() )
550 auto it = mWmsParameters.find( name );
551 if ( it == mWmsParameters.end() )
552 it = mWmsParameters.insert( name, QgsWmsParameter() );
555 if ( !it->isValid() )
564 int separator = key.indexOf(
':'_L1 );
565 if ( separator >= 1 )
567 QString
id = key.left( separator );
568 QString param = key.right( key.length() - separator - 1 );
569 mExternalWMSParameters[id].insert( param,
value );
581 ( void ) log( u
"WMS Request parameters:"_s );
582 for (
auto it = mWmsParameters.constBegin(); it != mWmsParameters.constEnd(); ++it )
584 const QString
value = it->toString();
586 if ( !
value.isEmpty() )
590 if ( it->mMapId >= 0 )
592 name = u
"%1:%2"_s.arg( QString::number( it->mMapId ), name );
595 log( u
" - %1 : %2"_s.arg( name,
value ) );
600 log( u
" - VERSION : %1"_s.arg(
version() ) );
603 void QgsWmsParameters::save(
const QgsWmsParameter ¶meter,
bool multi )
607 mWmsParameters.insert( parameter.
mName, parameter );
611 mWmsParameters.replace( parameter.
mName, parameter );
638 if ( !srs.isEmpty() &&
crs.isEmpty() )
640 else if ( srs.isEmpty() && !
crs.isEmpty() )
642 else if ( !srs.isEmpty() && !
crs.isEmpty() )
723 if ( !
wmtver().isEmpty() )
754 if (
version().compare(
"1.1.1"_L1 ) == 0 && req.compare(
"capabilities"_L1, Qt::CaseInsensitive ) == 0 )
756 req = u
"GetCapabilities"_s;
779 const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameters::Format>() );
780 return metaEnum.valueToKey(
format );
788 if ( fStr.compare(
"image/png"_L1, Qt::CaseInsensitive ) == 0 || fStr.compare(
"png"_L1, Qt::CaseInsensitive ) == 0 )
792 else if ( fStr.compare(
"jpg"_L1, Qt::CaseInsensitive ) == 0 || fStr.compare(
"jpeg"_L1, Qt::CaseInsensitive ) == 0 || fStr.compare(
"image/jpeg"_L1, Qt::CaseInsensitive ) == 0 )
796 else if ( fStr.compare(
"image/svg"_L1, Qt::CaseInsensitive ) == 0 || fStr.compare(
"image/svg+xml"_L1, Qt::CaseInsensitive ) == 0 || fStr.compare(
"svg"_L1, Qt::CaseInsensitive ) == 0 )
800 else if ( fStr.compare(
"application/pdf"_L1, Qt::CaseInsensitive ) == 0 || fStr.compare(
"pdf"_L1, Qt::CaseInsensitive ) == 0 )
804 else if ( fStr.compare(
"application/json"_L1, Qt::CaseInsensitive ) == 0 || fStr.compare(
"json"_L1, Qt::CaseInsensitive ) == 0 )
826 if ( fStr.isEmpty() )
829 if ( fStr.startsWith(
"text/xml"_L1, Qt::CaseInsensitive ) )
831 else if ( fStr.startsWith(
"text/html"_L1, Qt::CaseInsensitive ) )
833 else if ( fStr.startsWith(
"text/plain"_L1, Qt::CaseInsensitive ) )
835 else if ( fStr.startsWith(
"application/vnd.ogc.gml"_L1, Qt::CaseInsensitive ) )
837 else if ( fStr.startsWith(
"application/json"_L1, Qt::CaseInsensitive ) || fStr.startsWith(
"application/geo+json"_L1, Qt::CaseInsensitive ) )
851 if ( fStr.startsWith(
"application/vnd.ogc.gml/3"_L1, Qt::CaseInsensitive ) )
1175 font.fromString(
"" );
1191 font.fromString(
"" );
1453 const QStringList layersList { param.toStringList() };
1454 for (
const QString &layerName : std::as_const( layersList ) )
1456 if ( !result.contains( layerName ) )
1457 result.append( layerName );
1467 const QStringList layersList { param.toStringList() };
1468 for (
const QString &layerName : std::as_const( layersList ) )
1470 if ( !result.contains( layerName ) )
1471 result.append( layerName );
1486 return style << styles;
1489 QMultiMap<QString, QgsWmsParametersFilter> QgsWmsParameters::layerFilters(
const QStringList &layers )
const
1491 const QString nsWfs2 = u
"http://www.opengis.net/fes/2.0"_s;
1492 const QString prefixWfs2 = u
"<fes:"_s;
1494 const QStringList rawFilters =
filters();
1495 QMultiMap<QString, QgsWmsParametersFilter>
filters;
1496 for (
int i = 0;
i < rawFilters.size();
i++ )
1498 const QString f = rawFilters[
i];
1499 if ( f.startsWith(
'<'_L1 ) && f.endsWith(
"Filter>"_L1 ) &&
i < layers.size() )
1506 if ( filter.
mFilter.contains( nsWfs2 ) || filter.
mFilter.contains( prefixWfs2 ) )
1511 filters.insert( layers[
i], filter );
1513 else if ( !f.isEmpty() )
1517 const int colonIndex = f.indexOf(
':' );
1518 if ( colonIndex != -1 )
1520 const QString layers = f.section(
':', 0, 0 );
1521 const QString filter = f.section(
':', 1 );
1522 const QStringList layersList = layers.split(
',' );
1523 for (
const QString &layer : layersList )
1525 QgsWmsParametersFilter parametersFilter;
1526 parametersFilter.mFilter = filter;
1528 filters.insert( layer, parametersFilter );
1534 raiseError( u
"FILTER ('"_s + filterStr + u
"') is not properly formatted"_s );
1543 bool force2D =
false;
1556 bool zeroWidth =
false;
1587 const QMultiMap<QString, QgsWmsParametersFilter>
filters = layerFilters( layers );
1591 QMultiMap<QString, QString> layerSelections;
1592 for (
const QString &s : selection )
1594 const QStringList splits = s.split(
':' );
1595 if ( splits.size() == 2 )
1597 layerSelections.insert( splits[0], splits[1] );
1602 raiseError( u
"SELECTION ('"_s + selStr + u
"') is not properly formatted"_s );
1606 QList<QgsWmsParametersLayer> parameters;
1607 for (
int i = 0;
i < layers.size();
i++ )
1609 QString layer = layers[
i];
1617 if ( isExternalLayer( layer ) )
1625 if (
i < styles.count() )
1628 if (
filters.contains( layer ) )
1630 auto it =
filters.find( layer );
1631 while ( it !=
filters.end() && it.key() == layer )
1633 param.
mFilter.append( it.value() );
1638 if ( layerSelections.contains( layer ) )
1640 QMultiMap<QString, QString>::const_iterator it;
1641 it = layerSelections.constFind( layer );
1642 while ( it != layerSelections.constEnd() && it.key() == layer )
1650 parameters.append( param );
1658 QList<QgsWmsParametersHighlightLayer> params;
1677 int nLayers = std::min( geoms.size(), slds.size() );
1678 for (
int i = 0;
i < nLayers;
i++ )
1681 param.
mName = u
"highlight_"_s + QString::number(
i );
1683 param.
mSld = slds[
i];
1685 if (
i < labels.count() )
1688 if (
i < colors.count() )
1691 if (
i < sizes.count() )
1694 if (
i < weights.count() )
1697 if (
i < fonts.count() )
1700 if (
i < bufferColors.count() )
1703 if (
i < bufferSizes.count() )
1706 if (
i < frameBackgroundColors.count() )
1709 if (
i < frameOutlineColors.count() )
1712 if (
i < frameOutlineWidths.count() )
1715 if (
i < frameSizes.count() )
1718 if (
i < rotation.count() )
1721 if (
i < distance.count() )
1724 if (
i < hali.count() )
1727 if (
i < vali.count() )
1731 params.append( param );
1739 auto notExternalLayer = [](
const QString &name ) {
return !QgsWmsParameters::isExternalLayer( name ); };
1741 QList<QgsWmsParametersExternalLayer> externalLayers;
1744 QStringList::iterator rit = std::remove_if( layers.begin(), layers.end(), notExternalLayer );
1746 for ( QStringList::iterator it = layers.begin(); it != rit; ++it )
1748 externalLayers << externalLayerParameter( *it );
1751 return externalLayers;
1775 QString pMapId = u
"MAP"_s + QString::number( mapId );
1802 double gridx( -1 ), gridy( -1 );
1816 if ( gridx >= 0 && gridy >= 0 )
1823 QStringList allLayers;
1833 for (
const auto &layer : std::as_const( allLayers ) )
1835 if ( isExternalLayer( layer ) )
1838 layers << extParam.
mName;
1853 QList<QgsWmsParametersLayer> lParams;
1854 for (
int i = 0;
i < layers.size();
i++ )
1856 QString layer = layers[
i];
1860 if (
i < styles.count() )
1863 lParams.append( lParam );
1868 QList<QgsWmsParametersHighlightLayer> hParams;
1870 QList<QgsGeometry> geoms;
1898 QList<QColor> colors;
1909 sizes = wmsParam.
toIntList(
';',
false );
1916 weights = wmsParam.
toIntList(
';',
false );
1919 QList<QColor> bufferColors;
1923 bufferColors = wmsParam.
toColorList(
';',
false );
1926 QList<double> bufferSizes;
1933 QList<QColor> frameBackgroundColors;
1937 frameBackgroundColors = wmsParam.
toColorList(
';',
false );
1940 QList<QColor> frameOutlineColors;
1944 frameOutlineColors = wmsParam.
toColorList(
';',
false );
1947 QList<double> frameOutlineWidths;
1951 frameOutlineWidths = wmsParam.
toDoubleList(
';',
false );
1954 QList<double> frameSizes;
1961 QList<double> rotations;
1968 QList<double> distances;
1989 int nHLayers = std::min( geoms.size(), slds.size() );
1990 for (
int i = 0;
i < nHLayers;
i++ )
1993 hParam.
mName = pMapId + u
"_highlight_"_s + QString::number(
i );
1995 hParam.
mSld = slds[
i];
1997 if (
i < labels.count() )
2000 if (
i < colors.count() )
2003 if (
i < sizes.count() )
2006 if (
i < weights.count() )
2009 if (
i < fonts.count() )
2012 if (
i < bufferColors.count() )
2015 if (
i < frameBackgroundColors.count() )
2018 if (
i < frameOutlineColors.count() )
2021 if (
i < frameOutlineWidths.count() )
2024 if (
i < frameSizes.count() )
2027 if (
i < bufferSizes.count() )
2030 if (
i < rotations.count() )
2033 if (
i < distances.count() )
2036 if (
i < halis.count() )
2039 if (
i < valis.count() )
2042 hParams.append( hParam );
2052 QString
id { layerId };
2054 for (
auto it = mExternalWMSParameters.cbegin(); it != mExternalWMSParameters.cend(); ++it )
2056 if ( it.key().compare(
id, Qt::CaseSensitivity::CaseInsensitive ) == 0 )
2063 if ( !mExternalWMSParameters.contains(
id ) )
2069 const QMap<QString, QString> ¶mMap = mExternalWMSParameters[id];
2070 QMap<QString, QString>::const_iterator paramIt = paramMap.constBegin();
2071 for ( ; paramIt != paramMap.constEnd(); ++paramIt )
2073 QString paramName = paramIt.key().toLower();
2074 if ( paramName ==
"layers"_L1 || paramName ==
"styles"_L1 || paramName ==
"opacities"_L1 )
2076 const QStringList values = paramIt.value().split(
',' );
2077 for (
const QString &
value : values )
2080 else if ( paramName ==
"ignorereportedlayerextents"_L1 )
2082 wmsUri.
setParam( u
"IgnoreReportedLayerExtents"_s, paramIt.value() );
2084 else if ( paramName ==
"smoothpixmaptransform"_L1 )
2086 wmsUri.
setParam( u
"SmoothPixmapTransform"_s, paramIt.value() );
2088 else if ( paramName ==
"ignoregetmapurl"_L1 )
2090 wmsUri.
setParam( u
"IgnoreGetMapUrl"_s, paramIt.value() );
2092 else if ( paramName ==
"ignoregetfeatureinfourl"_L1 )
2094 wmsUri.
setParam( u
"IgnoreGetFeatureInfoUrl"_s, paramIt.value() );
2096 else if ( paramName ==
"ignoreaxisorientation"_L1 )
2098 wmsUri.
setParam( u
"IgnoreAxisOrientation"_s, paramIt.value() );
2100 else if ( paramName ==
"invertaxisorientation"_L1 )
2102 wmsUri.
setParam( u
"InvertAxisOrientation"_s, paramIt.value() );
2104 else if ( paramName ==
"dpimode"_L1 )
2106 wmsUri.
setParam( u
"dpiMode"_s, paramIt.value() );
2108 else if ( paramName ==
"stepwidth"_L1 )
2110 wmsUri.
setParam( u
"stepWidth"_s, paramIt.value() );
2112 else if ( paramName ==
"stepheight"_L1 )
2114 wmsUri.
setParam( u
"stepHeight"_s, paramIt.value() );
2118 wmsUri.
setParam( paramName, paramIt.value() );
2138 if ( mStr.startsWith(
"true"_L1, Qt::CaseInsensitive ) || mStr.startsWith(
"on"_L1, Qt::CaseInsensitive ) || mStr.startsWith(
"yes"_L1, Qt::CaseInsensitive ) || mStr.startsWith(
'1'_L1 ) )
2148 if ( mStr.startsWith(
"html_fi_only_maptip"_L1, Qt::CaseInsensitive ) )
2164 void QgsWmsParameters::log(
const QString &msg,
const char *file,
const char *function,
int line )
const
2169 void QgsWmsParameters::raiseError(
const QString &msg )
const
2178 for (
const auto ¶m : mWmsParameters.values( name ) )
2180 if ( param.mMapId ==
id )
2191 QgsWmsParametersExternalLayer param;
2200 bool QgsWmsParameters::isExternalLayer(
const QString &name )
2207 QStringList attributes;
2256 if ( mode.compare(
"SymbolLayerSymbology"_L1, Qt::CaseInsensitive ) == 0 )
2260 else if ( mode.compare(
"FeatureSymbology"_L1, Qt::CaseInsensitive ) == 0 )
2270 QString codec = u
"ISO-8859-1"_s;
2282 bool geospatialPdf =
false;
2288 return geospatialPdf;
2293 bool forceVector =
false;
2304 bool appendGeoref =
true;
2310 return appendGeoref;
2315 bool simplify =
true;
2326 bool exportMetadata =
false;
2332 return exportMetadata;
2355 bool losslessCompression =
false;
2361 return losslessCompression;
2366 bool disableTiledRaster =
false;
2372 return disableTiledRaster;
2377 bool useIso32000 =
true;
2404 QVector<qreal> scales;
2409 for (
const QString &it : std::as_const( scaleList ) )
2412 qreal
scale = it.toDouble( &ok );
2415 scales.append(
scale );
2424 QMap<QString, QString> dimValues;
2425 const QMetaEnum pnMetaEnum( QMetaEnum::fromType<QgsMapLayerServerProperties::PredefinedWmsDimensionName>() );
2427 for (
const QString &key : unmanagedNames )
2429 if ( key.startsWith(
"DIM_"_L1 ) )
2433 else if ( pnMetaEnum.keyToValue( key.toUpper().toStdString().c_str() ) != -1 )
@ Symbol
Symbol icon (excluding label).
@ Group
Legend group title.
@ Subgroup
Legend subgroup title.
@ SymbolLabel
Symbol label (excluding icon).
@ Info
Information message.
TextRenderFormat
Options for rendering text.
@ PreferText
Render text as text objects, unless doing so results in rendering artifacts or poor quality rendering...
@ AlwaysOutlines
Always render text using path objects (AKA outlines/curves). This setting guarantees the best quality...
@ AlwaysText
Always render text as text objects. While this mode preserves text objects as text for post-processin...
FeatureSymbologyExport
Options for exporting features considering their symbology.
@ PerFeature
Keeps the number of features and export symbology per feature.
@ PerSymbolLayer
Exports one feature per symbol layer (considering symbol levels).
@ NoSymbology
Export only data.
Exception thrown in case of malformed requests.
Stores the component parts of a data source URI (e.g.
QByteArray encodedUri() const
Returns the complete encoded URI as a byte array.
void setParam(const QString &key, const QString &value)
Sets a generic parameter value on the URI.
static void setFontFamily(QFont &font, const QString &family)
Sets the family for a font object.
Stores the appearance and layout settings for legend drawing with QgsLegendRenderer.
QgsLegendStyle & rstyle(Qgis::LegendComponent s)
Returns modifiable reference to the style for a legend component.
void setTitle(const QString &t)
Sets the title for the legend, which will be rendered above all legend items.
void setBoxSpace(double s)
Sets the legend box space (in millimeters), which is the empty margin around the inside of the legend...
void setSynchronousLegendRequests(bool b)
Sets whether to request legend graphics synchronously.
void setSymbolSize(QSizeF s)
Sets the default symbol size (in millimeters) used for legend items.
QgsTextFormat & textFormat()
Returns the text format used for rendering this legend component.
void setMargin(Side side, double margin)
Sets the margin (in mm) for the specified side of the component.
void setTextFormat(const QgsTextFormat &format)
Sets the text format used for rendering this legend component.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true, const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE(), Qgis::StringFormat format=Qgis::StringFormat::PlainText)
Adds a message to the log instance (and creates it if necessary).
Describes the version of a project.
A rectangle specified with double values.
Q_INVOKABLE QString toString(int precision=16) const
Returns a string representation of form xmin,ymin : xmax,ymax Coordinates will be rounded to the spec...
QList< QColor > toColorList(bool &ok, char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of colors.
QString loadUrl(bool &ok) const
Loads the data associated to the parameter converted into an url.
QUrl toUrl(bool &ok) const
Converts the parameter into an url.
QList< int > toIntList(bool &ok, char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of integers.
QString toString(bool defaultValue=false) const
Converts the parameter into a string.
QgsServerParameterDefinition(const QMetaType::Type type=QMetaType::Type::QString, const QVariant defaultValue=QVariant(""))
Constructor for QgsServerParameterDefinition.
QStringList toStringList(char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of strings.
virtual bool isValid() const
Returns true if the parameter is valid, false otherwise.
QString typeName() const
Returns the type of the parameter as a string.
static void raiseError(const QString &msg)
Raises an exception in case of an invalid parameters.
int toInt(bool &ok) const
Converts the parameter into an integer.
QList< QgsGeometry > toGeomList(bool &ok, char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of geometries.
QColor toColor(bool &ok) const
Converts the parameter into a color.
double toDouble(bool &ok) const
Converts the parameter into a double.
QList< double > toDoubleList(bool &ok, char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of doubles.
QgsRectangle toRectangle(bool &ok) const
Converts the parameter into a rectangle.
QgsServerParameters()
Constructor.
virtual QString request() const
Returns REQUEST parameter as a string or an empty string if not defined.
QUrlQuery urlQuery() const
Returns a url query with underlying parameters.
QMap< QString, QString > mUnmanagedParameters
void load(const QUrlQuery &query)
Loads new parameters.
virtual QString version() const
Returns VERSION parameter as a string or an empty string if not defined.
QString value(const QString &key) const
Returns the value of a parameter.
void setColor(const QColor &color)
Sets the color that text will be rendered in.
static QgsTextFormat fromQFont(const QFont &font)
Returns a text format matching the settings from an input font.
@ QGIS_InvalidParameterValue
WMS parameter received from the client.
int toInt() const
Converts the parameter into an integer.
QList< QgsGeometry > toGeomList(const char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of geometries.
double toDouble() const
Converts the parameter into a double.
void raiseError() const
Raises an error in case of an invalid conversion.
QgsWmsParameter(const QgsWmsParameter::Name name=QgsWmsParameter::UNKNOWN, const QMetaType::Type type=QMetaType::Type::QString, const QVariant defaultValue=QVariant(""))
Constructor for QgsWmsParameter.
QList< double > toDoubleList(const char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of doubles.
QStringList toStyleList(const char delimiter=',', bool skipEmptyParts=false) const
Converts the parameter into a list of strings and keeps empty parts Default style value is an empty s...
Name
Available parameters for WMS requests.
@ HIGHLIGHT_LABELBUFFERCOLOR
@ HIGHLIGHT_LABELFRAMEOUTLINECOLOR
@ HIGHLIGHT_LABEL_DISTANCE
@ HIGHLIGHT_LABELFRAMESIZE
@ HIGHLIGHT_LABELFRAMEOUTLINEWIDTH
@ HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT
@ HIGHLIGHT_LABELBUFFERSIZE
@ HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT
@ HIGHLIGHT_LABEL_ROTATION
@ HIGHLIGHT_LABELFRAMEBACKGROUNDCOLOR
QUrl toUrl() const
Converts the parameter into an url.
bool isValid() const override
Returns true if the parameter is valid, false otherwise.
QString name() const
Returns the name of the parameter.
QgsRectangle toRectangle() const
Converts the parameter into a rectangle.
QList< int > toIntList(const char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of integers.
QColor toColor() const
Converts the parameter into a color.
QgsWmsParameter::Name mName
QList< QColor > toColorList(const char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of colors.
QString loadUrl() const
Loads the data associated to the parameter converted into an url.
bool htmlInfoOnlyMapTip() const
Returns true if only maptip information is requested for HTML feature info response.
QString rule() const
Returns RULE parameter or an empty string if none is defined.
QString layerTitle() const
Returns LAYERTITLE parameter or an empty string if not defined.
double layerSpaceAsDouble() const
Returns LAYERSPACE as a double or its default value if not defined.
QString boxSpace() const
Returns BOXSPACE parameter or an empty string if not defined.
QString wmsPrecision() const
Returns WMS_PRECISION parameter or an empty string if not defined.
double dxfScale() const
Returns the DXF SCALE parameter.
QString featureCount() const
Returns FEATURE_COUNT parameter or an empty string if none is defined.
QFont layerFont() const
Returns the layer font (built thanks to the LAYERFONTFAMILY, LAYERFONTSIZE, LAYERFONTBOLD,...
QList< int > opacitiesAsInt() const
Returns the list of opacities found in OPACITIES parameter as integers.
bool transparentAsBool() const
Returns TRANSPARENT parameter as a bool or its default value if not defined.
QString transparent() const
Returns TRANSPARENT parameter or an empty string if not defined.
QList< int > highlightLabelWeightAsInt() const
Returns HIGHLIGHT_LABELWEIGHT as a list of int.
QString iconLabelSpace() const
Returns ICONLABELSPACE parameter or an empty string if not defined.
QString layerTitleSpace() const
Returns LAYERTITLESPACE parameter or an empty string if not defined.
QString x() const
Returns X parameter or an empty string if not defined.
QgsWmsParameters(const QgsServerParameters ¶meters)
Constructor for WMS parameters with specific values.
QString layerSpace() const
Returns LAYERSPACE parameter or an empty string if not defined.
int wmsPrecisionAsInt() const
Returns WMS_PRECISION parameter as an int or its default value if not defined.
QStringList highlightLabelBufferSize() const
Returns HIGHLIGHT_LABELBUFFERSIZE.
QStringList allLayersNickname() const
Returns nickname of layers found in LAYER and LAYERS parameters.
QString formatAsString() const
Returns FORMAT parameter as a string.
double layerFontSizeAsDouble() const
Returns LAYERFONTSIZE as a double.
QString externalWMSUri(const QString &id) const
Returns the external WMS uri.
QList< double > highlightLabelFrameSizeAsFloat() const
Returns HIGHLIGHT_LABELFRAMESIZE as a list of float.
QgsProjectVersion versionAsNumber() const
Returns VERSION parameter if defined or its default value.
QString scale() const
Returns SCALE parameter or an empty string if none is defined.
QString ruleLabel() const
Returns RULELABEL parameter or an empty string if none is defined.
double scaleAsDouble() const
Returns SCALE as a double.
bool layerFontItalicAsBool() const
Returns LAYERFONTITALIC as a boolean or its default value if not defined.
QgsWmsParametersComposerMap composerMapParameters(int mapId) const
Returns the requested parameters for a composer map parameter.
QgsRectangle bboxAsRectangle() const
Returns BBOX as a rectangle if defined and valid.
bool withGeometry() const
Returns if the client wants the feature info response with geometry information.
QList< QColor > highlightLabelFrameBackgroundColorAsColor() const
Returns HIGHLIGHT_LABELFRAMEBACKGROUNDCOLOR as a list of colors.
QStringList highlightLabelString() const
Returns HIGHLIGHT_LABELSTRING as a list of string.
QString tiled() const
Returns TILED parameter or an empty string if not defined.
QString layerFontSize() const
Returns LAYERFONTSIZE parameter or an empty string if not defined.
@ EXPORT_LINES_WITH_ZERO_WIDTH
QList< QColor > highlightLabelColorAsColor() const
Returns HIGHLIGHT_LABELCOLOR as a list of color.
bool itemFontBoldAsBool() const
Returns ITEMFONTBOLD as a boolean or its default value if not defined.
QStringList highlightLabelHorizontalAlignment() const
Returns HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT as a list of string.
void set(QgsWmsParameter::Name name, const QVariant &value)
Sets a parameter value thanks to its name.
QString pointTolerance() const
Returns FI_POINT_TOLERANCE parameter or an empty string if not defined.
QStringList highlightLabelFrameSize() const
Returns HIGHLIGHT_LABELFRAMESIZE.
QString filterGeom() const
Returns the filter geometry found in FILTER_GEOM parameter.
QString composerTemplate() const
Returns TEMPLATE parameter or an empty string if not defined.
Format infoFormat() const
Returns infoFormat.
QString dxfCodec() const
Returns the DXF CODEC parameter.
QString y() const
Returns Y parameter or an empty string if not defined.
QString srcHeight() const
Returns SRCHEIGHT parameter or an empty string if not defined.
double dpiAsDouble() const
Returns DPI parameter as an int or its default value if not defined.
QStringList highlightLabelVerticalAlignment() const
Returns HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT as a list of string.
void dump() const
Dumps parameters.
int pointToleranceAsInt() const
Returns FI_POINT_TOLERANCE parameter as an integer.
bool withMapTip() const
withMapTip
QString polygonTolerance() const
Returns FI_POLYGON_TOLERANCE parameter or an empty string if not defined.
QStringList highlightGeom() const
Returns HIGHLIGHT_GEOM as a list of string in WKT.
QString i() const
Returns I parameter or an empty string if not defined.
bool pdfLosslessImageCompression() const
Returns true if images embedded in pdf must be compressed using a lossless algorithm.
QList< QColor > highlightLabelBufferColorAsColor() const
Returns HIGHLIGHT_LABELBUFFERCOLOR as a list of colors.
QString request() const override
Returns REQUEST parameter as a string or an empty string if not defined.
double layerTitleSpaceAsDouble() const
Returns LAYERTITLESPACE as a double.
QList< QgsWmsParametersLayer > layersParameters() const
Returns parameters for each layer found in LAYER/LAYERS.
int lineToleranceAsInt() const
Returns FI_LINE_TOLERANCE parameter as an integer.
QList< double > highlightLabelBufferSizeAsFloat() const
Returns HIGHLIGHT_LABELBUFFERSIZE as a list of float.
QString lineTolerance() const
Returns FI_LINE_TOLERANCE parameter or an empty string if not defined.
bool showFeatureCountAsBool() const
Returns SHOWFEATURECOUNT as a bool.
QStringList pdfExportMapThemes() const
Returns map themes for geospatial PDF export.
Q_DECL_DEPRECATED bool pdfUseOgcBestPracticeFormatGeoreferencing() const
Returns true if OGC best practice georeferencing shall be used.
QStringList highlightLabelColor() const
Returns HIGHLIGHT_LABELCOLOR as a list of string.
bool pdfExportMetadata() const
Returns true if metadata shall be added to the pdf.
bool versionIsValid(const QString version) const
Returns true if version is valid, false otherwise.
QString j() const
Returns J parameter or an empty string if not defined.
int xAsInt() const
Returns X parameter as an int or its default value if not defined.
QColor layerFontColorAsColor() const
Returns LAYERFONTCOLOR as a color or its defined value if not defined.
QString bbox() const
Returns BBOX if defined or an empty string.
QgsWmsParameters()
Constructor for WMS parameters with default values only.
int heightAsInt() const
Returns HEIGHT parameter as an int or its default value if not defined.
QStringList highlightLabelWeight() const
Returns HIGHLIGHT_LABELWEIGHT as a list of string.
QString backgroundColor() const
Returns BGCOLOR parameter or an empty string if not defined.
QStringList allStyles() const
Returns styles found in STYLE and STYLES parameters.
double symbolWidthAsDouble() const
Returns SYMBOLWIDTH as a double or its default value if not defined.
QColor backgroundColorAsColor() const
Returns BGCOLOR parameter as a QColor or its default value if not defined.
Format format() const
Returns format.
QgsWmsParameter operator[](QgsWmsParameter::Name name) const
Returns the parameter corresponding to name.
QString itemFontSize() const
Returns ITEMFONTSIZE parameter or an empty string if not defined.
QStringList atlasPk() const
Returns the ATLAS_PK parameter.
QList< QgsGeometry > highlightGeomAsGeom() const
Returns HIGHLIGHT_GEOM as a list of geometries.
QString layerFontFamily() const
Returns LAYERFONTFAMILY parameter or an empty string if not defined.
QString withMapTipAsString() const
withMapTipAsString
QList< QgsWmsParametersHighlightLayer > highlightLayersParameters() const
Returns parameters for each highlight layer.
int iAsInt() const
Returns I parameter as an int or its default value if not defined.
QList< QColor > highlightLabelFrameOutlineColorAsColor() const
Returns HIGHLIGHT_LABELFRAMEOUTLINECOLOR as a list of colors.
QStringList highlightLabelBufferColor() const
Returns HIGHLIGHT_LABELBUFFERCOLOR as a list of string.
QStringList highlightLabelFrameOutlineWidth() const
Returns HIGHLIGHT_LABELFRAMEOUTLINEWIDTH.
bool pdfAppendGeoreference() const
Returns true if georeference info shall be added to the pdf.
int polygonToleranceAsInt() const
Returns FI_POLYGON_TOLERANCE parameter as an integer.
bool ruleLabelAsBool() const
Returns RULELABEL as a bool.
QList< double > highlightLabelDistance() const
Returns HIGHLIGHT_LABEL_DISTANCE as a list of double.
QList< int > highlightLabelSizeAsInt() const
Returns HIGHLIGHT_LABELSIZE as a list of int An exception is raised if an invalid size is found.
int widthAsInt() const
Returns WIDTH parameter as an int or its default value if not defined.
QString sldBody() const
Returns SLD_body if defined or an empty string.
bool itemFontItalicAsBool() const
Returns ITEMFONTITALIC as a boolean or its default value if not defined.
bool pdfDisableTiledRasterRendering() const
Returns true if rasters shall be untiled in the pdf.
QColor itemFontColorAsColor() const
Returns ITEMFONTCOLOR as a color.
double itemFontSizeAsDouble() const
Returns ITEMFONTSIZE as a double.
QString layerFontColor() const
Returns LAYERFONTCOLOR parameter or an empty string if not defined.
QString layoutParameter(const QString &id, bool &ok) const
Returns a layout parameter thanks to its id.
bool dxfUseLayerTitleAsName() const
Returns the DXF USE_TITLE_AS_LAYERNAME parameter.
QString symbolHeight() const
Returns SYMBOLHEIGHT parameter or an empty string if not defined.
int imageQualityAsInt() const
Returns IMAGE_QUALITY parameter as an integer.
bool pdfForceVectorOutput() const
Returns if pdf should be exported as vector.
QStringList highlightLabelFrameOutlineColor() const
Returns HIGHLIGHT_LABELFRAMEOUTLINECOLOR.
bool writeGeospatialPdf() const
Returns if a geospatial PDF shall be exported.
bool pdfUseIso32000ExtensionFormatGeoreferencing() const
Returns true, if Iso32000 georeferencing shall be used.
QMap< QString, QString > dimensionValues() const
Returns the dimensions parameter.
QList< QgsWmsParametersExternalLayer > externalLayersParameters() const
Returns parameters for each external layer.
bool withDisplayName() const
withDisplayName
int infoFormatVersion() const
Returns the infoFormat version for GML.
QStringList highlightLabelFrameBackgroundColor() const
Returns HIGHLIGHT_LABELFRAMEBACKGROUNDCOLOR.
QString layerFontBold() const
Returns LAYERFONTBOLD parameter or an empty string if not defined.
QgsLegendSettings legendSettings() const
Returns legend settings.
int srcHeightAsInt() const
Returns SRCHEIGHT parameter as an int or its default value if not defined.
QString symbolSpace() const
Returns SYMBOLSPACE parameter or an empty string if not defined.
QString itemFontBold() const
Returns ITEMFONTBOLD parameter or an empty string if not defined.
double symbolSpaceAsDouble() const
Returns SYMBOLSPACE as a double or its default value if not defined.
QString infoFormatAsString() const
Returns INFO_FORMAT parameter as a string.
QStringList highlightLabelFont() const
Returns HIGHLIGHT_LABELFONT.
Qgis::TextRenderFormat pdfTextRenderFormat() const
Returns text render format for pdf export.
QString wmtver() const
Returns WMTVER parameter or an empty string if not defined.
QStringList dxfLayerAttributes() const
Returns the DXF LAYERATTRIBUTES parameter.
QString srcWidth() const
Returns SRCWIDTH parameter or an empty string if not defined.
@ LOSSLESS_IMAGE_COMPRESSION
@ DISABLE_TILED_RASTER_RENDERING
@ USE_ISO_32000_EXTENSION_FORMAT_GEOREFERENCING
Qgis::FeatureSymbologyExport dxfMode() const
Returns the DXF MODE parameter.
QStringList highlightLabelSize() const
Returns HIGHLIGHT_LABELSIZE as a list of string.
QString imageQuality() const
Returns IMAGE_QUALITY parameter or an empty string if not defined.
QList< double > highlightLabelRotation() const
Returns HIGHLIGHT_LABEL_ROTATION as a list of double.
QString height() const
Returns HEIGHT parameter or an empty string if not defined.
QString crs() const
Returns CRS or an empty string if none is defined.
bool showRuleDetailsAsBool() const
Returns SHOWRULEDETAILS as a bool.
QStringList selections() const
Returns the list of feature selection found in SELECTION parameter.
bool exportLinesWithZeroWidth() const
int featureCountAsInt() const
Returns FEATURE_COUNT as an integer.
int yAsInt() const
Returns Y parameter as an int or its default value if not defined.
bool layerTitleAsBool() const
Returns LAYERTITLE as a bool or its default value if not defined.
QMap< T, QString > formatOptions() const
Returns the format options for an output format.
QString itemFontColor() const
Returns ITEMFONTCOLOR parameter or an empty string if not defined.
double boxSpaceAsDouble() const
Returns BOXSPACE as a double or its default value if not defined.
bool addLayerGroups() const
Returns true if layer groups shall be added to GetLegendGraphic results.
QString symbolWidth() const
Returns SYMBOLWIDTH parameter or an empty string if not defined.
bool tiledAsBool() const
Returns TILED parameter as a boolean.
QList< double > highlightLabelFrameOutlineWidthAsFloat() const
Returns HIGHLIGHT_LABELFRAMEOUTLINEWIDTH as a list of widths.
Format
Output format for the response.
QString width() const
Returns WIDTH parameter or an empty string if not defined.
QFont itemFont() const
Returns the item font (built thanks to the ITEMFONTFAMILY, ITEMFONTSIZE, ITEMFONTBOLD,...
QStringList opacities() const
Returns the list of opacities found in OPACITIES parameter.
QString version() const override
Returns VERSION parameter as a string or an empty string if not defined.
QString layerFontItalic() const
Returns LAYERFONTITALIC parameter or an empty string if not defined.
QString itemFontItalic() const
Returns ITEMFONTITALIC parameter or an empty string if not defined.
QStringList filters() const
Returns the list of filters found in FILTER parameter.
QString dpi() const
Returns DPI parameter or an empty string if not defined.
QString itemFontFamily() const
Returns ITEMFONTFAMILY parameter or an empty string if not defined.
int jAsInt() const
Returns J parameter as an int or its default value if not defined.
QVector< qreal > pdfPredefinedMapScales() const
Returns list of map scales.
QString showFeatureCount() const
Returns SHOWFEATURECOUNT parameter or an empty string if none is defined.
bool pdfSimplifyGeometries() const
Returns if geometries shall to be simplified.
bool layerFontBoldAsBool() const
Returns LAYERFONTBOLD as a boolean or its default value if not defined.
double iconLabelSpaceAsDouble() const
Returns ICONLABELSPACE as a double or its default value if not defined.
QStringList highlightSymbol() const
Returns HIGHLIGHT_SYMBOL as a list of string.
QStringList queryLayersNickname() const
Returns nickname of layers found in QUERY_LAYERS parameter.
double symbolHeightAsDouble() const
Returns SYMBOLHEIGHT as a double or its default value if not defined.
bool infoFormatIsImage() const
Checks if INFO_FORMAT parameter is one of the image formats (PNG, JPG).
int srcWidthAsInt() const
Returns SRCWIDTH parameter as an int or its default value if not defined.
Median cut implementation.
const QString EXTERNAL_LAYER_PREFIX
QList< QgsWmsParametersLayer > mLayers
QList< QgsWmsParametersHighlightLayer > mHighlightLayers
QgsWmsParametersFilter::Type mType
QgsOgcUtils::FilterVersion mVersion
QColor mFrameOutlineColor
QColor mFrameBackgroundColor
double mFrameOutlineWidth
QList< QgsWmsParametersFilter > mFilter