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
-1
votes
3 answers

Python folium map developement

I am trying to build a map on python and i am using the folium library.I can see the map on my browser when it is only: import folium map = folium.Map(location=[25.747608, 89.268044]) map.save("Map2.html") When i add two more parameters like…
-1
votes
1 answer

Loop and store coordinates

I have a copy of a dataframe that looks like this: heatmap_df = test['coords'].copy() heatmap_df 0 [(Manhattanville, Manhattan, Manhattan Communi... 1 [(Mainz, Rheinland-Pfalz, 55116, Deutschland, ... 2 [(Ithaca, Ithaca Town, Tompkins…
eruiz
  • 59
  • 9
-1
votes
1 answer

folium --version not found even though installed and inside the python/site-packages folder

this is my code for map.py: import folium map = folium.Map(location=[42.3601, -71.0589], zoom_start=12) map.save('map.html') this is the error: File "map.py", line 2, in import folium File…
Tomer_Ra
  • 123
  • 1
  • 11
-1
votes
2 answers

Convert json file to dataframe in python and FourSqaure API

I'm completing this IBM Data Science certification on Coursera and one of the assignments require us to replicate this link- https://rawnote.dinhanhthi.com/files/ibm/neighborhoods_in_toronto. I'm fairly new to this so I was going through the link to…
Aastha Jha
  • 153
  • 1
  • 2
  • 14
-1
votes
1 answer

How to properly use style function when adding multiple Geojson leaflets to one map using Folium?

I'm trying to add multiple Geojson leaflets of boroughs on a city Folium map, painting them according to the population density and can't get my head around the proper usage of style_function here My piece of…
-1
votes
2 answers

Problem with loading a json file for geo_data in python

I am currently trying to use folium library in python to create webmaps. I have a file world.json which contains geo_data. I have provided a link to the file at the end of this post. I tried the following code: data = [json.loads(line) for line in…
Zarak
  • 3
  • 2
-1
votes
1 answer

Colormap issue in folium map

I am looking to create a heatmap of the USA based on data of COVID 19 cases. For that, I am using folium and geopandas. Here is the link for the data and the code I used is given below. colormap =…
Kshitiz Sampang
  • 29
  • 1
  • 1
  • 12
-1
votes
1 answer

Choropleth maps in Python

This is my dataset: This is my code: I'm getting this error: For those who need the code: canada_geo = r'canada_provinces.json' # create a plain world map canada_map = folium.Map(location=[56.1304, -106.3468], zoom_start=2, tiles='Mapbox…
-1
votes
1 answer

Issues with accessing GeoJSON fields

When I'm trying to add a GeoJson Tooltip: choropleth.geojson.add_child(folium.features.GeoJsonTooltip(fields=['feature.properties.NTAName'], labels=False)) And get an assertion error: AssertionError: The field feature.properties.NTAName is not…
hadronic
  • 1
  • 2
-1
votes
1 answer

How to access the geojson file correctly?

I want to use folium and GeoJSON file to map data on the world map. Therefore I have to access the GeoJSON file correctly. But I haven't figured out how. KeyError: "None of [Index(['STATE_CODE', 'STATE_NAME'], dtype='object', name='Province')] are…
Yves Boutellier
  • 1,286
  • 9
  • 19
-1
votes
1 answer

Can I add markers in folium based on values in a same location?

I have a dataset of location and some random values assigned to each location like following dataset picture. I have fetched the geographic location of each area, saved it in a json file, and then showed it accordingly on the map using markers.…
-1
votes
1 answer

Mapping UK Postcodes to Geographic boundaries for plotting

I have a dataframe with a (UK) postcode column, and a count column, e.g. postcode count SW1W0NY 10 PO167GZ 22 GU167HF 15 L18JQ 38 I wish to create a heatmap of this data using folium, where the counts are aggregated as per larger (e.g.…
iacob
  • 20,084
  • 6
  • 92
  • 119
-1
votes
2 answers

How can a plot a map with folium and place a bar graph next to the map in python?

I have a dataframe and I have been creating a interactive bar graph with widgets to show different characteristics of the dataframe and I am only missing to show the location with the latitud and longitud in the dataframe but i dont know how to show…
-1
votes
1 answer

Trying to loop through a list that contains multiple items inside it

Problem I'm mapping coordinates to a map using folium, my coordinates are stored in a list such as this e.g: [[51.52765, -0.1322611111111111], [53.54326944444444, -2.633125]]. Now when I tell folium to map a coordinate from the list, I have to…
name
  • 19
  • 1
  • 5
-1
votes
1 answer

Folium Choropleth problem - key_on - geojson issue

I got this error message when trying to run the code: code and error message - ufunc 'isnan' not supported for the input types The relevant dataframe is here: Relevant dataframe The geojson file is here: https://cocl.us/sanfran_geojson Any idea…
ICC
  • 1
  • 1