QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
32 const QVariant::Type type,
33 const QVariant defaultValue )
62 const QString msg = QString(
"%1 ('%2') cannot be converted into a list of geometries" ).arg(
name(
mName ),
toString() );
76 const QString msg = QString(
"%1 ('%2') cannot be converted into a rectangle" ).arg(
name(
mName ),
toString() );
99 const QUrl url =
toUrl();
106 const QString msg = QString(
"%1 request error for %2" ).arg(
name(
mName ), url.toString() );
146 const QString msg = QString(
"%1 ('%2') cannot be converted into a list of colors" ).arg(
name(
mName ),
toString() );
160 const QString msg = QString(
"%1 ('%2') cannot be converted into a list of int" ).arg(
name(
mName ),
toString() );
174 const QString msg = QString(
"%1 ('%2') cannot be converted into a list of float" ).arg(
name(
mName ),
toString() );
201 const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameter::Name>() );
202 return metaEnum.valueToKey(
name );
207 const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameter::Name>() );
265 save( pIcLabelSpace );
268 save( pItFontFamily );
278 save( pItFontItalic );
287 QVariant(
"black" ) );
288 save( pItFontColor );
291 save( pHighlightGeom );
296 save( pShowFeatureCount );
299 save( pHighlightSymbol );
302 save( pHighlightLabel );
306 QVariant(
"black" ) );
307 save( pHighlightColor );
310 save( pHighlightFontSize );
313 save( pHighlightFontWeight );
316 save( pHighlightFont );
320 QVariant(
"black" ) );
321 save( pHighlightBufferColor );
324 save( pHighlightBufferSize );
327 save( pLabelRotation );
330 save( pLabelDistance );
421 save( pQueryLayers );
426 save( pFeatureCount );
434 save( pLayerFtFamily );
439 save( pLayerFtBold );
444 save( pLayerFtItalic );
449 save( pLayerFtSize );
453 QVariant(
"black" ) );
454 save( pLayerFtColor );
492 save( pWmsPrecision );
497 save( pTransparent );
501 QVariant(
"white" ) );
533 save( pWithGeometry );
544 QVariant::StringList );
558 if ( !sld.isEmpty() )
570 return mWmsParameters[name];
575 mWmsParameters[name].mValue =
value;
578 bool QgsWmsParameters::loadParameter(
const QString &key,
const QString &value )
582 const QRegExp composerParamRegExp( QStringLiteral(
"^MAP\\d+:" ), Qt::CaseInsensitive );
583 if ( key.contains( composerParamRegExp ) )
585 #if QT_VERSION < QT_VERSION_CHECK(5, 15, 2)
586 const int mapId = key.midRef( 3, key.indexOf(
':' ) - 3 ).toInt();
588 const int mapId = QStringView {key}.mid( 3, key.indexOf(
':' ) - 3 ).toInt();
590 const QString theKey = key.mid( key.indexOf(
':' ) + 1 );
595 QgsWmsParameter param = mWmsParameters[name];
596 param.mValue =
value;
597 param.mMapId = mapId;
599 if ( ! param.isValid() )
613 mWmsParameters[name].mValue =
value;
614 if ( ! mWmsParameters[name].isValid() )
616 mWmsParameters[name].raiseError();
623 int separator = key.indexOf( QLatin1Char(
':' ) );
624 if ( separator >= 1 )
626 QString
id = key.left( separator );
627 QString param = key.right( key.length() - separator - 1 );
628 mExternalWMSParameters[id].insert( param,
value );
640 log( QStringLiteral(
"WMS Request parameters:" ) );
641 for (
auto parameter : mWmsParameters.toStdMap() )
643 const QString
value = parameter.second.toString();
645 if ( !
value.isEmpty() )
649 if ( parameter.second.mMapId >= 0 )
651 name = QStringLiteral(
"%1:%2" ).arg( QString::number( parameter.second.mMapId ), name );
654 log( QStringLiteral(
" - %1 : %2" ).arg( name,
value ) );
659 log( QStringLiteral(
" - VERSION : %1" ).arg(
version() ) );
662 void QgsWmsParameters::save(
const QgsWmsParameter ¶meter,
bool multi )
666 mWmsParameters.insertMulti( parameter.
mName, parameter );
670 mWmsParameters[ parameter.
mName ] = parameter;
697 if ( !srs.isEmpty() &&
crs.isEmpty() )
699 else if ( srs.isEmpty() && !
crs.isEmpty() )
701 else if ( !srs.isEmpty() && !
crs.isEmpty() )
778 version = QStringLiteral(
"1.3.0" );
782 if ( !
wmtver().isEmpty() )
788 version = QStringLiteral(
"1.3.0" );
798 version = QStringLiteral(
"1.1.1" );
802 version = QStringLiteral(
"1.3.0" );
813 if (
version().compare( QLatin1String(
"1.1.1" ) ) == 0
814 && req.compare( QLatin1String(
"capabilities" ), Qt::CaseInsensitive ) == 0 )
816 req = QStringLiteral(
"GetCapabilities" );
839 const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameters::Format>() );
840 return metaEnum.valueToKey(
format );
848 if ( fStr.compare( QLatin1String(
"image/png" ), Qt::CaseInsensitive ) == 0 ||
849 fStr.compare( QLatin1String(
"png" ), Qt::CaseInsensitive ) == 0 )
853 else if ( fStr.compare( QLatin1String(
"jpg" ), Qt::CaseInsensitive ) == 0
854 || fStr.compare( QLatin1String(
"jpeg" ), Qt::CaseInsensitive ) == 0
855 || fStr.compare( QLatin1String(
"image/jpeg" ), Qt::CaseInsensitive ) == 0 )
859 else if ( fStr.compare( QLatin1String(
"image/svg" ), Qt::CaseInsensitive ) == 0 ||
860 fStr.compare( QLatin1String(
"image/svg+xml" ), Qt::CaseInsensitive ) == 0 ||
861 fStr.compare( QLatin1String(
"svg" ), Qt::CaseInsensitive ) == 0 )
865 else if ( fStr.compare( QLatin1String(
"application/pdf" ), Qt::CaseInsensitive ) == 0 ||
866 fStr.compare( QLatin1String(
"pdf" ), Qt::CaseInsensitive ) == 0 )
870 else if ( fStr.compare( QLatin1String(
"application/json" ), Qt::CaseInsensitive ) == 0 ||
871 fStr.compare( QLatin1String(
"json" ), Qt::CaseInsensitive ) == 0 )
893 if ( fStr.isEmpty() )
896 if ( fStr.startsWith( QLatin1String(
"text/xml" ), Qt::CaseInsensitive ) )
898 else if ( fStr.startsWith( QLatin1String(
"text/html" ), Qt::CaseInsensitive ) )
900 else if ( fStr.startsWith( QLatin1String(
"text/plain" ), Qt::CaseInsensitive ) )
902 else if ( fStr.startsWith( QLatin1String(
"application/vnd.ogc.gml" ), Qt::CaseInsensitive ) )
904 else if ( fStr.startsWith( QLatin1String(
"application/json" ), Qt::CaseInsensitive )
905 || fStr.startsWith( QLatin1String(
"application/geo+json" ), Qt::CaseInsensitive ) )
919 if ( fStr.startsWith( QLatin1String(
"application/vnd.ogc.gml/3" ), Qt::CaseInsensitive ) )
1233 font.fromString(
"" );
1249 font.fromString(
"" );
1456 const QStringList layersList { param.toStringList() };
1457 for (
const QString &layerName : std::as_const( layersList ) )
1459 if ( ! result.contains( layerName ) )
1460 result.append( layerName );
1470 const QStringList layersList { param.toStringList() };
1471 for (
const QString &layerName : std::as_const( layersList ) )
1473 if ( ! result.contains( layerName ) )
1474 result.append( layerName );
1489 return style << styles;
1492 QMultiMap<QString, QgsWmsParametersFilter> QgsWmsParameters::layerFilters(
const QStringList &layers )
const
1494 const QString nsWfs2 = QStringLiteral(
"http://www.opengis.net/fes/2.0" );
1495 const QString prefixWfs2 = QStringLiteral(
"<fes:" );
1497 const QStringList rawFilters =
filters();
1498 QMultiMap<QString, QgsWmsParametersFilter>
filters;
1499 for (
int i = 0;
i < rawFilters.size();
i++ )
1501 const QString f = rawFilters[
i];
1502 if ( f.startsWith( QLatin1Char(
'<' ) ) \
1503 && f.endsWith( QLatin1String(
"Filter>" ) ) \
1504 &&
i < layers.size() )
1511 if ( filter.
mFilter.contains( nsWfs2 ) \
1512 || filter.
mFilter.contains( prefixWfs2 ) )
1517 filters.insert( layers[
i], filter );
1519 else if ( !f.isEmpty() )
1523 const int colonIndex = f.indexOf(
':' );
1524 if ( colonIndex != -1 )
1526 const QString layers = f.section(
':', 0, 0 );
1527 const QString filter = f.section(
':', 1 );
1528 const QStringList layersList = layers.split(
',' );
1529 for (
const QString &layer : layersList )
1531 QgsWmsParametersFilter parametersFilter;
1532 parametersFilter.
mFilter = filter;
1534 filters.insert( layer, parametersFilter );
1540 raiseError( QStringLiteral(
"FILTER ('" ) + filterStr + QStringLiteral(
"') is not properly formatted" ) );
1549 bool force2D =
false;
1552 if ( options.contains( DxfFormatOption::FORCE_2D ) )
1554 force2D = QVariant( options[ DxfFormatOption::FORCE_2D ] ).toBool();
1565 if ( options.contains( DxfFormatOption::NO_MTEXT ) )
1567 noMText = QVariant( options[ DxfFormatOption::NO_MTEXT ] ).toBool();
1580 const QMultiMap<QString, QgsWmsParametersFilter>
filters = layerFilters( layers );
1584 QMultiMap<QString, QString> layerSelections;
1585 for (
const QString &s : selection )
1587 const QStringList splits = s.split(
':' );
1588 if ( splits.size() == 2 )
1590 layerSelections.insert( splits[0], splits[1] );
1595 raiseError( QStringLiteral(
"SELECTION ('" ) + selStr + QStringLiteral(
"') is not properly formatted" ) );
1599 QList<QgsWmsParametersLayer> parameters;
1600 for (
int i = 0;
i < layers.size();
i++ )
1602 QString layer = layers[
i];
1610 if ( isExternalLayer( layer ) )
1618 if (
i < styles.count() )
1621 if (
filters.contains( layer ) )
1623 auto it =
filters.find( layer );
1624 while ( it !=
filters.end() && it.key() == layer )
1626 param.
mFilter.append( it.value() );
1631 if ( layerSelections.contains( layer ) )
1633 QMultiMap<QString, QString>::const_iterator it;
1634 it = layerSelections.constFind( layer );
1635 while ( it != layerSelections.constEnd() && it.key() == layer )
1643 parameters.append( param );
1651 QList<QgsWmsParametersHighlightLayer> params;
1666 int nLayers = std::min( geoms.size(), slds.size() );
1667 for (
int i = 0;
i < nLayers;
i++ )
1670 param.
mName = QStringLiteral(
"highlight_" ) + QString::number(
i );
1672 param.
mSld = slds[
i];
1674 if (
i < labels.count() )
1677 if (
i < colors.count() )
1680 if (
i < sizes.count() )
1683 if (
i < weights.count() )
1686 if (
i < fonts.count() )
1687 param.
mFont = fonts[
i ];
1689 if (
i < bufferColors.count() )
1692 if (
i < bufferSizes.count() )
1695 if (
i < rotation.count() )
1698 if (
i < distance.count() )
1701 if (
i < hali.count() )
1704 if (
i < vali.count() )
1709 params.append( param );
1717 auto notExternalLayer = [](
const QString & name ) {
return ! QgsWmsParameters::isExternalLayer( name ); };
1719 QList<QgsWmsParametersExternalLayer> externalLayers;
1722 QStringList::iterator rit = std::remove_if( layers.begin(), layers.end(), notExternalLayer );
1724 for ( QStringList::iterator it = layers.begin(); it != rit; ++it )
1726 externalLayers << externalLayerParameter( *it );
1729 return externalLayers;
1753 QString pMapId = QStringLiteral(
"MAP" ) + QString::number( mapId );
1780 double gridx( -1 ), gridy( -1 );
1794 if ( gridx != -1 && gridy != -1 )
1801 QStringList allLayers;
1811 for (
const auto &layer : std::as_const( allLayers ) )
1813 if ( isExternalLayer( layer ) )
1816 layers << extParam.
mName;
1831 QList<QgsWmsParametersLayer> lParams;
1832 for (
int i = 0;
i < layers.size();
i++ )
1834 QString layer = layers[
i];
1838 if (
i < styles.count() )
1841 lParams.append( lParam );
1846 QList<QgsWmsParametersHighlightLayer> hParams;
1848 QList<QgsGeometry> geoms;
1876 QList<QColor> colors;
1897 QList<QColor> bufferColors;
1904 QList<double> bufferSizes;
1911 QList<double> rotations;
1918 QList<double> distances;
1939 int nHLayers = std::min( geoms.size(), slds.size() );
1940 for (
int i = 0;
i < nHLayers;
i++ )
1943 hParam.
mName = pMapId + QStringLiteral(
"_highlight_" ) + QString::number(
i );
1945 hParam.
mSld = slds[
i];
1947 if (
i < labels.count() )
1950 if (
i < colors.count() )
1953 if (
i < sizes.count() )
1956 if (
i < weights.count() )
1959 if (
i < fonts.count() )
1960 hParam.
mFont = fonts[
i ];
1962 if (
i < bufferColors.count() )
1965 if (
i < bufferSizes.count() )
1968 if (
i < rotations.count() )
1971 if (
i < distances.count() )
1974 if (
i < halis.count() )
1977 if (
i < valis.count() )
1980 hParams.append( hParam );
1991 QString
id { layerId };
1993 for (
auto it = mExternalWMSParameters.cbegin(); it != mExternalWMSParameters.cend(); ++it )
1995 if ( it.key().compare(
id, Qt::CaseSensitivity::CaseInsensitive ) == 0 )
2002 if ( !mExternalWMSParameters.contains(
id ) )
2008 const QMap<QString, QString> ¶mMap = mExternalWMSParameters[ id ];
2009 QMap<QString, QString>::const_iterator paramIt = paramMap.constBegin();
2010 for ( ; paramIt != paramMap.constEnd(); ++paramIt )
2012 QString paramName = paramIt.key().toLower();
2013 if ( paramName == QLatin1String(
"layers" ) || paramName == QLatin1String(
"styles" ) || paramName == QLatin1String(
"opacities" ) )
2015 const QStringList values = paramIt.value().split(
',' );
2016 for (
const QString &
value : values )
2019 else if ( paramName == QLatin1String(
"ignorereportedlayerextents" ) )
2021 wmsUri.
setParam( QStringLiteral(
"IgnoreReportedLayerExtents" ), paramIt.value() );
2023 else if ( paramName == QLatin1String(
"smoothpixmaptransform" ) )
2025 wmsUri.
setParam( QStringLiteral(
"SmoothPixmapTransform" ), paramIt.value() );
2027 else if ( paramName == QLatin1String(
"ignoregetmapurl" ) )
2029 wmsUri.
setParam( QStringLiteral(
"IgnoreGetMapUrl" ), paramIt.value() );
2031 else if ( paramName == QLatin1String(
"ignoregetfeatureinfourl" ) )
2033 wmsUri.
setParam( QStringLiteral(
"IgnoreGetFeatureInfoUrl" ), paramIt.value() );
2035 else if ( paramName == QLatin1String(
"ignoreaxisorientation" ) )
2037 wmsUri.
setParam( QStringLiteral(
"IgnoreAxisOrientation" ), paramIt.value() );
2039 else if ( paramName == QLatin1String(
"invertaxisorientation" ) )
2041 wmsUri.
setParam( QStringLiteral(
"InvertAxisOrientation" ), paramIt.value() );
2043 else if ( paramName == QLatin1String(
"dpimode" ) )
2045 wmsUri.
setParam( QStringLiteral(
"dpiMode" ), paramIt.value() );
2049 wmsUri.
setParam( paramName, paramIt.value() );
2070 void QgsWmsParameters::log(
const QString &msg )
const
2075 void QgsWmsParameters::raiseError(
const QString &msg )
const
2080 QgsWmsParameter QgsWmsParameters::idParameter(
const QgsWmsParameter::Name name,
const int id )
const
2084 for (
const auto ¶m : mWmsParameters.values( name ) )
2086 if ( param.mMapId ==
id )
2095 QgsWmsParametersExternalLayer QgsWmsParameters::externalLayerParameter(
const QString &name )
const
2097 QgsWmsParametersExternalLayer param;
2106 bool QgsWmsParameters::isExternalLayer(
const QString &name )
2113 QStringList attributes;
2116 if ( options.contains( DxfFormatOption::LAYERATTRIBUTES ) )
2118 attributes = options[ DxfFormatOption::LAYERATTRIBUTES ].split(
',' );
2129 if ( options.contains( DxfFormatOption::USE_TITLE_AS_LAYERNAME ) )
2131 use = QVariant( options[ DxfFormatOption::USE_TITLE_AS_LAYERNAME ] ).toBool();
2142 if ( options.contains( DxfFormatOption::SCALE ) )
2144 scale = options[ DxfFormatOption::SCALE ].toDouble();
2156 if ( ! options.contains( DxfFormatOption::MODE ) )
2161 const QString mode = options[ DxfFormatOption::MODE ];
2162 if ( mode.compare( QLatin1String(
"SymbolLayerSymbology" ), Qt::CaseInsensitive ) == 0 )
2166 else if ( mode.compare( QLatin1String(
"FeatureSymbology" ), Qt::CaseInsensitive ) == 0 )
2176 QString codec = QStringLiteral(
"ISO-8859-1" );
2188 QMap<QgsWmsParameters::DxfFormatOption, QString> options;
2190 const QMetaEnum metaEnum( QMetaEnum::fromType<QgsWmsParameters::DxfFormatOption>() );
2193 for (
auto it = opts.constBegin(); it != opts.constEnd(); ++it )
2195 const int equalIdx = it->indexOf(
':' );
2196 if ( equalIdx > 0 && equalIdx < ( it->length() - 1 ) )
2198 const QString name = it->left( equalIdx ).toUpper();
2201 const QString
value = it->right( it->length() - equalIdx - 1 );
2202 options.insert( option,
value );
2211 QMap<QString, QString> dimValues;
2212 const QMetaEnum pnMetaEnum( QMetaEnum::fromType<QgsMapLayerServerProperties::PredefinedWmsDimensionName>() );
2214 for (
const QString &key : unmanagedNames )
2216 if ( key.startsWith( QLatin1String(
"DIM_" ) ) )
2220 else if ( pnMetaEnum.keyToValue( key.toUpper().toStdString().c_str() ) != -1 )
QString layerFontBold() const
Returns LAYERFONTBOLD parameter or an empty string if not defined.
QStringList highlightGeom() const
Returns HIGHLIGHT_GEOM as a list of string in WKT.
QString transparent() const
Returns TRANSPARENT parameter or an empty string if not defined.
QgsRectangle toRectangle() const
Converts the parameter into a rectangle.
QString loadUrl() const
Loads the data associated to the parameter converted into an url.
@ QGIS_InvalidParameterValue
QString srcHeight() const
Returns SRCHEIGHT parameter or an empty string if not defined.
Provides an interface to retrieve and manipulate WMS parameters received from the client.
QgsWmsParameter::Name mName
double layerTitleSpaceAsDouble() const
Returns LAYERTITLESPACE as a double.
QString name() const
Returns the name of the parameter.
void set(QgsWmsParameter::Name name, const QVariant &value)
Sets a parameter value thanks to its name.
Class for storing the component parts of a RDBMS data source URI (e.g. a Postgres data source).
bool infoFormatIsImage() const
Checks if INFO_FORMAT parameter is one of the image formats (PNG, JPG).
int wmsPrecisionAsInt() const
Returns WMS_PRECISION parameter as an int or its default value if not defined.
QStringList opacities() const
Returns the list of opacities found in OPACITIES parameter.
QString symbolWidth() const
Returns SYMBOLWIDTH parameter or an empty string if not defined.
static void raiseError(const QString &msg)
Raises an exception in case of an invalid parameters.
int toInt() const
Converts the parameter into an integer.
bool layerFontItalicAsBool() const
Returns LAYERFONTITALIC as a boolean or its default value if not defined.
bool showFeatureCountAsBool() const
Returns SHOWFEATURECOUNT as a bool.
QList< int > toIntList(const char delimiter=',') const
Converts the parameter into a list of integers.
QString wmtver() const
Returns WMTVER parameter or an empty string if not defined.
int heightAsInt() const
Returns HEIGHT parameter as an int or its default value if not defined.
void setSymbolSize(QSizeF s)
Sets the default symbol size (in millimeters) used for legend items.
virtual QString request() const
Returns REQUEST parameter as a string or an empty string if not defined.
int infoFormatVersion() const
Returns the infoFormat version for GML.
int srcHeightAsInt() const
Returns SRCHEIGHT parameter as an int or its default value if not defined.
void setFont(const QFont &font)
Sets the font used for rendering this legend component.
QList< QgsWmsParametersLayer > mLayers
QList< QgsWmsParametersHighlightLayer > mHighlightLayers
QString wmsPrecision() const
Returns WMS_PRECISION parameter or an empty string if not defined.
QString crs() const
Returns CRS or an empty string if none is defined.
Format
Output format for the response.
void load(const QUrlQuery &query)
Loads new parameters.
QString layerFontSize() const
Returns LAYERFONTSIZE parameter or an empty string if not defined.
QgsLegendSettings legendSettings() const
Returns legend settings.
QString iconLabelSpace() const
Returns ICONLABELSPACE parameter or an empty string if not defined.
QgsWmsParameter operator[](QgsWmsParameter::Name name) const
Returns the parameter corresponding to name.
QString bbox() const
Returns BBOX if defined or an empty string.
QString infoFormatAsString() const
Returns INFO_FORMAT parameter as a string.
int featureCountAsInt() const
Returns FEATURE_COUNT as an integer.
void setMargin(Side side, double margin)
Sets the margin (in mm) for the specified side of the component.
QString i() const
Returns I parameter or an empty string if not defined.
QStringList highlightLabelWeight() const
Returns HIGHLIGHT_LABELWEIGHT as a list of string.
QString boxSpace() const
Returns BOXSPACE parameter or an empty string if not defined.
void setBoxSpace(double s)
Sets the legend box space (in millimeters), which is the empty margin around the inside of the legend...
bool itemFontBoldAsBool() const
Returns ITEMFONTBOLD as a boolean or its default value if not defined.
QList< double > highlightLabelBufferSizeAsFloat() const
Returns HIGHLIGHT_LABELBUFFERSIZE as a list of float.
bool transparentAsBool() const
Returns TRANSPARENT parameter as a bool or its default value if not defined.
QString layerTitleSpace() const
Returns LAYERTITLESPACE parameter or an empty string if not defined.
QColor itemFontColorAsColor() const
Returns ITEMFONTCOLOR as a color.
QString dpi() const
Returns DPI parameter or an empty string if not defined.
QString featureCount() const
Returns FEATURE_COUNT parameter or an empty string if none is defined.
QString itemFontItalic() const
Returns ITEMFONTITALIC parameter or an empty string if not defined.
QString symbolSpace() const
Returns SYMBOLSPACE parameter or an empty string if not defined.
QString value(const QString &key) const
Returns the value of a parameter.
void raiseError() const
Raises an error in case of an invalid conversion.
double toDouble(bool &ok) const
Converts the parameter into a double.
QStringList toStringList(char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of strings.
QString loadUrl(bool &ok) const
Loads the data associated to the parameter converted into an url.
A rectangle specified with double values.
QString itemFontSize() const
Returns ITEMFONTSIZE parameter or an empty string if not defined.
QList< int > highlightLabelWeightAsInt() const
Returns HIGHLIGHT_LABELWEIGHT as a list of int.
QString itemFontBold() const
Returns ITEMFONTBOLD parameter or an empty string if not defined.
QStringList highlightLabelFont() const
Returns HIGHLIGHT_LABELFONT.
bool withMapTip() const
withMapTip
QString imageQuality() const
Returns IMAGE_QUALITY parameter or an empty string if not defined.
QList< int > opacitiesAsInt() const
Returns the list of opacities found in OPACITIES parameter as integers.
QStringList highlightLabelBufferSize() const
Returns HIGHLIGHT_LABELBUFFERSIZE.
QStringList highlightLabelBufferColor() const
Returns HIGHLIGHT_LABELBUFFERCOLOR as a list of string.
QString srcWidth() const
Returns SRCWIDTH parameter or an empty string if not defined.
virtual QString version() const
Returns VERSION parameter as a string or an empty string if not defined.
QString height() const
Returns HEIGHT parameter or an empty string if not defined.
QString symbolHeight() const
Returns SYMBOLHEIGHT parameter or an empty string if not defined.
QStringList queryLayersNickname() const
Returns nickname of layers found in QUERY_LAYERS parameter.
QString sldBody() const
Returns SLD_body if defined or an empty string.
QMap< QString, QString > mUnmanagedParameters
int widthAsInt() const
Returns WIDTH parameter as an int or its default value if not defined.
QString layerFontFamily() const
Returns LAYERFONTFAMILY parameter or an empty string if not defined.
@ HIGHLIGHT_LABELBUFFERCOLOR
QUrl toUrl(bool &ok) const
Converts the parameter into an url.
QColor toColor() const
Converts the parameter into a color.
QList< double > highlightLabelRotation() const
Returns HIGHLIGHT_LABEL_ROTATION as a list of double.
QList< double > highlightLabelDistance() const
Returns HIGHLIGHT_LABEL_DISTANCE as a list of double.
int polygonToleranceAsInt() const
Returns FI_POLYGON_TOLERANCE parameter as an integer.
QString itemFontColor() const
Returns ITEMFONTCOLOR parameter or an empty string if not defined.
QString x() const
Returns X parameter or an empty string if not defined.
QgsProjectVersion versionAsNumber() const
Returns VERSION parameter if defined or its default value.
@ HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT
const QString EXTERNAL_LAYER_PREFIX
void setTitle(const QString &t)
Sets the title for the legend, which will be rendered above all legend items.
QString lineTolerance() const
Returns FI_LINE_TOLERANCE parameter or an empty string if not defined.
int yAsInt() const
Returns Y parameter as an int or its default value if not defined.
QFont layerFont() const
Returns the layer font (built thanks to the LAYERFONTFAMILY, LAYERFONTSIZE, LAYERFONTBOLD,...
QStringList highlightLabelColor() const
Returns HIGHLIGHT_LABELCOLOR as a list of string.
Definition of a parameter with basic conversion methods.
QgsWmsParametersFilter::Type mType
QgsWmsParameter(const QgsWmsParameter::Name name=QgsWmsParameter::UNKNOWN, const QVariant::Type type=QVariant::String, const QVariant defaultValue=QVariant(""))
Constructor for QgsWmsParameter.
QList< double > toDoubleList(const char delimiter=',') const
Converts the parameter into a list of doubles.
double layerFontSizeAsDouble() const
Returns LAYERFONTSIZE as a double.
QString backgroundColor() const
Returns BGCOLOR parameter or an empty string if not defined.
double symbolSpaceAsDouble() const
Returns SYMBOLSPACE as a double or its default value if not defined.
bool ruleLabelAsBool() const
Returns RULELABEL as a bool.
void setParam(const QString &key, const QString &value)
Sets a generic parameter value on the URI.
QStringList highlightSymbol() const
Returns HIGHLIGHT_SYMBOL as a list of string.
int lineToleranceAsInt() const
Returns FI_LINE_TOLERANCE parameter as an integer.
QString tiled() const
Returns TILED parameter or an empty string if not defined.
double toDouble() const
Converts the parameter into a double.
QStringList highlightLabelVerticalAlignment() const
Returns HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT as a list of string.
QString version() const override
Returns VERSION parameter as a string or an empty string if not defined.
int xAsInt() const
Returns X parameter as an int or its default value if not defined.
double dpiAsDouble() const
Returns DPI parameter as an int or its default value if not defined.
The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLege...
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
QString toString(bool defaultValue=false) const
Converts the parameter into a string.
QgsOgcUtils::FilterVersion mVersion
QList< QgsWmsParametersLayer > layersParameters() const
Returns parameters for each layer found in LAYER/LAYERS.
double itemFontSizeAsDouble() const
Returns ITEMFONTSIZE as a double.
QgsRectangle bboxAsRectangle() const
Returns BBOX as a rectangle if defined and valid.
QString j() const
Returns J parameter or an empty string if not defined.
QUrl toUrl() const
Converts the parameter into an url.
int pointToleranceAsInt() const
Returns FI_POINT_TOLERANCE parameter as an integer.
QColor toColor(bool &ok) const
Converts the parameter into a color.
QString filterGeom() const
Returns the filter geometry found in FILTER_GEOM parameter.
QString showFeatureCount() const
Returns SHOWFEATURECOUNT parameter or an empty string if none is defined.
QString layerTitle() const
Returns LAYERTITLE parameter or an empty string if not defined.
bool itemFontItalicAsBool() const
Returns ITEMFONTITALIC as a boolean or its default value if not defined.
Format format() const
Returns format.
QFont itemFont() const
Returns the item font (built thanks to the ITEMFONTFAMILY, ITEMFONTSIZE, ITEMFONTBOLD,...
QList< QgsWmsParametersExternalLayer > externalLayersParameters() const
Returns parameters for each external layer.
QgsWmsParametersComposerMap composerMapParameters(int mapId) const
Returns the requested parameters for a composer map parameter.
double scaleAsDouble() const
Returns SCALE as a double.
QMap< DxfFormatOption, QString > dxfFormatOptions() const
Returns a map of DXF options defined within FORMAT_OPTIONS parameter.
QgsWmsParameters()
Constructor for WMS parameters with default values only.
QString composerTemplate() const
Returns TEMPLATE parameter or an empty string if not defined.
@ HIGHLIGHT_LABEL_ROTATION
Median cut implementation.
int toInt(bool &ok) const
Converts the parameter into an integer.
QStringList allStyles() const
Returns styles found in STYLE and STYLES parameters.
QColor backgroundColorAsColor() const
Returns BGCOLOR parameter as a QColor or its default value if not defined.
QList< QgsGeometry > toGeomList(const char delimiter=',') const
Converts the parameter into a list of geometries.
QString layerFontItalic() const
Returns LAYERFONTITALIC parameter or an empty string if not defined.
void setFontColor(const QColor &c)
Sets the font color used for legend items.
QByteArray encodedUri() const
Returns the complete encoded URI as a byte array.
QString layerSpace() const
Returns LAYERSPACE parameter or an empty string if not defined.
QList< int > highlightLabelSizeAsInt() const
Returns HIGHLIGHT_LABELSIZE as a list of int An exception is raised if an invalid size is found.
QString layoutParameter(const QString &id, bool &ok) const
Returns a layout parameter thanks to its id.
QStringList atlasPk() const
Returns the ATLAS_PK parameter.
bool layerTitleAsBool() const
Returns LAYERTITLE as a bool or its default value if not defined.
QList< QColor > highlightLabelColorAsColor() const
Returns HIGHLIGHT_LABELCOLOR as a list of color.
virtual bool isValid() const
Returns true if the parameter is valid, false otherwise.
double iconLabelSpaceAsDouble() const
Returns ICONLABELSPACE as a double or its default value if not defined.
QString scale() const
Returns SCALE parameter or an empty string if none is defined.
QString rule() const
Returns RULE parameter or an empty string if none is defined.
bool layerFontBoldAsBool() const
Returns LAYERFONTBOLD as a boolean or its default value if not defined.
bool isValid() const override
Returns true if the parameter is valid, false otherwise.
QString polygonTolerance() const
Returns FI_POLYGON_TOLERANCE parameter or an empty string if not defined.
@ HIGHLIGHT_LABELBUFFERSIZE
QStringList toStyleList(const char delimiter=',') const
Converts the parameter into a list of strings and keeps empty parts Default style value is an empty s...
bool withGeometry() const
Returns if the client wants the feature info response with geometry information.
int jAsInt() const
Returns J parameter as an int or its default value if not defined.
QUrlQuery urlQuery() const
Returns a url query with underlying parameters.
QStringList dxfLayerAttributes() const
Returns the DXF LAYERATTRIBUTES parameter.
QString itemFontFamily() const
Returns ITEMFONTFAMILY parameter or an empty string if not defined.
QgsDxfExport::SymbologyExport dxfMode() const
Returns the DXF MODE parameter.
QString y() const
Returns Y parameter or an empty string if not defined.
bool tiledAsBool() const
Returns TILED parameter as a boolean.
QString layerFontColor() const
Returns LAYERFONTCOLOR parameter or an empty string if not defined.
WMS parameter received from the client.
void setLayerFontColor(const QColor &fontColor)
Sets layer font color to fontColor Overrides fontColor()
QString externalWMSUri(const QString &id) const
Returns the external WMS uri.
@ HIGHLIGHT_LABEL_DISTANCE
QgsServerParameters provides an interface to retrieve and manipulate global parameters received from ...
QStringList highlightLabelHorizontalAlignment() const
Returns HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT as a list of string.
QList< QColor > toColorList(const char delimiter=',') const
Converts the parameter into a list of colors.
QString formatAsString() const
Returns FORMAT parameter as a string.
QgsLegendStyle & rstyle(QgsLegendStyle::Style s)
Returns modifiable reference to the style for a legend component.
int iAsInt() const
Returns I parameter as an int or its default value if not defined.
QString request() const override
Returns REQUEST parameter as a string or an empty string if not defined.
Format infoFormat() const
Returns infoFormat.
bool versionIsValid(const QString version) const
Returns true if version is valid, false otherwise.
QString typeName() const
Returns the type of the parameter as a string.
QList< QgsGeometry > highlightGeomAsGeom() const
Returns HIGHLIGHT_GEOM as a list of geometries.
QList< QgsGeometry > toGeomList(bool &ok, char delimiter=',') const
Converts the parameter into a list of geometries.
QStringList filters() const
Returns the list of filters found in FILTER parameter.
@ SymbolLayerSymbology
Exports one feature per symbol layer (considering symbol levels)
QList< int > toIntList(bool &ok, char delimiter=',') const
Converts the parameter into a list of integers.
bool dxfUseLayerTitleAsName() const
Returns the DXF USE_TITLE_AS_LAYERNAME parameter.
QString pointTolerance() const
Returns FI_POINT_TOLERANCE parameter or an empty string if not defined.
@ NoSymbology
Export only data.
QStringList highlightLabelString() const
Returns HIGHLIGHT_LABELSTRING as a list of string.
void dump() const
Dumps parameters.
@ FeatureSymbology
Keeps the number of features and export symbology per feature (using the first symbol level)
Exception thrown in case of malformed request.
int imageQualityAsInt() const
Returns IMAGE_QUALITY parameter as an integer.
QString dxfCodec() const
Returns the DXF CODEC parameter.
QStringList selections() const
Returns the list of feature selection found in SELECTION parameter.
QStringList highlightLabelSize() const
Returns HIGHLIGHT_LABELSIZE as a list of string.
bool isEmpty() const
Returns true if the rectangle is empty.
Name
Available parameters for WMS requests.
double layerSpaceAsDouble() const
Returns LAYERSPACE as a double or its default value if not defined.
double symbolHeightAsDouble() const
Returns SYMBOLHEIGHT as a double or its default value if not defined.
double boxSpaceAsDouble() const
Returns BOXSPACE as a double or its default value if not defined.
QList< QgsWmsParametersHighlightLayer > highlightLayersParameters() const
Returns parameters for each highlight layer.
@ HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT
DxfFormatOption
Options for DXF format.
QMap< QString, QString > dimensionValues() const
Returns the dimensions parameter.
QString width() const
Returns WIDTH parameter or an empty string if not defined.
QList< double > toDoubleList(bool &ok, char delimiter=',') const
Converts the parameter into a list of doubles.
A class to describe the version of a project.
int srcWidthAsInt() const
Returns SRCWIDTH parameter as an int or its default value if not defined.
QStringList allLayersNickname() const
Returns nickname of layers found in LAYER and LAYERS parameters.
QList< QgsWmsParametersFilter > mFilter
QList< QColor > highlightLabelBufferColorAsColor() const
Returns HIGHLIGHT_LABELBUFFERCOLOR as a list of colors.
QString ruleLabel() const
Returns RULELABEL parameter or an empty string if none is defined.
double dxfScale() const
Returns the DXF SCALE parameter.
QgsRectangle toRectangle(bool &ok) const
Converts the parameter into a rectangle.
QList< QColor > toColorList(bool &ok, char delimiter=',') const
Converts the parameter into a list of colors.
double symbolWidthAsDouble() const
Returns SYMBOLWIDTH as a double or its default value if not defined.
QColor layerFontColorAsColor() const
Returns LAYERFONTCOLOR as a color or its defined value if not defined.