109 QDomNodeList fidNodes = filterElem.elementsByTagName( QStringLiteral(
"FeatureId" ) );
110 QDomNodeList goidNodes = filterElem.elementsByTagName( QStringLiteral(
"GmlObjectId" ) );
111 if ( !fidNodes.isEmpty() )
114 QStringList collectedServerFids;
116 for (
int f = 0; f < fidNodes.size(); f++ )
118 fidElem = fidNodes.at( f ).toElement();
119 if ( !fidElem.hasAttribute( QStringLiteral(
"fid" ) ) )
124 QString serverFid = fidElem.attribute( QStringLiteral(
"fid" ) );
125 if ( serverFid.contains( QLatin1String(
"." ) ) )
127 if ( serverFid.section( QStringLiteral(
"." ), 0, 0 ) !=
typeName )
129 serverFid = serverFid.section( QStringLiteral(
"." ), 1, 1 );
131 collectedServerFids << serverFid;
134 if ( collectedServerFids.isEmpty() )
139 serverFids.append( collectedServerFids );
143 else if ( !goidNodes.isEmpty() )
146 QStringList collectedServerFids;
147 QDomElement goidElem;
148 for (
int f = 0; f < goidNodes.size(); f++ )
150 goidElem = goidNodes.at( f ).toElement();
151 if ( !goidElem.hasAttribute( QStringLiteral(
"id" ) ) && !goidElem.hasAttribute( QStringLiteral(
"gml:id" ) ) )
156 QString serverFid = goidElem.attribute( QStringLiteral(
"id" ) );
157 if ( serverFid.isEmpty() )
158 serverFid = goidElem.attribute( QStringLiteral(
"gml:id" ) );
159 if ( serverFid.contains( QLatin1String(
"." ) ) )
161 if ( serverFid.section( QStringLiteral(
"." ), 0, 0 ) !=
typeName )
163 serverFid = serverFid.section( QStringLiteral(
"." ), 1, 1 );
165 collectedServerFids << serverFid;
168 if ( collectedServerFids.isEmpty() )
173 serverFids.append( collectedServerFids );
177 else if ( filterElem.firstChildElement().tagName() == QLatin1String(
"BBOX" ) )
179 QDomElement bboxElem = filterElem.firstChildElement();
180 QDomElement childElem = bboxElem.firstChildElement();
182 while ( !childElem.isNull() )
184 if ( childElem.tagName() == QLatin1String(
"Box" ) )
188 else if ( childElem.tagName() != QLatin1String(
"PropertyName" ) )
194 childElem = childElem.nextSiblingElement();
201 else if ( filterElem.firstChildElement().tagName() == QLatin1String(
"And" ) && !filterElem.firstChildElement().firstChildElement( QLatin1String(
"BBOX" ) ).isNull() )
203 int nbChildElem = filterElem.firstChildElement().childNodes().size();
206 QDomElement childFilterElement = filterElem.ownerDocument().createElement( QLatin1String(
"Filter" ) );
207 if ( nbChildElem > 2 )
209 QDomElement childAndElement = filterElem.ownerDocument().createElement( QLatin1String(
"And" ) );
210 childFilterElement.appendChild( childAndElement );
214 QDomElement bboxFilterElement = filterElem.ownerDocument().createElement( QLatin1String(
"Filter" ) );
216 QDomElement childElem = filterElem.firstChildElement().firstChildElement();
217 while ( !childElem.isNull() )
220 if ( childElem.tagName() == QLatin1String(
"BBOX" ) )
223 bboxFilterElement.appendChild( childElem.cloneNode(
true ) );
228 if ( nbChildElem > 2 )
230 childFilterElement.firstChildElement().appendChild( childElem.cloneNode(
true ) );
234 childFilterElement.appendChild( childElem.cloneNode(
true ) );
237 childElem = childElem.nextSiblingElement();
241 QStringList collectedServerFids;
258 if ( !collectedServerFids.isEmpty() )
260 serverFids.append( collectedServerFids );
279 if ( filter->hasParserError() || !filter->parserErrorString().isEmpty() )
284 if ( filter->needsGeometry() )
The Context struct stores the current layer and coordinate transform context.