Skip to content

Commit 8709e1f

Browse files
authoredJan 30, 2017
Merge pull request #4078 from nyalldawson/geom_api
API changes to QgsGeometry::isEmpty()/isNull()
2 parents c4165e4 + afcb75a commit 8709e1f

File tree

107 files changed

+368
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+368
-290
lines changed
 

‎doc/api_break.dox

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,10 @@ QgsGeometry {#qgis_api_break_3_0_QgsGeometry}
10441044

10451045
- All QgsGeometry methods now accept geometry references instead of pointers, and return a QgsGeometry
10461046
value instead of a pointer. The biggest impact with this change is that PyQGIS code should not compare a geometry
1047-
result to None, but instead either use a boolean test (`if g.buffer(10):`) or explicitly use the isEmpty()
1047+
result to None, but instead either use a boolean test (`if g.buffer(10):`) or explicitly use the isNull()
10481048
method to determine if a geometry is valid.
1049+
- isEmpty() was renamed to isNull() to differentiate a missing geometry from a geometry which is empty (eg an
1050+
empty geometry collection)
10491051
- wkbSize() and asWkb() has been replaced by exportToWkb(). WKB representation is no longer cached within QgsGeometry
10501052
- asGeos() has been replaced by exportToGeos(). GEOS representation is no longer cached within QgsGeometry
10511053
- int addPart( const QList<QgsPoint> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPoints
@@ -1055,6 +1057,7 @@ method to determine if a geometry is valid.
10551057
- static bool compare( const QgsMultiPolygon& p1, const QgsMultiPolygon& p2, double epsilon ) has been renamed to compareMultiPolygons
10561058
- smoothLine and smoothPolygon are no longer public API (use smooth() instead)
10571059
- avoidIntersections() got an extra argument: list of layers to include in the operation (previously read from active QgsProject)
1060+
- isGeosEmpty() was removed. Use isEmpty() instead.
10581061

10591062

10601063
QgsGeometryAnalyzer {#qgis_api_break_3_0_QgsGeometryAnalyzer}

‎python/core/geometry/qgsabstractgeometry.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class QgsAbstractGeometry
311311

312312
/** Returns true if the geometry is empty
313313
*/
314-
bool isEmpty() const;
314+
virtual bool isEmpty() const;
315315

316316
/** Returns true if the geometry contains curved segments
317317
*/

0 commit comments

Comments
 (0)
Please sign in to comment.