Bug report #18219

Delaunay Triangulation and Voronoi Polygons do not work

Added by Basil Eric Rabi over 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Processing/QGIS
Affected QGIS version:3.0.0 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26110

Description

Delaunay Triangulation and Voronoi Polygon do not work.
This previously worked flawlessly in 2.18.16.
Built qgis rpm using rpm/buildrpms.sh.
Sample data attached.

tmpDF.dbf (13.6 KB) Basil Eric Rabi, 2018-02-26 11:43 AM

tmpDF.prj (418 Bytes) Basil Eric Rabi, 2018-02-26 11:43 AM

tmpDF.qpj (681 Bytes) Basil Eric Rabi, 2018-02-26 11:43 AM

tmpDF.shx (220 Bytes) Basil Eric Rabi, 2018-02-26 11:43 AM

tmpDF.shp (1.04 KB) Basil Eric Rabi, 2018-02-26 11:43 AM

DH.cpg (5 Bytes) Basil Eric Rabi, 2018-02-26 12:36 PM

DH.prj (418 Bytes) Basil Eric Rabi, 2018-02-26 12:36 PM

DH.qpj (681 Bytes) Basil Eric Rabi, 2018-02-26 12:36 PM

DH.shp (47.7 KB) Basil Eric Rabi, 2018-02-26 12:36 PM

DH.shx (13.7 KB) Basil Eric Rabi, 2018-02-26 12:36 PM

DH.dbf (1.51 MB) Basil Eric Rabi, 2018-02-26 12:37 PM

Associated revisions

Revision ca001741
Added by Håvard Tveite almost 6 years ago

[processing] Update the comparison implementation in voronoi.py (fixes #18219)

When "translating" the cmp function of Site and Halfedge to Python 3, the lt function was forgotten. It has been added.

Revision ce3cba1f
Added by Håvard Tveite almost 6 years ago

[processing] Update the comparison implementation in voronoi.py (fixes #18219)

When "translating" the cmp function of Site and Halfedge to Python 3, the lt function was forgotten. It has been added.

(cherry-picked from ca00174)

History

#1 Updated by Basil Eric Rabi over 6 years ago

Re-uploading a sample data that works in 2.18.16 (Something's wrong with tmpDF shapefile).
Regression is also present in Windows. Tested the stand-alone 3.0.0 installer.

#2 Updated by Giovanni Manghi over 6 years ago

  • Category changed from Python plugins to Processing/QGIS
  • Operating System deleted (fedora 27)
  • Priority changed from Normal to High
  • Subject changed from Geometry Tools Delaunay Triangulation and Voronoi Polygon do not work to Delaunay Triangulation and Voronoi Polygons do not work

Connfirmed.

#3 Updated by Håvard Tveite almost 6 years ago

The problem seems to be in python/plugins/processing/algs/qgis/voronoi.py.

#4 Updated by Håvard Tveite almost 6 years ago

I think I have found the error in voronoi.py.
When translating the cmp method of Site and Halfedge from Python 2 to Python 3, the gt function that is used by the > operator in the cmp method was not implemented. I fixed this in https://github.com/qgis/QGIS/pull/7554. With this change, the Voronoi diagram of the DH dataset seems to be correctly generated.

#5 Updated by Basil Eric Rabi almost 6 years ago

I just tested the patch, it works great! I hope it will be merged soon. Thank you!

#6 Updated by Håvard Tveite almost 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF