Skip to content

Commit

Permalink
Remove QgsGeometry::isGeosEmpty
Browse files Browse the repository at this point in the history
Use the faster native QgsGeometry::isEmpty instead
  • Loading branch information
nyalldawson committed Jan 30, 2017
1 parent 79bf17a commit afcb75a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
1 change: 1 addition & 0 deletions doc/api_break.dox
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,7 @@ empty geometry collection)
- static bool compare( const QgsMultiPolygon& p1, const QgsMultiPolygon& p2, double epsilon ) has been renamed to compareMultiPolygons
- smoothLine and smoothPolygon are no longer public API (use smooth() instead)
- avoidIntersections() got an extra argument: list of layers to include in the operation (previously read from active QgsProject)
- isGeosEmpty() was removed. Use isEmpty() instead.


QgsGeometryAnalyzer {#qgis_api_break_3_0_QgsGeometryAnalyzer}
Expand Down
5 changes: 0 additions & 5 deletions python/core/geometry/qgsgeometry.sip
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ class QgsGeometry
*/
bool isGeosValid() const;

/** Check if the geometry is empty using GEOS
@note added in 1.5
*/
bool isGeosEmpty() const;

/** Returns the area of the geometry using GEOS
@note added in 1.5
*/
Expand Down
11 changes: 0 additions & 11 deletions src/core/geometry/qgsgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1940,17 +1940,6 @@ bool QgsGeometry::isGeosEqual( const QgsGeometry& g ) const
return geos.isEqual( *( g.d->geometry ) );
}

bool QgsGeometry::isGeosEmpty() const
{
if ( !d->geometry )
{
return false;
}

QgsGeos geos( d->geometry );
return geos.isEmpty();
}

QgsGeometry QgsGeometry::unaryUnion( const QList<QgsGeometry>& geometryList )
{
QgsGeos geos( nullptr );
Expand Down
10 changes: 2 additions & 8 deletions src/core/geometry/qgsgeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ class CORE_EXPORT QgsGeometry

/**
* Returns true if the geometry is empty (eg a linestring with no vertices,
* or a collection with no geometries).
* or a collection with no geometries). A null geometry will always
* return true for isEmpty().
* @see isNull()
* @see isGeosEmpty()
*/
bool isEmpty() const;

Expand All @@ -196,12 +196,6 @@ class CORE_EXPORT QgsGeometry
*/
bool isGeosValid() const;

/** Check if the geometry is empty using GEOS
@note added in 1.5
@see isEmpty()
*/
bool isGeosEmpty() const;

/** Returns the area of the geometry using GEOS
@note added in 1.5
*/
Expand Down

0 comments on commit afcb75a

Please sign in to comment.