Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add geo-mapping functionality #21

Open
dhhagan opened this issue Nov 5, 2017 · 4 comments
Open

Add geo-mapping functionality #21

dhhagan opened this issue Nov 5, 2017 · 4 comments

Comments

@dhhagan
Copy link
Owner

dhhagan commented Nov 5, 2017

Make it easy for people to make nice geo-maps.

@sergiolucero
Copy link

sergiolucero commented Dec 11, 2017

I don't know if this has been discussed but I strongly suggest the folium library as a candidate. My running example goes like this:

import openaq
import folium

api = openaq.OpenAQ()
locs = api.locations(country='CH', df=True)

basemap = folium.Map(location=[locs['coordinates.latitude'].mean(), 
                           locs['coordinates.longitude'].mean()],
				zoom_start=8)

locs.apply(lambda row:	folium.Marker((row['coordinates.latitude'], 
			   row['coordinates.longitude']),
			   popup = row.to_json()).add_to(basemap),
			   axis=1)

basemap.save('airquality.html')

@dhhagan
Copy link
Owner Author

dhhagan commented Aug 21, 2018

Hey @sergiolucero I would suggest adding a few examples to the gallery if you have some time (I'm currently swamped and will be until I defend next spring...). If you need help figuring out how to do that, let me know and I can lend a hand on instructions.

@sergiolucero
Copy link

Hi @dhhagan I think I just created my first pull request. Does it need to pass any tests? I guess I need to modify requirements.txt as well?

@dhhagan
Copy link
Owner Author

dhhagan commented Aug 22, 2018

Hey @sergiolucero. There are unit tests it must pass and it looks like it's failing right now, but not because of your additions. I'll try and take a look later to see what's going on. You shouldn't need to edit the requirements.txt file as I don't think folium should be a requirement for installation - it will only be needed if geo-maps are to be built/used. Eventually, if there is a function of some sort for using folium within the library, it will be needed - but not for examples only. I will add it to the install file for travis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants