Skip to content

Commit 487c424

Browse files
committed
GML parser boundedBy fix
1 parent 9a0dffe commit 487c424

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/core/qgsgml.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ void QgsGml::startElement( const XML_Char* el, const XML_Char** attr )
189189
{
190190
mParseModeStack.push( QgsGml::geometry );
191191
}
192-
else if ( mParseModeStack.size() == 0 && elementName == GML_NAMESPACE + NS_SEPARATOR + "boundedBy" )
192+
//else if ( mParseModeStack.size() == 0 && elementName == GML_NAMESPACE + NS_SEPARATOR + "boundedBy" )
193+
else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "boundedBy" )
193194
{
194195
mParseModeStack.push( QgsGml::boundingBox );
195196
}
@@ -240,7 +241,7 @@ void QgsGml::startElement( const XML_Char* el, const XML_Char** attr )
240241
{
241242
mParseModeStack.push( QgsGml::multiPolygon );
242243
}
243-
else if ( mParseModeStack.size() == 1 && mParseModeStack.top() == QgsGml::feature && mThematicAttributes.find( localName ) != mThematicAttributes.end() )
244+
else if (( mParseModeStack.size() > 0 ) && ( mParseModeStack.top() == QgsGml::feature ) && ( mThematicAttributes.find( localName ) != mThematicAttributes.end() ) )
244245
{
245246
mParseModeStack.push( QgsGml::attribute );
246247
mAttributeName = localName;
@@ -298,7 +299,7 @@ void QgsGml::endElement( const XML_Char* el )
298299
mParseModeStack.pop();
299300
}
300301
}
301-
else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "boundedBy" )
302+
else if ( !mParseModeStack.empty() && mParseModeStack.top() == QgsGml::boundingBox && elementName == GML_NAMESPACE + NS_SEPARATOR + "boundedBy" )
302303
{
303304
//create bounding box from mStringCash
304305
if ( createBBoxFromCoordinateString( mCurrentExtent, mStringCash ) != 0 )

0 commit comments

Comments
 (0)