folium

Branca Python module is unable to find 2 essential json files when running an executable that uses folium

旧巷老猫 提交于 2020-05-14 07:09:06
问题 There is a chance this is still a problem and the Pyinstaller and/or Folium people have no interest in fixing it, but I'll post it again here in case someone out there has discovered a workaround. I have a program that creates maps, geocodes etc and recently added the folium package to create some interactive maps in html format. I always compile my code using pyinstaller so that others at my company can just use the executable rather than running the python code. If I run my code in an IDE,

Folium map issue in PyCharm

只谈情不闲聊 提交于 2020-04-18 05:48:39
问题 I am using Pycharm and the folium maps are not being displayed. My code is as follows: import folium from folium import plugins import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from IPython.core.display import display, HTML m = folium.Map([52.5, 2], zoom_start=5.5) display(m) But I am able to save it as html and it is correctly displayed in html. m.save('aee.html') 回答1: You can't open the map directly in pycharm. Yet, as you stated you can make an HTML File of it.

folium custom map tiles

旧街凉风 提交于 2020-04-13 05:21:07
问题 I want to add this map tile layer to my map – Stamen toner-background. As I read in documentation I need to simply give custom url in the tiles attribute of map mapa = folium.Map(width=1000, height=700, zoom_start=5.5, location=[52.5, 19], tiles='http://maps.stamen.com/toner-background/embed#6/{x}/{z}', attr="toner-bcg") It loads but nothing is displayed. I don't really know how this attribution thing works like and what should I do. I like the tile because it's like stamen toner but without

folium custom map tiles

孤街醉人 提交于 2020-04-13 05:20:50
问题 I want to add this map tile layer to my map – Stamen toner-background. As I read in documentation I need to simply give custom url in the tiles attribute of map mapa = folium.Map(width=1000, height=700, zoom_start=5.5, location=[52.5, 19], tiles='http://maps.stamen.com/toner-background/embed#6/{x}/{z}', attr="toner-bcg") It loads but nothing is displayed. I don't really know how this attribution thing works like and what should I do. I like the tile because it's like stamen toner but without

How to create a geographical heatmap passing custom radii

这一生的挚爱 提交于 2020-03-23 04:00:07
问题 I want to create a visualization on a map using folium. In the map I want to observe how many items are related to a particular geographical point building a heatmap. Below is the code I'm using. import pandas as pd import folium from folium import plugins data = [[41.895278,12.482222,2873494.0,20.243001,20414,7.104243], [41.883850,12.333330,3916.0,0.835251,4,1.021450], [41.854241,12.567000,22263.0,1.132390,35,1.572115], [41.902147,12.590388,19505.0,0.839181,37,1.896950], [41.994240,12.48520

PNG image not being displayed on Folium map

荒凉一梦 提交于 2020-03-05 04:27:06
问题 I ran this folium example of image display on folium map from here. I ran this program on my spyder though it works fine on jupyter import numpy as np import pandas as pd import numpy.ma as ma import folium def make_data(): x = np.linspace(-np.pi, np.pi, 101) sin = np.sin(x) cos = np.cos(x) cos[20:50] = np.NaN return pd.DataFrame(np.asanyarray([sin, cos]).T, columns=['sin', 'cos'], index=x) df = make_data() resolution, width, height = 75, 7, 3 station = '42' lon, lat = -42, -21 m = folium.Map

How to use folium.icon with fontawesome

99封情书 提交于 2020-02-25 12:53:06
问题 I am looking to use a custom fontawesome icon, thx. I would like to change the icon from folium.icon using fontawesome icons. For example, I want to change this: import folium m = folium.Map(location=(25.0431, 121.539723), zoom_start=12,tiles='Cartodb Positron') folium.Marker( location=[25.0431, 121.539723], icon=folium.Icon(color="red",icon="fa-truck", prefix='fa')).add_to(m) m To a burger icon from fontawesome as shown below: folium.Marker( location=[25.0431, 121.539723], icon=folium.Icon

Add menu bar on folium map to select or deselect particular object (Marker)

余生长醉 提交于 2020-02-23 07:25:08
问题 I've built a cool map like the one below but with more objects. import folium base_map = folium.Map(location=[52.2297, 21.0122], control_scale=True, zoom_start=10) points1 = [(52.228771, 21.003146), ( 52.238025, 21.050971), (52.255008, 21.036172), (52.252831, 21.051385), (52.219995, 20.965021)] for tuple_ in points1: icon=folium.Icon(color='white', icon='train', icon_color="red", prefix='fa') folium.Marker(tuple_, icon=icon).add_to(base_map) points2 = [(52.239062, 21.131601), (52.204905, 21

Folium Search Plugin No Results for FeatureGroup

馋奶兔 提交于 2020-01-23 03:30:11
问题 I'm trying to add search functionality to a map I'm generating in Python with Folium. I see there is a handy Search plugin available and able to implement it successfully and get it added to the map. Unfortunately, using a FeatureGroup as the layer my FeatureGroup filled with markers can't seem to get the search to bring back results. My assumption is that the search function would query the tooltip and/or popup attributes of the markers to return the lat/lon as the search value. I've tried

Django and Folium integration

最后都变了- 提交于 2020-01-20 08:20:29
问题 Django newbie here: my aim is to integrate Folium to an html page. so what I have at the moment: polls/views.py def show_map(request): #creation of map comes here + business logic m = folium.Map([51.5, -0.25], zoom_start=10) test = folium.Html('<b>Hello world</b>', script=True) popup = folium.Popup(test, max_width=2650) folium.RegularPolygonMarker(location=[51.5, -0.25], popup=popup).add_to(m) context = {'my_map': m} return render(request, 'polls/show_folium_map.html', context) polls/urls.py