Skip to content

Commit

Permalink
umgang mit problematischen Koordinaten
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximillian Dornseif committed Oct 5, 2013
1 parent 74c5341 commit 8936019
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion plz_draw
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ def draw_voronoi(ctx, geoitems, options):

plzlines = {}
for (l, p1, p2) in edges:
x1 = y1 = x2 = y2 = None
# l ist der Index der Original Daten in lines[]
# p1 und p2 sind der Index der Endpunkte in points[p2]
x1 = y1 = x2 = y2 = None # Endpunkte der zu zeichnenen Linie
a, b, c, plz1, plz2 = lines[l]
if p1 > -1:
x1, y1 = points[p1]
Expand Down
12 changes: 8 additions & 4 deletions pygeodb/voronoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def usage():
import math
import sys
import getopt
TOLERANCE = 1e-9
TOLERANCE = 1e-15
BIG_FLOAT = 1e38

#------------------------------------------------------------------
Expand Down Expand Up @@ -405,11 +405,15 @@ def bisect(s1, s2):
newedge.a = 1.0
newedge.b = dy/dx
newedge.c /= dx
else:
elif dy:
# set formula of line, with y fixed to 1
newedge.b = 1.0
newedge.a = dx/(dy+0.000001)
newedge.c /= (dy+0.000001)
newedge.a = dx/dy
newedge.c /= dy
else:
newedge.b = 1.0
newedge.a = dx/(dy+0.0000001)
newedge.c /= (dy+0.0000001)

newedge.edgenum = Edge.EDGE_NUM
Edge.EDGE_NUM += 1
Expand Down

0 comments on commit 8936019

Please sign in to comment.