Skip to content

Commit

Permalink
Sure
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Dec 15, 2022
1 parent ad39f06 commit 92beaad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 3 additions & 6 deletions inciweb_wildfires/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ def get_incidents():
"""
url = "https://inciweb.nwcg.gov/feeds/maps/placemarks.kml"
r = requests.get(url)
soup = BeautifulSoup(r.content, 'xml')
soup = BeautifulSoup(r.content, "xml")
folder_list = soup.find_all("Folder")
feature_list = []
for folder in folder_list:
d = dict(
name=folder.find("name").text,
url=folder.find("Placemark").a['href']
)
coords = folder.find("Point").find('coordinates').text.split(",")
d = dict(name=folder.find("name").text, url=folder.find("Placemark").a["href"])
coords = folder.find("Point").find("coordinates").text.split(",")
p = Point(map(_safe_float, coords))
f = Feature(geometry=p, properties=d)
feature_list.append(f)
Expand Down
8 changes: 1 addition & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ def local_version(version):
url="http://www.github.com/datadesk/inciweb-wildfires",
license="MIT",
packages=("inciweb_wildfires",),
install_requires=[
"requests",
"geojson",
"click",
"bs4",
"lxml"
],
install_requires=["requests", "geojson", "click", "bs4", "lxml"],
entry_points="""
[console_scripts]
inciwebwildfires=inciweb_wildfires.cli:cmd
Expand Down

0 comments on commit 92beaad

Please sign in to comment.