Skip to content

Zero Division Error calling computeDelaunayTriangulation function #1

@csotomon

Description

@csotomon

Running the computeDelaunayTriangulation function with a 7.2 millions of point i am getting this error:

checking the code if "think" that the error is in the line 458 because s1.y and s2.y have the same value.

---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<ipython-input-182-05f495d7c18c> in <module>
      1 # Delaunay Triangulation
----> 2 triangles = voronoi.computeDelaunayTriangulation(points)

/data/anaconda/envs/geo_env/lib/python3.8/site-packages/voronoi.py in computeDelaunayTriangulation(points)
    841     context  = Context()
    842     context.triangulate = True
--> 843     voronoi( siteList, context )
    844     return context.triangles
    845 

/data/anaconda/envs/geo_env/lib/python3.8/site-packages/voronoi.py in voronoi(siteList, context)
    257             # create a new edge that bisects
    258             bot  = lbnd.rightreg(bottomsite)
--> 259             edge = Edge.bisect(bot,newsite)
    260             context.outBisector(edge)
    261 

/data/anaconda/envs/geo_env/lib/python3.8/site-packages/voronoi.py in bisect(s1, s2)
    470             # set formula of line, with y fixed to 1
    471             newedge.b = 1.0
--> 472             newedge.a = dx/dy
    473             newedge.c /= dy
    474 

ZeroDivisionError: float division by zero

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions