Python Forum
Folium map from another website - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Folium map from another website (/thread-21730.html)



Folium map from another website - tantony - Oct-11-2019

Is there a way to import map from this website in Python using folium or other packages? If not, what would be a good way to do this?

I was writing a Python script to get all the data for the map, and now that's done, I want to add the data to the map.

https://skyvector.com/

I can also download the charts from FAA if that would help with adding it to Python

https://www.faa.gov/air_traffic/flight_info/aeronav/digital_products/vfr/


RE: Folium map from another website - tantony - Oct-11-2019

Any suggestions will be helpful. I'm sure I can plot the data on a normal map, but I'm trying to do it on an aviation sectional chart.


RE: Folium map from another website - Larz60+ - Oct-11-2019

You may find this helpful for mapping: https://python-awips.readthedocs.io/en/latest/examples/generated/Map_Resources_and_Topography.html


RE: Folium map from another website - tantony - Oct-14-2019

I'm trying to save a folium map, but its not saving. I'm following the example from the link below. Any idea why?
import folium
m = folium.Map(location=[45.5236, -122.6750])
m.save('index.html')
https://python-visualization.github.io/folium/quickstart.html


RE: Folium map from another website - Larz60+ - Oct-14-2019

it's probably saving, just not where you expect it.
if you are on Linux, you can find it (although just about every web page has an index.html)
from a top directory, run (in terminal window):
find . -name 'index.html'



RE: Folium map from another website - tantony - Oct-14-2019

I'm on Windows 10, and I'm saving it to the same directory as the python.


RE: Folium map from another website - tantony - Oct-15-2019

Anything else I should try?


RE: Folium map from another website - tantony - Oct-15-2019

I ran the script from CMD and it worked. I wonder why it didnt' work from my IDE, PyCharm Community Edition?


RE: Folium map from another website - Larz60+ - Oct-15-2019

when you are in your IDE, the Current Working Directory is not always your source directory.
Thus when you save a file it may be saved in another directory (the CWD).
you can assure that you are in your source directory by importing os, then adding the following code
after all of your current code (bottom of script), replacing mycode with actual class of function name.
This will assure file will be saved in source directory when run from IDE.
if __name__ == '__main__':
    import os
    os.chdir(os.path.abspath(os.path.dirname(__file__)))
    mycode()