Skip to content
Permalink
Browse files

Improve geometry type detection for wfs

git-svn-id: http://svn.osgeo.org/qgis/trunk@14539 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Nov 9, 2010
1 parent 5b467f8 commit 9b7c6aa2b2b2c374ed7c97a7ff912f339662ae10
Showing with 17 additions and 3 deletions.
  1. +17 −3 src/providers/wfs/qgswfsdata.cpp
@@ -351,7 +351,11 @@ void QgsWFSData::endElement( const XML_Char* el )
{
//error
}
*mWkbType = QGis::WKBPoint;

if ( *mWkbType != QGis::WKBMultiPoint ) //keep multitype in case of geometry type mix
{
*mWkbType = QGis::WKBPoint;
}
}
else //multipoint, add WKB as fragment
{
@@ -386,7 +390,11 @@ void QgsWFSData::endElement( const XML_Char* el )
{
//error
}
*mWkbType = QGis::WKBLineString;

if ( *mWkbType != QGis::WKBMultiLineString )//keep multitype in case of geometry type mix
{
*mWkbType = QGis::WKBLineString;
}
}
else //multiline, add WKB as fragment
{
@@ -424,14 +432,18 @@ void QgsWFSData::endElement( const XML_Char* el )
}
else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "Polygon" )
{
*mWkbType = QGis::WKBPolygon;
if ( *mWkbType != QGis::WKBMultiPolygon )//keep multitype in case of geometry type mix
{
*mWkbType = QGis::WKBPolygon;
}
if ( mParseModeStack.top() != QgsWFSData::multiPolygon )
{
createPolygonFromFragments();
}
}
else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "MultiPoint" )
{
*mWkbType = QGis::WKBMultiPoint;
if ( !mParseModeStack.empty() )
{
mParseModeStack.pop();
@@ -440,6 +452,7 @@ void QgsWFSData::endElement( const XML_Char* el )
}
else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "MultiLineString" )
{
*mWkbType = QGis::WKBMultiLineString;
if ( !mParseModeStack.empty() )
{
mParseModeStack.pop();
@@ -448,6 +461,7 @@ void QgsWFSData::endElement( const XML_Char* el )
}
else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "MultiPolygon" )
{
*mWkbType = QGis::WKBMultiPolygon;
if ( !mParseModeStack.empty() )
{
mParseModeStack.pop();

0 comments on commit 9b7c6aa

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