This commit is contained in:
faraway 2022-07-28 17:34:19 +02:00
commit 4a1508f11f
1 changed files with 1 additions and 5 deletions

View File

@ -17,13 +17,12 @@ import webbrowser
import requests
import pandas as pd
import folium
from geopy.geocoders import Nominatim
from geopy.extra.rate_limiter import RateLimiter
def check_file_format(args_inputfile):
pattern = re.compile(r'local_VIIRS_data-\d\d\d\d-\d\d-\d\d.csv')
pattern = re.compile(r'local_VIIRS_data-\d{4}-\d{2}-\d{2}.csv')
if not re.match(pattern, args_inputfile):
raise argparse.ArgumentTypeError
return args_inputfile
@ -65,10 +64,8 @@ def render_map(in_ukraine, address_list, date):
str(address.raw['display_name'])),
radius=10).add_to(fire_map)
else:
fire_map = folium.Map(location=[(44.184598 + 52.3797464)/2, (22.137059 + 40.2275801)/2],
zoom_start=4, max_bounds=True, crs='EPSG3857')
folium.raster_layers.TileLayer(
tiles=src,
subdomains='abc',
@ -103,7 +100,6 @@ def main(args):
raise SystemExit(e)
except requests.exceptions.RequestException as e:
raise SystemExit(e)
html_file = local_file.split('.')[0] + '.html'
data_frame = pd.read_csv(local_file)
data_frame = data_frame.astype({'confidence': 'string'})