Skip to content
Permalink
Browse files

Fix crash on geos closestPoint

  • Loading branch information
uclaros authored and nyalldawson committed Dec 25, 2020
1 parent 05e2a59 commit 0dc0ca589247b837a4b708b98e71f4370a31e689
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/geometry/qgsgeos.cpp
@@ -2251,11 +2251,11 @@ QgsGeometry QgsGeos::closestPoint( const QgsGeometry &other, QString *errorMsg )
geos::coord_sequence_unique_ptr nearestCoord;
if ( mGeosPrepared ) // use faster version with prepared geometry
{
nearestCoord.reset( GEOSNearestPoints_r( geosinit()->ctxt, mGeos.get(), otherGeom.get() ) );
nearestCoord.reset( GEOSPreparedNearestPoints_r( geosinit()->ctxt, mGeosPrepared.get(), otherGeom.get() ) );
}
else
{
nearestCoord.reset( GEOSPreparedNearestPoints_r( geosinit()->ctxt, mGeosPrepared.get(), otherGeom.get() ) );
nearestCoord.reset( GEOSNearestPoints_r( geosinit()->ctxt, mGeos.get(), otherGeom.get() ) );
}
#else
geos::coord_sequence_unique_ptr nearestCoord( GEOSNearestPoints_r( geosinit()->ctxt, mGeos.get(), otherGeom.get() ) );

0 comments on commit 0dc0ca5

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