Skip to content
Permalink
Browse files

WFS EXP_FILTER respect complex expressions

  • Loading branch information
elpaso committed Jan 21, 2019
1 parent d4ac931 commit ad7ab51f038a9ab4fa5c3d698c2ddaf2e59cdc8b
Showing with 15 additions and 10 deletions.
  1. +14 −9 src/server/services/wfs/qgswfsparameters.cpp
  2. +1 −1 src/server/services/wfs/qgswfsparameters.h
@@ -76,18 +76,23 @@ namespace QgsWfs
if ( val.isEmpty() )
return theList;

QRegExp rx( exp );
if ( rx.indexIn( val, 0 ) == -1 )
{
if ( exp.isEmpty() )
theList << val;
}
else
{
int pos = 0;
while ( ( pos = rx.indexIn( val, pos ) ) != -1 )
QRegExp rx( exp );
if ( rx.indexIn( val, 0 ) == -1 )
{
theList << val;
}
else
{
theList << rx.cap( 1 );
pos += rx.matchedLength();
int pos = 0;
while ( ( pos = rx.indexIn( val, pos ) ) != -1 )
{
theList << rx.cap( 1 );
pos += rx.matchedLength();
}
}
}

@@ -332,7 +337,7 @@ namespace QgsWfs

QStringList QgsWfsParameters::expFilters() const
{
return mWfsParameters[ QgsWfsParameter::EXP_FILTER ].toStringListWithExp();
return mWfsParameters[ QgsWfsParameter::EXP_FILTER ].toStringListWithExp( QString( ) );
}

QString QgsWfsParameters::geometryNameAsString() const
@@ -83,7 +83,7 @@ namespace QgsWfs

/**
* Converts the parameter into a list of string.
* \param exp The expression to use for splitting
* \param exp The expression to use for splitting, pass an empty string to avoid splitting
* \returns A list of strings
* \throws QgsBadRequestException Invalid parameter exception
*/

0 comments on commit ad7ab51

Please sign in to comment.
You can’t perform that action at this time.