mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-16 00:06:09 -05:00
Merge pull request #60180 from mhugent/server_empty_values_highlight_labels
Server empty values in highlight labels parameters
This commit is contained in:
commit
3f5f9002bb
@ -70,42 +70,46 @@ Converts the parameter into a list of strings
|
|||||||
:return: A list of strings
|
:return: A list of strings
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QList<int> toIntList( bool &ok, char delimiter = ',' ) const;
|
QList<int> toIntList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Converts the parameter into a list of integers.
|
Converts the parameter into a list of integers.
|
||||||
|
|
||||||
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
||||||
:param delimiter: The character used for delimiting
|
:param delimiter: The character used for delimiting
|
||||||
|
:param skipEmptyParts: for splitting
|
||||||
|
|
||||||
:return: A list of integers
|
:return: A list of integers
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const;
|
QList<double> toDoubleList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Converts the parameter into a list of doubles.
|
Converts the parameter into a list of doubles.
|
||||||
|
|
||||||
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
||||||
:param delimiter: The character used for delimiting
|
:param delimiter: The character used for delimiting
|
||||||
|
:param skipEmptyParts: for splitting
|
||||||
|
|
||||||
:return: A list of doubles
|
:return: A list of doubles
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const;
|
QList<QColor> toColorList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Converts the parameter into a list of colors.
|
Converts the parameter into a list of colors.
|
||||||
|
|
||||||
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
||||||
:param delimiter: The character used for delimiting
|
:param delimiter: The character used for delimiting
|
||||||
|
:param skipEmptyParts: for splitting
|
||||||
|
|
||||||
:return: A list of colors
|
:return: A list of colors
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const;
|
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Converts the parameter into a list of geometries.
|
Converts the parameter into a list of geometries.
|
||||||
|
|
||||||
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
||||||
:param delimiter: The character used for delimiting
|
:param delimiter: The character used for delimiting
|
||||||
|
:param skipEmptyParts: for splitting
|
||||||
|
|
||||||
:return: A list of geometries
|
:return: A list of geometries
|
||||||
%End
|
%End
|
||||||
|
|||||||
@ -70,42 +70,46 @@ Converts the parameter into a list of strings
|
|||||||
:return: A list of strings
|
:return: A list of strings
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QList<int> toIntList( bool &ok, char delimiter = ',' ) const;
|
QList<int> toIntList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Converts the parameter into a list of integers.
|
Converts the parameter into a list of integers.
|
||||||
|
|
||||||
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
||||||
:param delimiter: The character used for delimiting
|
:param delimiter: The character used for delimiting
|
||||||
|
:param skipEmptyParts: for splitting
|
||||||
|
|
||||||
:return: A list of integers
|
:return: A list of integers
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const;
|
QList<double> toDoubleList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Converts the parameter into a list of doubles.
|
Converts the parameter into a list of doubles.
|
||||||
|
|
||||||
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
||||||
:param delimiter: The character used for delimiting
|
:param delimiter: The character used for delimiting
|
||||||
|
:param skipEmptyParts: for splitting
|
||||||
|
|
||||||
:return: A list of doubles
|
:return: A list of doubles
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const;
|
QList<QColor> toColorList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Converts the parameter into a list of colors.
|
Converts the parameter into a list of colors.
|
||||||
|
|
||||||
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
||||||
:param delimiter: The character used for delimiting
|
:param delimiter: The character used for delimiting
|
||||||
|
:param skipEmptyParts: for splitting
|
||||||
|
|
||||||
:return: A list of colors
|
:return: A list of colors
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const;
|
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Converts the parameter into a list of geometries.
|
Converts the parameter into a list of geometries.
|
||||||
|
|
||||||
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
:param ok: ``True`` if there's no error during the conversion, ``False`` otherwise
|
||||||
:param delimiter: The character used for delimiting
|
:param delimiter: The character used for delimiting
|
||||||
|
:param skipEmptyParts: for splitting
|
||||||
|
|
||||||
:return: A list of geometries
|
:return: A list of geometries
|
||||||
%End
|
%End
|
||||||
|
|||||||
@ -95,12 +95,12 @@ QStringList QgsServerParameterDefinition::toStringList( const char delimiter, co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QgsGeometry> QgsServerParameterDefinition::toGeomList( bool &ok, const char delimiter ) const
|
QList<QgsGeometry> QgsServerParameterDefinition::toGeomList( bool &ok, const char delimiter, const bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
ok = true;
|
ok = true;
|
||||||
QList<QgsGeometry> geoms;
|
QList<QgsGeometry> geoms;
|
||||||
|
|
||||||
const auto constStringList( toStringList( delimiter ) );
|
const auto constStringList( toStringList( delimiter, skipEmptyParts ) );
|
||||||
for ( const auto &wkt : constStringList )
|
for ( const auto &wkt : constStringList )
|
||||||
{
|
{
|
||||||
const QgsGeometry g( QgsGeometry::fromWkt( wkt ) );
|
const QgsGeometry g( QgsGeometry::fromWkt( wkt ) );
|
||||||
@ -202,12 +202,12 @@ QStringList QgsServerParameterDefinition::toExpressionList() const
|
|||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QColor> QgsServerParameterDefinition::toColorList( bool &ok, const char delimiter ) const
|
QList<QColor> QgsServerParameterDefinition::toColorList( bool &ok, const char delimiter, bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
ok = true;
|
ok = true;
|
||||||
QList<QColor> colors;
|
QList<QColor> colors;
|
||||||
|
|
||||||
const auto constStringList( toStringList( delimiter ) );
|
const auto constStringList( toStringList( delimiter, skipEmptyParts ) );
|
||||||
for ( const auto &part : constStringList )
|
for ( const auto &part : constStringList )
|
||||||
{
|
{
|
||||||
QString cStr( part );
|
QString cStr( part );
|
||||||
@ -234,12 +234,12 @@ QList<QColor> QgsServerParameterDefinition::toColorList( bool &ok, const char de
|
|||||||
return colors;
|
return colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> QgsServerParameterDefinition::toIntList( bool &ok, const char delimiter ) const
|
QList<int> QgsServerParameterDefinition::toIntList( bool &ok, const char delimiter, bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
ok = true;
|
ok = true;
|
||||||
QList<int> ints;
|
QList<int> ints;
|
||||||
|
|
||||||
const auto constStringList( toStringList( delimiter ) );
|
const auto constStringList( toStringList( delimiter, skipEmptyParts ) );
|
||||||
for ( const auto &part : constStringList )
|
for ( const auto &part : constStringList )
|
||||||
{
|
{
|
||||||
const int val = part.toInt( &ok );
|
const int val = part.toInt( &ok );
|
||||||
@ -255,12 +255,12 @@ QList<int> QgsServerParameterDefinition::toIntList( bool &ok, const char delimit
|
|||||||
return ints;
|
return ints;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<double> QgsServerParameterDefinition::toDoubleList( bool &ok, const char delimiter ) const
|
QList<double> QgsServerParameterDefinition::toDoubleList( bool &ok, const char delimiter, bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
ok = true;
|
ok = true;
|
||||||
QList<double> vals;
|
QList<double> vals;
|
||||||
|
|
||||||
const auto constStringList( toStringList( delimiter ) );
|
const auto constStringList( toStringList( delimiter, skipEmptyParts ) );
|
||||||
for ( const auto &part : constStringList )
|
for ( const auto &part : constStringList )
|
||||||
{
|
{
|
||||||
const double val = part.toDouble( &ok );
|
const double val = part.toDouble( &ok );
|
||||||
|
|||||||
@ -80,33 +80,37 @@ class SERVER_EXPORT QgsServerParameterDefinition
|
|||||||
* Converts the parameter into a list of integers.
|
* Converts the parameter into a list of integers.
|
||||||
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
|
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
|
||||||
* \param delimiter The character used for delimiting
|
* \param delimiter The character used for delimiting
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of integers
|
* \returns A list of integers
|
||||||
*/
|
*/
|
||||||
QList<int> toIntList( bool &ok, char delimiter = ',' ) const;
|
QList<int> toIntList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a list of doubles.
|
* Converts the parameter into a list of doubles.
|
||||||
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
|
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
|
||||||
* \param delimiter The character used for delimiting
|
* \param delimiter The character used for delimiting
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of doubles
|
* \returns A list of doubles
|
||||||
*/
|
*/
|
||||||
QList<double> toDoubleList( bool &ok, char delimiter = ',' ) const;
|
QList<double> toDoubleList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a list of colors.
|
* Converts the parameter into a list of colors.
|
||||||
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
|
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
|
||||||
* \param delimiter The character used for delimiting
|
* \param delimiter The character used for delimiting
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of colors
|
* \returns A list of colors
|
||||||
*/
|
*/
|
||||||
QList<QColor> toColorList( bool &ok, char delimiter = ',' ) const;
|
QList<QColor> toColorList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a list of geometries.
|
* Converts the parameter into a list of geometries.
|
||||||
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
|
* \param ok TRUE if there's no error during the conversion, FALSE otherwise
|
||||||
* \param delimiter The character used for delimiting
|
* \param delimiter The character used for delimiting
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of geometries
|
* \returns A list of geometries
|
||||||
*/
|
*/
|
||||||
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',' ) const;
|
QList<QgsGeometry> toGeomList( bool &ok, char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a list of OGC filters.
|
* Converts the parameter into a list of OGC filters.
|
||||||
|
|||||||
@ -49,15 +49,15 @@ namespace QgsWms
|
|||||||
QgsServerParameterDefinition::raiseError( msg );
|
QgsServerParameterDefinition::raiseError( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QgsWmsParameter::toStyleList( const char delimiter ) const
|
QStringList QgsWmsParameter::toStyleList( const char delimiter, bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
return QgsServerParameterDefinition::toStringList( delimiter, false );
|
return QgsServerParameterDefinition::toStringList( delimiter, skipEmptyParts );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QgsGeometry> QgsWmsParameter::toGeomList( const char delimiter ) const
|
QList<QgsGeometry> QgsWmsParameter::toGeomList( const char delimiter, bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
const QList<QgsGeometry> geoms = QgsServerParameterDefinition::toGeomList( ok, delimiter );
|
const QList<QgsGeometry> geoms = QgsServerParameterDefinition::toGeomList( ok, delimiter, skipEmptyParts );
|
||||||
|
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
{
|
{
|
||||||
@ -138,10 +138,10 @@ namespace QgsWms
|
|||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QColor> QgsWmsParameter::toColorList( const char delimiter ) const
|
QList<QColor> QgsWmsParameter::toColorList( const char delimiter, bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const QList<QColor> vals = QgsServerParameterDefinition::toColorList( ok, delimiter );
|
const QList<QColor> vals = QgsServerParameterDefinition::toColorList( ok, delimiter, skipEmptyParts );
|
||||||
|
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
{
|
{
|
||||||
@ -152,10 +152,10 @@ namespace QgsWms
|
|||||||
return vals;
|
return vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> QgsWmsParameter::toIntList( const char delimiter ) const
|
QList<int> QgsWmsParameter::toIntList( const char delimiter, bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const QList<int> vals = QgsServerParameterDefinition::toIntList( ok, delimiter );
|
const QList<int> vals = QgsServerParameterDefinition::toIntList( ok, delimiter, skipEmptyParts );
|
||||||
|
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
{
|
{
|
||||||
@ -166,10 +166,10 @@ namespace QgsWms
|
|||||||
return vals;
|
return vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<double> QgsWmsParameter::toDoubleList( const char delimiter ) const
|
QList<double> QgsWmsParameter::toDoubleList( const char delimiter, bool skipEmptyParts ) const
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const QList<double> vals = QgsServerParameterDefinition::toDoubleList( ok, delimiter );
|
const QList<double> vals = QgsServerParameterDefinition::toDoubleList( ok, delimiter, skipEmptyParts );
|
||||||
|
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
{
|
{
|
||||||
@ -1271,77 +1271,77 @@ namespace QgsWms
|
|||||||
|
|
||||||
QStringList QgsWmsParameters::highlightLabelSize() const
|
QStringList QgsWmsParameters::highlightLabelSize() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELSIZE ).toStringList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELSIZE ).toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> QgsWmsParameters::highlightLabelSizeAsInt() const
|
QList<int> QgsWmsParameters::highlightLabelSizeAsInt() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELSIZE ).toIntList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELSIZE ).toIntList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QgsWmsParameters::highlightLabelColor() const
|
QStringList QgsWmsParameters::highlightLabelColor() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELCOLOR ).toStringList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELCOLOR ).toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QColor> QgsWmsParameters::highlightLabelColorAsColor() const
|
QList<QColor> QgsWmsParameters::highlightLabelColorAsColor() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELCOLOR ).toColorList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELCOLOR ).toColorList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QgsWmsParameters::highlightLabelWeight() const
|
QStringList QgsWmsParameters::highlightLabelWeight() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELWEIGHT ).toStringList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELWEIGHT ).toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> QgsWmsParameters::highlightLabelWeightAsInt() const
|
QList<int> QgsWmsParameters::highlightLabelWeightAsInt() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELWEIGHT ).toIntList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELWEIGHT ).toIntList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QgsWmsParameters::highlightLabelFont() const
|
QStringList QgsWmsParameters::highlightLabelFont() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELFONT ).toStringList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELFONT ).toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QgsWmsParameters::highlightLabelBufferColor() const
|
QStringList QgsWmsParameters::highlightLabelBufferColor() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR ).toStringList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR ).toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QColor> QgsWmsParameters::highlightLabelBufferColorAsColor() const
|
QList<QColor> QgsWmsParameters::highlightLabelBufferColorAsColor() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR ).toColorList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR ).toColorList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QgsWmsParameters::highlightLabelBufferSize() const
|
QStringList QgsWmsParameters::highlightLabelBufferSize() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE ).toStringList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE ).toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<double> QgsWmsParameters::highlightLabelBufferSizeAsFloat() const
|
QList<double> QgsWmsParameters::highlightLabelBufferSizeAsFloat() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE ).toDoubleList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE ).toDoubleList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<double> QgsWmsParameters::highlightLabelRotation() const
|
QList<double> QgsWmsParameters::highlightLabelRotation() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABEL_ROTATION ).toDoubleList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABEL_ROTATION ).toDoubleList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<double> QgsWmsParameters::highlightLabelDistance() const
|
QList<double> QgsWmsParameters::highlightLabelDistance() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABEL_DISTANCE ).toDoubleList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABEL_DISTANCE ).toDoubleList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QgsWmsParameters::highlightLabelHorizontalAlignment() const
|
QStringList QgsWmsParameters::highlightLabelHorizontalAlignment() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT ).toStringList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT ).toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QgsWmsParameters::highlightLabelVerticalAlignment() const
|
QStringList QgsWmsParameters::highlightLabelVerticalAlignment() const
|
||||||
{
|
{
|
||||||
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT ).toStringList( ';' );
|
return mWmsParameters.value( QgsWmsParameter::HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT ).toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QgsWmsParameters::wmsPrecision() const
|
QString QgsWmsParameters::wmsPrecision() const
|
||||||
@ -1806,91 +1806,91 @@ namespace QgsWms
|
|||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_GEOM, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_GEOM, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
geoms = wmsParam.toGeomList( ';' );
|
geoms = wmsParam.toGeomList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList slds;
|
QStringList slds;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_SYMBOL, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_SYMBOL, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
slds = wmsParam.toStringList( ';' );
|
slds = wmsParam.toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList labels;
|
QStringList labels;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELSTRING, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELSTRING, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
labels = wmsParam.toStringList( ';' );
|
labels = wmsParam.toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList fonts;
|
QStringList fonts;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELFONT, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELFONT, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
fonts = wmsParam.toStringList( ';' );
|
fonts = wmsParam.toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QColor> colors;
|
QList<QColor> colors;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELCOLOR, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELCOLOR, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
colors = wmsParam.toColorList( ';' );
|
colors = wmsParam.toColorList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> sizes;
|
QList<int> sizes;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELSIZE, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELSIZE, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
sizes = wmsParam.toIntList( ';' );
|
sizes = wmsParam.toIntList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> weights;
|
QList<int> weights;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELWEIGHT, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELWEIGHT, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
weights = wmsParam.toIntList( ';' );
|
weights = wmsParam.toIntList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QColor> bufferColors;
|
QList<QColor> bufferColors;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELBUFFERCOLOR, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
bufferColors = wmsParam.toColorList( ';' );
|
bufferColors = wmsParam.toColorList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<double> bufferSizes;
|
QList<double> bufferSizes;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABELBUFFERSIZE, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
bufferSizes = wmsParam.toDoubleList( ';' );
|
bufferSizes = wmsParam.toDoubleList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<double> rotations;
|
QList<double> rotations;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABEL_ROTATION, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABEL_ROTATION, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
rotations = wmsParam.toDoubleList( ';' );
|
rotations = wmsParam.toDoubleList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<double> distances;
|
QList<double> distances;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABEL_DISTANCE, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABEL_DISTANCE, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
distances = wmsParam.toDoubleList( ';' );
|
distances = wmsParam.toDoubleList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList halis;
|
QStringList halis;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABEL_HORIZONTAL_ALIGNMENT, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
halis = wmsParam.toStringList();
|
halis = wmsParam.toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList valis;
|
QStringList valis;
|
||||||
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT, mapId );
|
wmsParam = idParameter( QgsWmsParameter::HIGHLIGHT_LABEL_VERTICAL_ALIGNMENT, mapId );
|
||||||
if ( wmsParam.isValid() )
|
if ( wmsParam.isValid() )
|
||||||
{
|
{
|
||||||
valis = wmsParam.toStringList();
|
valis = wmsParam.toStringList( ';', false );
|
||||||
}
|
}
|
||||||
|
|
||||||
int nHLayers = std::min( geoms.size(), slds.size() );
|
int nHLayers = std::min( geoms.size(), slds.size() );
|
||||||
|
|||||||
@ -214,42 +214,47 @@ namespace QgsWms
|
|||||||
* Converts the parameter into a list of strings and keeps empty parts
|
* Converts the parameter into a list of strings and keeps empty parts
|
||||||
* Default style value is an empty string
|
* Default style value is an empty string
|
||||||
* \param delimiter The character used for delimiting
|
* \param delimiter The character used for delimiting
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of strings
|
* \returns A list of strings
|
||||||
* \since QGIS 3.8
|
* \since QGIS 3.8
|
||||||
*/
|
*/
|
||||||
QStringList toStyleList( const char delimiter = ',' ) const;
|
QStringList toStyleList( const char delimiter = ',', bool skipEmptyParts = false ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a list of geometries.
|
* Converts the parameter into a list of geometries.
|
||||||
* \param delimiter The character delimiting string geometries
|
* \param delimiter The character delimiting string geometries
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of geometries
|
* \returns A list of geometries
|
||||||
* \throws QgsBadRequestException Invalid parameter exception
|
* \throws QgsBadRequestException Invalid parameter exception
|
||||||
*/
|
*/
|
||||||
QList<QgsGeometry> toGeomList( const char delimiter = ',' ) const;
|
QList<QgsGeometry> toGeomList( const char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a list of integers.
|
* Converts the parameter into a list of integers.
|
||||||
* \param delimiter The character delimiting string integers
|
* \param delimiter The character delimiting string integers
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of integers
|
* \returns A list of integers
|
||||||
* \throws QgsBadRequestException Invalid parameter exception
|
* \throws QgsBadRequestException Invalid parameter exception
|
||||||
*/
|
*/
|
||||||
QList<int> toIntList( const char delimiter = ',' ) const;
|
QList<int> toIntList( const char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a list of doubles.
|
* Converts the parameter into a list of doubles.
|
||||||
* \param delimiter The character delimiting string doubles
|
* \param delimiter The character delimiting string doubles
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of doubles
|
* \returns A list of doubles
|
||||||
* \throws QgsBadRequestException Invalid parameter exception
|
* \throws QgsBadRequestException Invalid parameter exception
|
||||||
*/
|
*/
|
||||||
QList<double> toDoubleList( const char delimiter = ',' ) const;
|
QList<double> toDoubleList( const char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a list of colors.
|
* Converts the parameter into a list of colors.
|
||||||
* \param delimiter The character delimiting string colors
|
* \param delimiter The character delimiting string colors
|
||||||
|
* \param skipEmptyParts for splitting
|
||||||
* \returns A list of colors
|
* \returns A list of colors
|
||||||
* \throws QgsBadRequestException Invalid parameter exception
|
* \throws QgsBadRequestException Invalid parameter exception
|
||||||
*/
|
*/
|
||||||
QList<QColor> toColorList( const char delimiter = ',' ) const;
|
QList<QColor> toColorList( const char delimiter = ',', bool skipEmptyParts = true ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the parameter into a rectangle.
|
* Converts the parameter into a rectangle.
|
||||||
|
|||||||
@ -526,6 +526,36 @@ class TestQgsServerWMSGetPrint(QgsServerTestBase):
|
|||||||
r, h = self._result(self._execute_request(qs))
|
r, h = self._result(self._execute_request(qs))
|
||||||
self._img_diff_error(r, h, "WMS_GetPrint_External")
|
self._img_diff_error(r, h, "WMS_GetPrint_External")
|
||||||
|
|
||||||
|
def test_wms_getprint_highlight_empty_labels(self):
|
||||||
|
qs = "?" + "&".join(
|
||||||
|
[
|
||||||
|
"%s=%s" % i
|
||||||
|
for i in list(
|
||||||
|
{
|
||||||
|
"MAP": urllib.parse.quote(self.projectPath),
|
||||||
|
"SERVICE": "WMS",
|
||||||
|
"VERSION": "1.1.1",
|
||||||
|
"REQUEST": "GetPrint",
|
||||||
|
"TEMPLATE": "layoutA4",
|
||||||
|
"FORMAT": "png",
|
||||||
|
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
|
||||||
|
"map0:LAYERS": "Country,Hello",
|
||||||
|
"CRS": "EPSG:3857",
|
||||||
|
"map0:HIGHLIGHT_GEOM": "POINT(-4000000 12215266);POINT(3271207 6832268);POINT(2360238 1035192)",
|
||||||
|
"map0:HIGHLIGHT_LABELSTRING": "Arctic;;Africa",
|
||||||
|
"map0:HIGHLIGHT_SYMBOL": '<?xml version="1.0" encoding="UTF-8"?><StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se"><UserStyle><se:FeatureTypeStyle><se:Rule><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Stroke><se:SvgParameter name="stroke">%23ff0000</se:SvgParameter><se:SvgParameter name="stroke-opacity">1</se:SvgParameter><se:SvgParameter name="stroke-width">7.5</se:SvgParameter></se:Stroke><se:Fill><se:SvgParameter name="fill">%237bdcb5</se:SvgParameter><se:SvgParameter name="fill-opacity">1</se:SvgParameter></se:Fill></se:Mark><se:Size>28.4</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></StyledLayerDescriptor>;<?xml version="1.0" encoding="UTF-8"?><StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se"><UserStyle><se:FeatureTypeStyle><se:Rule><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Stroke><se:SvgParameter name="stroke">%23ff0000</se:SvgParameter><se:SvgParameter name="stroke-opacity">1</se:SvgParameter><se:SvgParameter name="stroke-width">7.5</se:SvgParameter></se:Stroke><se:Fill><se:SvgParameter name="fill">%237bdcb5</se:SvgParameter><se:SvgParameter name="fill-opacity">1</se:SvgParameter></se:Fill></se:Mark><se:Size>28.4</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></StyledLayerDescriptor>;<?xml version="1.0" encoding="UTF-8"?><StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se"><UserStyle><se:FeatureTypeStyle><se:Rule><se:PointSymbolizer><se:Graphic><se:Mark><se:WellKnownName>circle</se:WellKnownName><se:Stroke><se:SvgParameter name="stroke">%23ff0000</se:SvgParameter><se:SvgParameter name="stroke-opacity">1</se:SvgParameter><se:SvgParameter name="stroke-width">7.5</se:SvgParameter></se:Stroke><se:Fill><se:SvgParameter name="fill">%237bdcb5</se:SvgParameter><se:SvgParameter name="fill-opacity">1</se:SvgParameter></se:Fill></se:Mark><se:Size>28.4</se:Size></se:Graphic></se:PointSymbolizer></se:Rule></se:FeatureTypeStyle></UserStyle></StyledLayerDescriptor>',
|
||||||
|
"map0:HIGHLIGHT_LABELSIZE": "16;16;16",
|
||||||
|
"map0:HIGHLIGHT_LABELCOLOR": "red;red;red",
|
||||||
|
"map0:HIGHLIGHT_LABELBUFFERCOLOR": "white;white;white",
|
||||||
|
"map0:HIGHLIGHT_LABELBUFFERSIZE": "1;1;1",
|
||||||
|
}.items()
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
r, h = self._result(self._execute_request(qs))
|
||||||
|
self._img_diff_error(r, h, "WMS_GetPrint_Highlight_Empty_Labels")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 310 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 130 KiB |
Loading…
x
Reference in New Issue
Block a user