Skip to content
Permalink
Browse files

Return nullptr instead of empty point -- better maintains API compati…

…bility with earlier QGIS 3.x releases

Empty points were only introduced recently, and it's possible existing
plugin code may check if the return value is None (not an empty point)
  • Loading branch information
nyalldawson committed Feb 5, 2021
1 parent 3221e9c commit 6112a39a81ebb1eb8174de62a78adef0b93b86ad
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/geometry/qgsgeos.cpp
@@ -1112,7 +1112,8 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos
case GEOS_POINT: // a point
{
if ( GEOSisEmpty_r( geosinit()->ctxt, geos ) )
return qgis::make_unique< QgsPoint >();
return nullptr;

const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq_r( geosinit()->ctxt, geos );
unsigned int nPoints = 0;
GEOSCoordSeq_getSize_r( geosinit()->ctxt, cs, &nPoints );

0 comments on commit 6112a39

Please sign in to comment.