[fix] some weirdness with the dateline and polygons that have a longitude of exactly 180.0
This commit is contained in:
@@ -2,7 +2,7 @@ import bisect
|
||||
import random
|
||||
import sys
|
||||
|
||||
FLOAT_EPSILON = 1e-09
|
||||
from geodata.math.floats import isclose, FLOAT_EPSILON
|
||||
|
||||
|
||||
def weighted_choice(values, cdf):
|
||||
@@ -16,10 +16,6 @@ def weighted_choice(values, cdf):
|
||||
return values[i]
|
||||
|
||||
|
||||
def isclose(a, b, rel_tol=FLOAT_EPSILON, abs_tol=0.0):
|
||||
return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
|
||||
|
||||
|
||||
def check_probability_distribution(probs):
|
||||
cumulative = 0.0
|
||||
for p in probs:
|
||||
|
||||
Reference in New Issue
Block a user