Skip to content
Permalink
Browse files

More robust GEOS pointOnSurface calculation (fix #13787)

(cherry-picked from 5c9873c)
  • Loading branch information
nyalldawson committed Nov 18, 2015
1 parent 3201700 commit 32cdd85fbb96a6493dabd1e63a2ad7dfe2f31e12
Showing with 11 additions and 11 deletions.
  1. +11 −11 src/core/geometry/qgsgeos.cpp
@@ -1333,20 +1333,20 @@ bool QgsGeos::pointOnSurface( QgsPointV2& pt, QString* errorMsg ) const
try
{
geos.reset( GEOSPointOnSurface_r( geosinit.ctxt, mGeos ) );
}
CATCH_GEOS_WITH_ERRMSG( false );

if ( !geos )
{
return false;
}
if ( !geos || GEOSisEmpty_r( geosinit.ctxt, geos.get() ) != 0 )
{
return false;
}

double x, y;
GEOSGeomGetX_r( geosinit.ctxt, geos.get(), &x );
GEOSGeomGetY_r( geosinit.ctxt, geos.get(), &y );
double x, y;
GEOSGeomGetX_r( geosinit.ctxt, geos.get(), &x );
GEOSGeomGetY_r( geosinit.ctxt, geos.get(), &y );

pt.setX( x );
pt.setY( y );
pt.setX( x );
pt.setY( y );
}
CATCH_GEOS_WITH_ERRMSG( false );

return true;
}

0 comments on commit 32cdd85

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