Skip to content
Permalink
Browse files

Return null point instead of null geometry for

QgsGeometry.fromWkt('Polygon ((0 0, 1 1, 1 0, 0 0))').intersection(QgsGeometry.fromWkt('Point (42 0)'))

Refs #35776

(cherry picked from commit b6dcd5d)
  • Loading branch information
nyalldawson committed Apr 20, 2020
1 parent 4e67318 commit 77cdfa876231173a2a17748b5cfdd3cd86a27aad
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/geometry/qgsgeos.cpp
@@ -1097,7 +1097,7 @@ std::unique_ptr<QgsAbstractGeometry> QgsGeos::fromGeos( const GEOSGeometry *geos
const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq_r( geosinit()->ctxt, geos );
unsigned int nPoints = 0;
GEOSCoordSeq_getSize_r( geosinit()->ctxt, cs, &nPoints );
return nPoints > 0 ? std::unique_ptr<QgsAbstractGeometry>( coordSeqPoint( cs, 0, hasZ, hasM ).clone() ) : nullptr;
return nPoints > 0 ? std::unique_ptr<QgsAbstractGeometry>( coordSeqPoint( cs, 0, hasZ, hasM ).clone() ) : qgis::make_unique< QgsPoint >();
}
case GEOS_LINESTRING:
{

0 comments on commit 77cdfa8

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