Avoid alphabetic characters in filter rules
This commit is contained in:
parent
7617891faf
commit
d397b83dc8
@ -30,6 +30,7 @@
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
from math import pi, cos, hypot
|
from math import pi, cos, hypot
|
||||||
|
import re
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -77,7 +78,10 @@ class WithinArea(Rule):
|
|||||||
self.latitude, self.longitude = conv_lat_lon(latitude,
|
self.latitude, self.longitude = conv_lat_lon(latitude,
|
||||||
longitude,
|
longitude,
|
||||||
"D.D8")
|
"D.D8")
|
||||||
value = int(self.list[1])
|
val = self.list[1]
|
||||||
|
if isinstance(val, str):
|
||||||
|
val = re.sub("\D", "", val) # suppress all alpha characters
|
||||||
|
value = int(val)
|
||||||
unit = int(self.list[2])
|
unit = int(self.list[2])
|
||||||
# earth perimeter in kilometers for latitude
|
# earth perimeter in kilometers for latitude
|
||||||
# 2 * pi * (6371 * cos(latitude/180*pi))
|
# 2 * pi * (6371 * cos(latitude/180*pi))
|
||||||
|
Loading…
Reference in New Issue
Block a user