Bug report #19190

QgsPoint class does not store empty point geometries

Added by Philip Whitten over 6 years ago. Updated over 5 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Geometry
Affected QGIS version:3.5(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27019

Description

The QgsPoint class does not properly store empty point geometries. For example, from the python console in QGIS 3.0.3:

> QgsPoint().isEmpty()
False

> print(QgsPoint().asWkt())
Point (0 0)

> print(QgsPoint().createEmptyWithSameType().asWkt())
Point (nan nan)

In comparison, for a LineString:

> QgsLineString().isEmpty()
True

> print(QgsLineString().asWkt())
LineString ()

The results observed for LineString are consistent with those for QgsPolygon and QgsGeometryCollection.

History

#1 Updated by Alexander Bruy almost 6 years ago

  • Operating System deleted (Windows)
  • Category changed from Processing/QGIS to Geometry

#2 Updated by Loïc BARTOLETTI over 5 years ago

  • Affected QGIS version changed from 3.0.3 to 3.5(master)
  • Assignee deleted (Philip Whitten)

related issue #20753

Also available in: Atom PDF