Added clustering distance in configuration

pull/18/head
Sami Mokaddem 2017-10-27 09:58:21 +02:00
parent f52890e382
commit 071a361c87
2 changed files with 6 additions and 2 deletions

View File

@ -15,6 +15,8 @@ size_world_pannel_perc = 35
#min
updateFrequency = 60
zoomlevel = 11
# ~meter
clusteringDistance = 10
[Log]
fieldname_order=["id", "category", "type", ["value", "comment"]]

View File

@ -153,8 +153,10 @@ def getHitMap():
return jsonify(data)
def isCloseTo(coord1, coord2):
if abs(float(coord1[0]) - float(coord2[0])) <= 0.0001:
if abs(float(coord1[1]) - float(coord2[1])) <= 0.0001:
clusterMeter = cfg.getfloat('GEO' ,'clusteringDistance')
clusterThres = math.pow(10, len(str(abs(clusterMeter)))-7) #map meter to coord threshold (~ big approx)
if abs(float(coord1[0]) - float(coord2[0])) <= clusterThres:
if abs(float(coord1[1]) - float(coord2[1])) <= clusterThres:
return True
return False