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

Folium custom pop-up

Running Python 3.5.2 with Folium 0.3.0. I am trying to create custom pop-ups appear whenever I click on a specific country with data. I manage to get the pop-ups appear, but I'm lost in passing in values dynamically into them. I'm familiar with…
vvv
  • 145
  • 3
  • 9
5
votes
2 answers

Folium Choropleth + GeoJSON raises AttributeError: 'NoneType'

I'm trying to do a choropleth using folium which offers a great link between GeoJSON, Pandas and leaflet. GeoJSON format is like below : { "type":"FeatureCollection", "features":[ { "type":"Feature", "geometry": …
gowithefloww
  • 2,211
  • 2
  • 20
  • 31
5
votes
1 answer

Python Package removed by typing "pip uninstall package_name" in terminal, still shows up in the list output of "pip list"

Is this normal? How do I make sure that the package (named folium) is completely removed from my computer? I see a folder called "package_name.dist-info" under Users/my_name/anaconda/lib/python2.7/site-packages. I also have conda installed on my…
Semihcan Doken
  • 776
  • 3
  • 10
  • 23
4
votes
1 answer

Reading and getting Folium Marker coordinates once the user clicks on the map

I found this code click here and edited to show the marker coordinates in textarea field once the user clicks on the map to add a marker but it gave an error Uncaught TypeError: document.getElementById(...) is null. I need someone to help making…
Khalid Seflan
  • 71
  • 1
  • 6
4
votes
0 answers

Python folium fetching csv data to the jinja macro template

I have the jinja macro template provided to my code, which executes the Leaflet circle creation. I would like to include the .csv data in this template when possible df = pd.read_csv("survey.csv") class Circle(folium.ClickForMarker): _template =…
Geographos
  • 827
  • 2
  • 23
  • 57
4
votes
1 answer

Python folium - Circle not working along with popup

I found some nice solutions here: How to create on click popup which includes plots using ipyleaflet, Folium or Geemap? which potentially would allow me to assign more things to the marker when it's clicked. In my situation I have a lot of circles…
Geographos
  • 827
  • 2
  • 23
  • 57
4
votes
1 answer

Import Excel data to Python for generating a heatmap

I would need some help! By now i used this short code to design a map with folium: pyton_folium_test.txt The next step for me is to learn how to import positions like this from an excel file, but here i got stuck the last two days. I tried to do the…
bose
  • 43
  • 5
4
votes
0 answers

Overlay a local .TIFF file in folium leaflet?

I've been using folium to overlay earth engine images in a leaflet in Python. I'm trying to get a local .TIFF raster to also display, but I only get an empty box in the bounds where the raster should be. import rasterio as rio from rasterio.plot…
4
votes
1 answer

Plot multiple encoded polylines on a folium map

I am using OSRM match service and got the following dictionary of the JSON…
winecity
  • 285
  • 2
  • 9
4
votes
4 answers

Updating folium changed the Popup box width

Recently I updated folium from 0.5.0 to 0.11.0 and thereafter I am experiencing a problem with the popup box. With the update the popup box seem to have shrinked in width and the text is coming in separate lines, which happened to appear in the same…
Mehmud
  • 169
  • 1
  • 1
  • 5
4
votes
0 answers

Folium, make legend disappear when switching layer (LayerControl)

I created some legends using the html example by InLaw(1) in this answer. From that answer, I also manage to get this legend using a MacroElement from Branca (2), where template is an html macro template. What I want is that (any) those legends…
Chepelink
  • 141
  • 3
4
votes
1 answer

Python Folium: how to create a folium.map.Marker() with multiple popup text lines?

Is there an possibility to create a second or third line for the popup text including adjustment of the width and height of the popup box? Found something on GitHub, but is that the only way? https://github.com/python-visualization/folium/pull/294
naheliegend
  • 159
  • 2
  • 3
  • 9
4
votes
1 answer

folium.GeoJson(some_data) - how to set marker type?

In the Marker class I can easily style points, but how to do this with an object like folium.GeoJson("some_data") where "some_data" contains multiple points? I´ve found an example on polygons, but not with point data. This is my code containing an…
CARTOS
  • 221
  • 2
  • 8
4
votes
1 answer

Dashed Polyline in Folium

I have an assignment which requires me to make an itinerary on Colaboratory using Folium. I have 8 different locations in Europe linked together with a Polyline. I was trying to make the line dashed but couldn't find a way to... I am a beginner and…
s13ve
  • 43
  • 1
  • 4
4
votes
1 answer

folium timeslider doesn't remove previous added marker in the map

I am trying to plot markers using time slider. I have created timestamped geojson as follows: def create_geojson_features(df): features = [] for lat,lan,intensity,time in zip(df['latitude'],df['longitude'],df['intensity'],df['timestamp']):…
gokyori
  • 357
  • 4
  • 15