Skip to content

Commit

Permalink
Debbuging NoGeometry support in QGIS WFS Server
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed May 21, 2013
1 parent 7e7e6ab commit 4bea357
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsogcutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,15 +1032,15 @@ QDomElement QgsOgcUtils::rectangleToGMLEnvelope( QgsRectangle* env, QDomDocument
QDomElement lowerCornerElem = doc.createElement( "gml:lowerCorner" );
posList = QString::number( env->xMinimum(), 'f', 8 ).remove( QRegExp( "[0]{1,7}$" ) );
posList += " ";
posList = QString::number( env->yMinimum(), 'f', 8 ).remove( QRegExp( "[0]{1,7}$" ) );
posList += QString::number( env->yMinimum(), 'f', 8 ).remove( QRegExp( "[0]{1,7}$" ) );
QDomText lowerCornerText = doc.createTextNode( posList );
lowerCornerElem.appendChild( lowerCornerText );
envElem.appendChild( lowerCornerElem );

QDomElement upperCornerElem = doc.createElement( "gml:upperCorner" );
posList = QString::number( env->xMaximum(), 'f', 8 ).remove( QRegExp( "[0]{1,7}$" ) );
posList += " ";
posList = QString::number( env->yMaximum(), 'f', 8 ).remove( QRegExp( "[0]{1,7}$" ) );
posList += QString::number( env->yMaximum(), 'f', 8 ).remove( QRegExp( "[0]{1,7}$" ) );
QDomText upperCornerText = doc.createTextNode( posList );
upperCornerElem.appendChild( upperCornerText );
envElem.appendChild( upperCornerElem );
Expand Down
16 changes: 16 additions & 0 deletions src/mapserver/qgswfsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
req.setFilterRect( searchRect )
.setFlags( QgsFeatureRequest::ExactIntersect | ( mWithGeom ? QgsFeatureRequest::NoFlags : QgsFeatureRequest::NoGeometry ) );
}
else
{
req.setFlags( QgsFeatureRequest::NoGeometry );
mWithGeom = false;
}
QgsFeatureIterator fit = layer->getFeatures( req );
QgsExpression *mFilter = new QgsExpression( expFilter );
if ( mFilter->hasParserError() )
Expand Down Expand Up @@ -936,6 +941,11 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
req.setFilterRect( searchRect )
.setFlags( QgsFeatureRequest::ExactIntersect | ( mWithGeom ? QgsFeatureRequest::NoFlags : QgsFeatureRequest::NoGeometry ) );
}
else
{
req.setFlags( QgsFeatureRequest::NoGeometry );
mWithGeom = false;
}
QgsFeatureIterator fit = layer->getFeatures( req );
while ( fit.nextFeature( feature ) && featureCounter < maxFeat )
{
Expand Down Expand Up @@ -967,9 +977,15 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
req.setFilterRect( searchRect )
.setFlags( QgsFeatureRequest::ExactIntersect | ( mWithGeom ? QgsFeatureRequest::NoFlags : QgsFeatureRequest::NoGeometry ) );
}
else
{
req.setFlags( QgsFeatureRequest::NoGeometry );
mWithGeom = false;
}
QgsFeatureIterator fit = layer->getFeatures( req );
while ( fit.nextFeature( feature ) && featureCounter < maxFeat )
{
mErrors << QString( "The feature %2 of layer for the TypeName '%1'" ).arg( tnStr ).arg( featureCounter );
if ( featureCounter == 0 )
startGetFeature( request, format, layerCrs, &searchRect );

Expand Down

0 comments on commit 4bea357

Please sign in to comment.