mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Replace custom Almost with stdlib math.isclose
This commit is contained in:
@@ -11,17 +11,6 @@ import json
|
||||
import math
|
||||
import re
|
||||
|
||||
class Almost:
|
||||
""" Compares a float value with a certain jitter.
|
||||
"""
|
||||
def __init__(self, value, offset=0.00001):
|
||||
self.value = value
|
||||
self.offset = offset
|
||||
|
||||
def __eq__(self, other):
|
||||
return abs(other - self.value) < self.offset
|
||||
|
||||
|
||||
OSM_TYPE = {'N' : 'node', 'W' : 'way', 'R' : 'relation',
|
||||
'n' : 'node', 'w' : 'way', 'r' : 'relation',
|
||||
'node' : 'n', 'way' : 'w', 'relation' : 'r'}
|
||||
|
||||
Reference in New Issue
Block a user