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
5
votes
2 answers

Make this notebook trusted to load map : File -> Trust Notebook

import folium world_map=folium.Map() world_map This is showing something like : Make this notebook trusted to load map : File -> Trust Notebook while trusted is written on top right corner of my jupyter notebook file . How can i solve this issue ?
Akash Kumar
  • 307
  • 1
  • 4
  • 9
5
votes
1 answer

FeatureGroup layer control in Folium - only one active layer

I am trying to display several layers with information on a Choropleth Map having as base layer the Stamen Terrain and displaying the layers as FeatureGroup. Here is my initial code without overlay control: map = folium.Map(location=[38.58, 0],…
Vlad
  • 197
  • 1
  • 9
5
votes
1 answer

Highlight one specific country in Folium

I have a map drawn by folium as follow: m = folium.Map(location = [51.1657,10.4515], zoom_start=6, min_zoom = 5, max_zoom = 7) How can I get rid of neighbor countries and just keep Germany? Or alternatively neighbor countries become fade,…
mpy
  • 622
  • 9
  • 23
5
votes
0 answers

Nonlinear colormap in a folium map

I'm drawing colored regions on a folium map using log scale shading. Using custom colormap, the region colors seem to be ok. But the colormap, when added to the map legend, still looks linear: Is there any way to draw it as equal-width colored…
Alexander Pavlov
  • 665
  • 6
  • 14
5
votes
1 answer

folium draw star marker

I am looking into drawing three different markers on a folium map: square, circle and star. The first two are done using BeautifyIcon plugins. I am having trouble to plot the star. I would like to draw only the star without the pin. Any…
AjanO
  • 433
  • 1
  • 9
  • 20
5
votes
1 answer

Improving folium map speed

I made a map with some clusters and added a layer of polygon layer to the map, this consists of over 1 million rows, and the map became slow. Are the any way to speed it up when being used?
Keweik
  • 187
  • 1
  • 9
5
votes
1 answer

How to make routes tickable inside a layer on a map with folium

I'm creating a program with Python that finds the best routes for workers. It display a map with their itinerary and time of itinerary. I have 3 layers, one for each transport car, metro and bike. When i tick or unticked them it display or erase…
5
votes
0 answers

How can I hide markers and markerclusters outside a specific zoom level in folium?

Is it possible to hide a marker and markercluster on folium map in some specific zoom level? My code needs to react to zoom change and decide what points I want to share and register/deregister them from the map. I know that it is possible to do it…
5
votes
1 answer

OSMnx: plot a network on an interactive web map with different colours per infrastructure

I'm trying to plot a network where edges have different colors according to their Opens street map attribute ('highway'). It works if I use ox.graph, however, this generates a static map. If I use ox.plot.plot_graph_folium() I only get an…
Giulia R
  • 95
  • 1
  • 7
5
votes
0 answers

How do I add two choropleth layers in folium and have them act like a feature group?

I created two choropleth layers that I added to a map in folium. However, I don't like the functionality of the layers. First, both legends are displayed even when the layer is not selected. Second, you must manually uncheck the checkbox to view the…
prime90
  • 889
  • 2
  • 14
  • 26
5
votes
1 answer

Folium: color mapping when adding GeoJson to the map

I have a loop in my python code which adds features to my folium map. Each feature is held within a dictionary (called products) and each feature has a dictionary of parameters (GeoJson string and attributes). I want to color the feature based on…
ste_j
  • 115
  • 1
  • 8
5
votes
0 answers

how to draw an arc on a map with folium

I'm trying to show the flow of people within a city by drawing arcs from origin to destination. Any suggestion of how to do this in Python using Folium? If not, is there any other python tool that would allow me to draw an arc on a map? If not, how…
Fabius
  • 51
  • 3
5
votes
1 answer

No module named 'folium.plugins', Python 3.6

I am trying to import folium into a Jupyter notebook I'm working on and I cannot seem to solve the import issues with the Folium library. Has anyone else solved this problem? After encountering an error installing folium, I used the solution…
pandababy
  • 51
  • 1
  • 3
5
votes
3 answers

Choropleth map with OpenStreetMap data

My goal is to get a so-called "choropleth map" (I guess) of the zip code areas in Germany. I have found the python package "folium" but it seems like it takes a .json file as input: https://github.com/python-visualization/folium On OpenStreetMap I…
user3182532
  • 1,097
  • 5
  • 22
  • 37
5
votes
2 answers

How to specify gradient parameter to folium heatmap?

I'm making a heatmap for NYC apartment price using folium. I'm trying to use my own color gradient. When I specify the gradient argument in heatmap function, nothing shows on my map. Does anyone know how to generate our own color gradient and…
zesla
  • 11,155
  • 16
  • 82
  • 147