Skip to content
Permalink
Browse files

More robust GEOS pointOnSurface calculation (fix #13787)

  • Loading branch information
nyalldawson committed Nov 10, 2015
1 parent 18744b4 commit 5c9873c7949e183b2834c6a6f82b0477441038b6
Showing with 11 additions and 11 deletions.
  1. +11 −11 src/core/geometry/qgsgeos.cpp
@@ -1371,20 +1371,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 5c9873c

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