Skip to content
Permalink
Browse files

catch more GEOS exceptions, fixes #802

git-svn-id: http://svn.osgeo.org/qgis/trunk@7394 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 13, 2007
1 parent 5732fae commit e61a03ccd1a1d46e0f5e94393c4455a12c255483
Showing with 14 additions and 15 deletions.
  1. +14 −15 src/core/qgsgeometry.cpp
@@ -2828,31 +2828,30 @@ bool QgsGeometry::intersects(const QgsRect& r)

bool QgsGeometry::intersects(QgsGeometry* geometry)
{
// ensure that both geometries have geos geometry
exportWkbToGeos();
geometry->exportWkbToGeos();

if (!mGeos || !geometry->mGeos)
{
QgsDebugMsg("GEOS geometry not available!");
return false;
}

try // geos might throw exception on error
{
return mGeos->intersects(geometry->mGeos);
// ensure that both geometries have geos geometry
exportWkbToGeos();
geometry->exportWkbToGeos();

if (!mGeos || !geometry->mGeos)
{
QgsDebugMsg("GEOS geometry not available!");
return false;
}

return mGeos->intersects(geometry->mGeos);
}
catch (GEOS_UTIL::TopologyException* e)
catch (GEOS_UTIL::GEOSException &e)
{
#if GEOS_VERSION_MAJOR < 3
QString error = e->toString().c_str();
QString error = e.toString().c_str();
#else
QString error = e->what();
QString error = e.what();
#endif
QgsLogger::warning("GEOS: " + error);
return false;
}

}


0 comments on commit e61a03c

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