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
53
votes
1 answer

Choropleth map using folium and pandas

I am using folium to create a choropleth map of a set of countries. I am following the documentation. However. for some reason the map doesn't show any shades. I am using the world geojson from natural earth (see the gist). My dataframe looks…
goofd
  • 2,028
  • 2
  • 21
  • 33
39
votes
3 answers

Plot latitude longitude from CSV in Python 3.6

I'm trying to plot a large number of latitude longitude values from a CSV file on a map, having this format (first column and second column): I'm using python 3.6 (apparently some libraries like Basemap doesn't operate on this version). How can I…
Tina J
  • 4,983
  • 13
  • 59
  • 125
26
votes
3 answers

Export a folium map as a png

I'm working with a map created using python, folium, and geojson, similar to this one. However, instead of this image being an interactive HTML document, I would rather simply export it to png or svg. Using the syntax: m = folium.Map( #…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
22
votes
7 answers

Folium map not displaying

Running on canopy version 1.5.5.3123 With; Folium Version: 0.1.2, Build: 1 The following code; import folium import pandas as pd LDN_COORDINATES = (51.5074, 0.1278) from IPython.display import HTML import shapefile #create empty map zoomed in on…
mapping dom
  • 1,737
  • 4
  • 27
  • 50
20
votes
1 answer

How to install a python package with all the dependencies into a Docker image?

I'm working in Ubuntu 15.10 with the Docker container for Pyspark jupyter/pyspark-notebook. I need to install folium with all it's dependencies and run a Pyspark script into the container. I successfully installed Docker, pulled the image and run…
Jocer
  • 542
  • 1
  • 5
  • 20
18
votes
1 answer

Python Folium icon list

Is there any list of icons available that I can use in a expression like I use home in this one? folium.Marker(location=[0,20], icon=folium.Icon(color='lightgray', icon='home', prefix='fa')).add_to(m)
Hugo
  • 1,558
  • 12
  • 35
  • 68
18
votes
2 answers

Best practice when using folium on django

I'm building an app with django ,which is going display a map of the top voted items. I'm not an experienced web developed and i wonder where and when and where should build them map. (this line for example -->…
Amit be
  • 469
  • 3
  • 13
17
votes
5 answers

Insert the folium maps into the jinja template

I want to insert follium map into the jinja template. run.py from flask import Flask, render_template app = Flask(__name__) @app.route('/') def index(): start_coords = (46.9540700, 142.7360300) folium_map =…
Andrei
  • 1,313
  • 4
  • 18
  • 35
16
votes
2 answers

plot Latitude longitude points from dataframe on folium map - iPython

I have a dataframe with lat/lon coordinates latlon (51.249443914705175, -0.13878830247011467) (51.249443914705175, -0.13878830247011467) (51.249768239976866, -2.8610415615063034) ... I would like to plot these on to a Folium map but I'm not sure…
hsquared
  • 349
  • 2
  • 4
  • 17
16
votes
3 answers

Print a line/multiline in a new layer over a map using Folium

I have tried Python folium library with impressive results, but there is one feature I am missing, or in any case I can't find: I want to print a multiline in a new layer over the map. If I check de documentation, I can only find how to add markers…
Roman Rdgz
  • 12,836
  • 41
  • 131
  • 207
15
votes
5 answers

Create a Legend on a Folium map

The Folium documentation is incomplete at this time: https://folium.readthedocs.io/en/latest/ According to the index of the incomplete docs Legends and Layers are, or will be supported. I've spent some time looking for examples on the web but have…
sparrow
  • 10,794
  • 12
  • 54
  • 74
13
votes
1 answer

Unknown format code 'f' for object of type 'str'- Folium

I have a dataframe that looks like below Number Names latitude longitude 0 1 Josh 25.713277 80.746531 1 2 Jon 25.713277 80.746531 2 3 Adam 25.713277 80.746531 3 4 Barsa 25.713277 …
foret
  • 337
  • 1
  • 5
  • 14
13
votes
3 answers

Plot colored polygons with geodataframe in folium

I'm trying to plot radar data in folium, and I'm almost there. I followed this example (Contour plot data (lat,lon,value) within boundaries and export GeoJSON) to get my data into a GeoJson format. nb_class = 20 collec_poly =…
edub
  • 659
  • 4
  • 8
  • 19
12
votes
2 answers

How to copy a marker's location on folium Map by clicking on it?

I am able to print the location of a given marker on the map using folium.plugins.MousePosition. class GeoMap: def update(self, location_center:np.array, locations: np.array): self.map = folium.Map(location_center,…
Mistapopo
  • 433
  • 3
  • 16
12
votes
2 answers

Set color for missing values in folium choropleth

I have a dataframe with some countries and variables and I would like to produce a choropleth map with folium, using a geojson file for the entire world. I have a problem with folium assigning maximum value on a color scale to countries that are not…
pieca
  • 2,463
  • 1
  • 16
  • 34
1
2 3
87 88