Skip to content
Permalink
Browse files

Fix #4088: better handling of unknown geometry types

  • Loading branch information
wonder-sk committed Jul 19, 2011
1 parent 49726d2 commit 8e08c53a382d79999845a066a0abc849941076b1
Showing with 11 additions and 2 deletions.
  1. +1 −1 src/core/pal/internalexception.h
  2. +8 −0 src/core/pal/layer.cpp
  3. +2 −1 src/core/pal/util.cpp
@@ -81,7 +81,7 @@ namespace pal
{
const char* what() const throw()
{
return "Geometry Type is unknow";
return "Geometry Type is unknown";
}
};

@@ -262,6 +262,11 @@ namespace pal

// break the (possibly multi-part) geometry into simple geometries
LinkedList <const GEOSGeometry*> *simpleGeometries = unmulti( the_geom );
if ( simpleGeometries == NULL ) // unmulti() failed?
{
modMutex->unlock();
throw InternalException::UnknownGeometry();
}

while ( simpleGeometries->size() > 0 )
{
@@ -277,7 +282,10 @@ namespace pal
int type = GEOSGeomTypeId( geom );

if ( type != GEOS_POINT && type != GEOS_LINESTRING && type != GEOS_POLYGON )
{
modMutex->unlock();
throw InternalException::UnknownGeometry();
}

FeaturePart* fpart = new FeaturePart( f, geom );

@@ -231,7 +231,8 @@ namespace pal
final_queue->push_back( geom );
break;
default:
throw InternalException::UnknownGeometry();
delete final_queue;
final_queue = NULL;
}
}
delete queue;

0 comments on commit 8e08c53

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