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 8, 2021
1 parent e3be840 commit 8730268766f825882434b858c81d089bada23bba
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 8730268

Please sign in to comment.