Skip to content
Permalink
Browse files

Debbuging NoGeometry support in QGIS WFS Server

  • Loading branch information
rldhont committed May 21, 2013
1 parent 7e7e6ab commit 4bea3570b5c3e8be468520c48d1ff181e56e6956
Showing with 18 additions and 2 deletions.
  1. +2 −2 src/core/qgsogcutils.cpp
  2. +16 −0 src/mapserver/qgswfsserver.cpp
@@ -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 );
@@ -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() )
@@ -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 )
{
@@ -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 );

0 comments on commit 4bea357

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