Converted dms to dd for circles
This commit is contained in:
parent
3e7a04fb14
commit
859d928539
4
fetch.py
4
fetch.py
@ -80,6 +80,8 @@ def fetch(url='https://www.legifrance.gouv.fr/eli/arrete/2018/10/12/PRMD1824595A
|
|||||||
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())
|
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]:
|
if "km" in lst[0][1]:
|
||||||
lst[0][1] = float(re.search("(\d*,?\d*).*", lst[0][1]).groups()[0].replace(",", "."))*100
|
lst[0][1] = float(re.search("(\d*,?\d*).*", lst[0][1]).groups()[0].replace(",", "."))*100
|
||||||
|
lst[0][2] = dms2dd(lst[0][2])
|
||||||
|
lst[0][3] = dms2dd(lst[0][3])
|
||||||
area["zone"] = lst
|
area["zone"] = lst
|
||||||
del lst
|
del lst
|
||||||
# Atolls
|
# Atolls
|
||||||
@ -95,7 +97,7 @@ if __name__ == '__main__':
|
|||||||
# Print the dict (keep this code in the end of the file)
|
# Print the dict (keep this code in the end of the file)
|
||||||
print("===== Dict =====")
|
print("===== Dict =====")
|
||||||
for index, area in enumerate(diclist):
|
for index, area in enumerate(diclist):
|
||||||
if index == 86:
|
if index == 129:
|
||||||
print(f"\n-------------{index}----------------\n")
|
print(f"\n-------------{index}----------------\n")
|
||||||
for element in area:
|
for element in area:
|
||||||
print(f" {element}: {diclist[index][element]}")
|
print(f" {element}: {diclist[index][element]}")
|
||||||
|
Loading…
Reference in New Issue
Block a user