mirror of https://github.com/MISP/misp-dashboard
Added clustering distance in configuration
parent
f52890e382
commit
071a361c87
|
@ -15,6 +15,8 @@ size_world_pannel_perc = 35
|
||||||
#min
|
#min
|
||||||
updateFrequency = 60
|
updateFrequency = 60
|
||||||
zoomlevel = 11
|
zoomlevel = 11
|
||||||
|
# ~meter
|
||||||
|
clusteringDistance = 10
|
||||||
|
|
||||||
[Log]
|
[Log]
|
||||||
fieldname_order=["id", "category", "type", ["value", "comment"]]
|
fieldname_order=["id", "category", "type", ["value", "comment"]]
|
||||||
|
|
|
@ -153,8 +153,10 @@ def getHitMap():
|
||||||
return jsonify(data)
|
return jsonify(data)
|
||||||
|
|
||||||
def isCloseTo(coord1, coord2):
|
def isCloseTo(coord1, coord2):
|
||||||
if abs(float(coord1[0]) - float(coord2[0])) <= 0.0001:
|
clusterMeter = cfg.getfloat('GEO' ,'clusteringDistance')
|
||||||
if abs(float(coord1[1]) - float(coord2[1])) <= 0.0001:
|
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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue