Converted dms to dd for circles

This commit is contained in:
TheDevKiller 2018-11-11 16:07:07 +01:00
parent 3e7a04fb14
commit 859d928539

View File

@ -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())
if "km" in lst[0][1]:
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
del lst
# Atolls
@ -95,7 +97,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:
if index == 129:
print(f"\n-------------{index}----------------\n")
for element in area:
print(f" {element}: {diclist[index][element]}")