Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix crash on geos closestPoint
- Loading branch information
Showing
with
2 additions
and
2 deletions.
-
+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() ) ); |
|
|