Questions tagged [folium]

A python wrapper for the geo-mapping Leaflet.js library.

Folium builds on the data wrangling strengths of the Python ecosystem and the mapping strengths of the Leaflet.js library. Manipulate your data in Python, then visualize it in on a Leaflet map via Folium.

Documentation

Folium makes it easy to visualize data that’s been manipulated in Python on an interactive Leaflet map. It enables both the binding of data to a map for choropleth visualizations as well as passing Vincent/Vega visualizations as markers on the map.

The library has a number of built-in tilesets from OpenStreetMap, Mapbox, and Stamen, and supports custom tilesets with Mapbox or Cloudmade API keys. Folium supports both GeoJSON and TopoJSON overlays, as well as the binding of data to those overlays to create choropleth maps with color-brewer color schemes.

1307 questions
12
votes
1 answer

Displaying Radius in Meters with Folium

I am having trouble understanding how the radius option works with Folium. I have the following code: import folium lat = 40.7787006 lon = -73.9654842 map = folium.Map(location=[lat, lon], zoom_start=20) folium.Marker([lat,…
Kevin
  • 555
  • 1
  • 5
  • 10
12
votes
2 answers

Foilum map module, trying to get more options for marker colors

I am playing with Folium a lot right now and its really great to have something so easy to use in Python. But their documentation is seriously behind, which I understand. So I have 2 questions. What am I doing wrong in how I am trying to get more…
Kristifer Szabo
  • 519
  • 3
  • 7
  • 16
11
votes
1 answer

Add heatmap to a layer in Folium

I have this sample code: from glob import glob import numpy as np import folium from folium import plugins from folium.plugins import HeatMap lon, lat = -86.276, 30.935 zoom_start = 5 data = ( np.random.normal(size=(100, 3)) * …
Luis Ramon Ramirez Rodriguez
  • 9,591
  • 27
  • 102
  • 181
11
votes
3 answers

Django and Folium integration

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 =…
adhg
  • 10,437
  • 12
  • 58
  • 94
11
votes
2 answers

Plotting markers on a map using Pandas & Folium

I am trying to plot a large number (~20,000) of circle markers using Folium. The latitude and longitude data is contained in a Pandas DataFrame (within "LAT" and "LONG" columns). I have come up with the following (inefficient) code, which requires…
marillion
  • 10,618
  • 19
  • 48
  • 63
11
votes
3 answers

Is it possible to draw lines with arrowheads in a Folium map?

I am running Folium 0.2.1' with Python 2.7.11 on Jupyter Notebook Server 4.2.1 I am trying to plot lines on a map, which have a arrowhead to convey direction import folium #DFW, LGA coordinates coordinates=[(32.900908, -97.040335),(40.768571,…
akrishnamo
  • 449
  • 1
  • 3
  • 15
10
votes
1 answer

Unsure how to use colormap with Folium marker plot

I have a dataframe with latitude, longitude, and power percentage. I want to do something very simple but not sure how: apply a colormap to color the data points based on their percentage. So 90% is red and 100% is blue. I have created both a…
geistmate
  • 525
  • 2
  • 5
  • 14
10
votes
3 answers

Folium map not displaying in Spyder

The title says it all : I can't get Spyder to display a map with folium. Here is what I get : import folium m = folium.Map(location=[45.5236, -122.6750]) m No error (and no map), just this : < folium.folium.Map at 0xd03fcf8 > m.render() # No idea…
François M.
  • 4,027
  • 11
  • 30
  • 81
9
votes
3 answers

Returning Latitude, Longitude values from folium map on mouse click to python script (streamlit webapp)

I am writing a webapp where the user will click on the map and the latitude, longitude will be returned to the python script. the webapp is written on streamlit and for the map I am using folium. Currently, I used folium.LatLngPopup() to get the on…
tuntun
  • 91
  • 1
  • 5
9
votes
2 answers

Adding JavaScript to Folium map

I'm working on a project to make a map using folium and flask and I'm trying to add my own javascript to add some animation to the tile to appear one by one. The question is how can I add my custom javascript to the map using python flask as I have…
Ahmed Tawfik
  • 159
  • 2
  • 5
9
votes
1 answer

pre-determine optimal level of zoom in folium

I am plotting some maps using folium. Works pretty smoothly. However, I could not figure out how to pre-calculate the right level of zoom I can set it automatically import folium m = folium.Map([point_of_interest.iloc[0].Lat,…
00__00__00
  • 4,834
  • 9
  • 41
  • 89
9
votes
1 answer

showing two Folium maps side by side?

How can I show two folium maps side by side? (something like the image below, but instead of matplotlib charts I want folium maps to be shown) edit: I want to show these maps in a jupyter notebook. and here's my current code with shows two maps…
M. Chavoshi
  • 1,023
  • 9
  • 17
9
votes
1 answer

How to create an animation with Folium?

I am using Folium to create maps in Python. I have a Pandas DataFrame where entries (latitude and longitude) are indexed by time. I would like to plot those entries one hour at a time (from 00:00 to 01:00 ...... from 23:00 to 00:00) in order to see…
ryuzakinho
  • 1,891
  • 3
  • 21
  • 35
9
votes
2 answers

What is the fastest way to plot coordinates on map inline (Jupyter)?

I was wondering what's the straightforward and fastest way to plot several coordinates (1.5 million) on OpenStreetMap. It must be able to be displayed inline in a Jupyter Notebook. I've been trying with Folium module and list comprehension: import…
mforpe
  • 1,549
  • 1
  • 12
  • 22
9
votes
1 answer

how to plot lat and long from pandas dataframe on folium map group by some labels

I have pandas dataframe like following Latitude Longitude Class 40.7145 -73.9425 A 40.7947 -73.9667 B 40.7388 -74.0018 A 40.7539 -73.9677 B I…
Neil
  • 7,937
  • 22
  • 87
  • 145
1
2
3
87 88