Converted km to m
This commit is contained in:
parent
1231c201b6
commit
3e7a04fb14
9
fetch.py
9
fetch.py
@ -76,13 +76,15 @@ def fetch(url='https://www.legifrance.gouv.fr/eli/arrete/2018/10/12/PRMD1824595A
|
||||
del lst
|
||||
# Circles
|
||||
elif "cercle" in area["zone"]:
|
||||
lst = [()]
|
||||
lst[0] = re.search(r"(.{6}) .{0,5}?(\d{1,3},?\d{0,2} ?.{1,2}) .{1,35} ?(\d{3}° \d{1,2}' \d{1,2}” .) ?\/ ?(\d{1,3}° \d{1,2}' \d{1,2}” .)", area["zone"], re.S).groups()
|
||||
lst = [[]]
|
||||
lst[0] = list(re.search(r"(.{6}) .{0,5}?(\d{1,3},?\d{0,2} ?.{1,2}) .{1,35} ?(\d{3}° \d{1,2}' \d{1,2}” .) ?\/ ?(\d{1,3}° \d{1,2}' \d{1,2}” .)", area["zone"], re.S).groups())
|
||||
if "km" in lst[0][1]:
|
||||
lst[0][1] = float(re.search("(\d*,?\d*).*", lst[0][1]).groups()[0].replace(",", "."))*100
|
||||
area["zone"] = lst
|
||||
del lst
|
||||
# Atolls
|
||||
elif area["zone"].strip() == "atolls et eaux territoriales incluses":
|
||||
area["zone"] = [("cercle", "35KM", "138.9022", "21.82917"), ("cercle", "27KM", "138.7425", "22.23528A")]
|
||||
area["zone"] = [("cercle", 3500.0, "138.9022", "21.82917"), ("cercle", "27KM", "138.7425", "22.23528A")]
|
||||
return diclist
|
||||
|
||||
|
||||
@ -93,6 +95,7 @@ if __name__ == '__main__':
|
||||
# Print the dict (keep this code in the end of the file)
|
||||
print("===== Dict =====")
|
||||
for index, area in enumerate(diclist):
|
||||
if index == 86:
|
||||
print(f"\n-------------{index}----------------\n")
|
||||
for element in area:
|
||||
print(f" {element}: {diclist[index][element]}")
|
||||
|
Loading…
Reference in New Issue
Block a user