Questions tagged [folium]

A Python library for producing maps with Leaflet.js

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

Issues with Folium Grid Visualization in Xarray (Python)

I'm working on a grid visualization using Folium and Xarray in Python. The code is designed to display rectangles on a map, representing grid cells with associated wind speeds. The visualization works ...
John Smith's user avatar
0 votes
1 answer
34 views

Landsat imagery showing up as white in GEE

I am trying to learn GEE's Python API through Google Colab. Right now I am trying to map Landsat using folium and geehydro. I was able to implement NDVI just fine, and it displayed exactly as I ...
Noah Jacobs's user avatar
0 votes
0 answers
100 views

How to use folium marker on click event to draw other markers on the map

I'm trying to build an app with Python to generate markers when ever I click on an initial marker. I tried using folium but it's not working for me. I tried editing in the generated HTML file but it ...
Abdulrahman Adel's user avatar
3 votes
1 answer
266 views

Control Layer Order/Z-Index of Custom DivIcon() Marker in Folium Map

I'm working on a project where I'm using Folium to create an interactive map in Python. I want to use a marker that can visualize directional data; however, Folium doesn't seem to offer any and I had ...
Austin's user avatar
  • 128
0 votes
0 answers
68 views

Large number of polygons to plot on Folium map

I've got a Geopandas Dataframe (polygon_df) that looks like the one below, these Polygons were created by a Yolo segmentation algorithm. Each line in the DataFrame represents a segmented group of ...
wodank's user avatar
  • 1
0 votes
0 answers
30 views

Custom created Polygons don't display on Folium map

I've got a Geopandas Dataframe (polygon_df) that looks like the one below, these Polygons were created by a Yolo segmentation algorithm and transformed twice from their original format (this ...
wodank's user avatar
  • 1
0 votes
0 answers
248 views

Adding marker to folium map inside thread using streamlit

Using the following code I am trying to add marker to folium map inside thread on webapp using streamlit. import streamlit as st from streamlit_folium import folium_static import folium import ...
RRSC NGP's user avatar
  • 658
0 votes
0 answers
748 views

Remove marker from folium map

With the following code I am able to add marker to the folium maps: import folium import time m = folium.Map(location = [13.0, 77.0], tiles=None, zoom_start = 5, control_scale = True) img_path = '...
RRSC NGP's user avatar
  • 658
2 votes
0 answers
276 views

How to rotate folium CustomIcon

I have dataframe; it has name, latitudes, longitudes and heading. Heading value will between 0 and 360. According to the angle we need to rotate. I printed my dataframe items inside folium map in ...
heshjse's user avatar
  • 121
1 vote
1 answer
94 views

Visualization of CDSE WMS tiles using Folium

Using the Copernicus Data Space Ecosystem dashboard I created a New Configuration that I am able to visualize on Folium using Python. How can I specify an absolute timestamp? I want to visualize a ...
Just_4n0th3r_Pr0gr4mm3r's user avatar
0 votes
1 answer
923 views

Adding new marker to an existing Folium map file

I have the Python codes below to work on Folium map. I want to add a new marker to my old map file and focus the map on the new marker. However, it does not write the new marker; instead it seems to ...
Romy Opeña's user avatar
1 vote
0 answers
176 views

Python: Folium popup not working when rendering HTML

I want to do HTML formatting into a folium map popup. When I try to render html by using def format_popup_content(row) function then the map does not display. How do I format popup? This is what I ...
Ocean Vue's user avatar
2 votes
1 answer
438 views

How to add categorised colours to leafmap polygons

I have started using Leafmap and am having difficulty categorising colors into polygons based on unique 'SLOPE' values. I am able to build the map I want in Folium, and I want something similar in ...
Colin Clark's user avatar
1 vote
1 answer
349 views

Osmnx.plot_graph_folium() not working; folium is not recognized

I'm trying to display a osmnx map like: graph_map = ox.plot_graph_folium(coordinates, popup_attribute ="name", edge_width=2) but I get an error: Cell In[40], line 1 ----> 1 graph_map = ...
simonericmoon's user avatar
2 votes
2 answers
761 views

Creating a custom grid on a Folium Map

I am quite new to Python and I need to create a custom grid with a specific spacing on a Folium map for a particular district. I have added the Polygon of district boundary on the folium map. The grid ...
Jawi289p's user avatar
1 vote
0 answers
193 views

Add extra info to the GeoJSON `features` from a Folium choropleth map with multiple feature groups

When I make a single Folium choropleth map, I often add data from my data DF to the GeoJSON data, so it can be displayed with the folium.GeoJsonTooltip(). My code looks like this: map_data_lookup = ...
Feikname's user avatar
0 votes
0 answers
153 views

Folium Choropleth Maps -- when do I need "geojson" parameter b/f .add_to(map)

Normally, when I create a choropleth map with Folium, at the end of the folium.Choropleth() call, I just .add_to(map): folium.Choropleth().add_to(m) I've been trying to create a map with multiple ...
Feikname's user avatar
0 votes
0 answers
323 views

Folium choropleth maps in layers lose scale - how to fix?

How can I get the scale/legend to display? I can get Folium to produce choropleth maps individually; they always include the scale and legend. I've also figured out how to get them grouped into ...
Feikname's user avatar
0 votes
0 answers
489 views

Add a popup to each marker in the Folium map instantly when the marker appears in the map

I have a Folium map, where the markers (coordinates) appear based on the time. what I want is that when a marker appears on the map, its popup would be seen instantly, independently of the click. I ...
minimal life's user avatar
1 vote
0 answers
149 views

How do I change the tile type for one area of the map?

The whole map has a TileLayer = 'OpenStreetMap'. How to change the Title Layer only for the area indicated by the polygon? import folium X1 = 61.70029083832628 Y1 = 27.24609375 X2 = 61.68987220046 Y2 ...
Centrus's user avatar
  • 11
1 vote
1 answer
844 views

How to unify or integrate search bar in folium for multiple layers?

How to integrate multiple layers with one search bar using folium python? Data: import geopandas states = geopandas.read_file( "https://raw.githubusercontent.com/PublicaMundi/MappingAPI/...
Ceraunophile's user avatar
1 vote
0 answers
682 views

How to make folium multiple markers's popups display simultaneously on click on any one of them?

this code works fine but it only displays the popup of the clicked marker. I rather want that all markers' popups display when clicking on any marker of them. import folium import pandas as pd data = ...
Mahfoud B.'s user avatar
1 vote
1 answer
607 views

Why are some of my markers not showing up in Folium?

I'm creating a map in Folium and it is working great, except several hundred markers aren't showing up on the map. There is no error message, I just notice that there are fewer markers than I expect. ...
Henry 's user avatar
  • 11
1 vote
0 answers
414 views

Export GeoJSON file automatically in Folium Draw plugin

I have recently been introduced to folium and I need to access the exported Geojson file. I found a short code to do for my project. import folium from folium.plugins import Draw m = folium.Map() ...
Reza MN's user avatar
  • 11
3 votes
1 answer
443 views

Folium to display points in Leaflet map (from data stored in array)

I'm attempting to use Folium to create a web map using Leaflet with data stored in an array. However, the markers are not being added to the map. I'm using the code below. centerX = 34.2104 centerY = -...
Chad Leftwich's user avatar
0 votes
0 answers
105 views

Extract feature from featurecollection in MongoDB atlas

I need to extract data from my database and add pointer to the map with folium. import folium import os from folium import features import numpy as np import pandas as pd N = 1000 lons = +5 - np....
chaoslobster73's user avatar
4 votes
1 answer
458 views

Python folium add marker in random place

I would like to add a marker in a random place in Python folium. I found the example, which I would like to implement, which is here: http://kody.wig.pl/javascript/dodawanie-przesuwanie-i-kasowanie-...
Geographos's user avatar
  • 4,077
2 votes
1 answer
403 views

Python folium - Leaflet plugin not visible on the map

I would like to inject Leaflet plugin into Python folium map. After applying the following code: map.get_root().header.add_child(folium.CssLink("https://pasichnykvasyl.github.io/Leaflet.BigImage/...
Geographos's user avatar
  • 4,077
0 votes
0 answers
888 views

Python folium - add labels to drawn elements

Following the query here: Exporting GeoJSON with defined properties using Folium Draw plugin I would like to add labels to the elements, which will be drawn and their features will be defined. By ...
Geographos's user avatar
  • 4,077
1 vote
1 answer
1k views

Folium: export coordinates from markers

I'm looking for a way to export the coordinates from markers on the map in folium. I know that one can get the coordinates over the current mouse position, but I would like to use this information for ...
Loui77's user avatar
  • 13
3 votes
1 answer
1k views

Exporting GeoJSON with defined properties using Folium Draw plugin

I used a nice plugin for python folium: https://www.youtube.com/watch?v=rAicpbCUwco&ab_channel=SudoControl but the problem is, that my saved geojson file has no properties. I tried to inject JS ...
Geographos's user avatar
  • 4,077
0 votes
1 answer
186 views

Folium: ValueError: key_on `'FIPS'` not found

I'm working on a Folium choropleth map, using a shapefile from the Census bureau and religion data from the US Religion Census. I can get both sets of data loaded and cleaned up, so I have two DFs: ...
Adam's user avatar
  • 33
2 votes
1 answer
2k views

Highlight geometry in Folium map on hover

Is there a way to highlight geometry in Folium on hover along with the tooltip? Sample Data: import pandas as pd import requests import geopandas response = requests.get( "https://raw....
Ceraunophile's user avatar
1 vote
0 answers
308 views

Integrate pydeck layers in Folium map

The pydeck library is a set of Python bindings for making spatial visualizations with deck.gl, optimized for a Jupyter environment. folium builds on the data wrangling strengths of the Python ...
Ceraunophile's user avatar
1 vote
0 answers
232 views

Export a GeoJSON to GeoDataFrame using Folium, Leafmap or Ipyleaflet

The title might be odd though, I'm currently working on a project using COLAB and trying to find a way to export a drawn polygon to a Geodataframe without downloading it to the local machine. So the ...
dinc's user avatar
  • 11
1 vote
0 answers
1k views

Add Legend to CircleMarker Map

I used Folium to make a map that visualizes the population distribution of a number of universities but I'm unable to add a legend to my map. How can I get the legend on the map? Attached is the code ...
Edudzi's user avatar
  • 99
1 vote
1 answer
2k views

Python folium markercluster doesn't work as expected for the add_child element

I would like to clusterize my points. Unfortunately I cannot do it with my code it loos like. import pandas as pd import folium from folium import FeatureGroup from folium.plugins import ...
Geographos's user avatar
  • 4,077
1 vote
1 answer
2k views

Layers categories in Folium and Google Earth Engine Python API

I am using Python, Google Earth Engine and Folium. Is there a way to stack layers by categories in Folium & Google Earth Engine (Python not JS editor)? I want to achieve something like leaflet.js &...
Indigo Wizard's user avatar
0 votes
0 answers
392 views

Can a 'regular' Folium tooltip show information dynamically?

I've worked previously with Folium's GeoJSONTooltip class and it works well for the choropleth maps that I make. For a separate project, I'm wanting to utilize Folium's regular (i.e., not using a ...
Will's user avatar
  • 404
0 votes
1 answer
917 views

Folium TimeSliderChoropleth with tooltip?

I have followed an online example of using Folium to create a choropleth map with a timeslider, similar to what Aoife Currano has done in this magnificent post on mapping the spread of COVID back in ...
Will's user avatar
  • 404
0 votes
0 answers
843 views

How to add a tooltip to a Folium TimeSliderChoropleth map?

I have created a choropleth map in the Python library Folium using a TimeSlider plugin, and to this map I am trying to add a tooltip so that a user can interact dynamically with underlying data. I've ...
Will's user avatar
  • 404
0 votes
1 answer
199 views

How may I retrieve the current date output from TimeSliderChoropleth (the one displayed in the slider)?

How may I retrieve the current date output from TimeSliderChoropleth? image showing current date displayed in the timeslider import folium from folium.plugins import TimeSliderChoropleth base_map ...
joaoambiente's user avatar
1 vote
1 answer
1k views

How can I access a Folium map from within JavaScript/Leaflet

I am working on a Folium map and am trying to inject parts of the leaflet/js solution suggested in this thread in my code. My map has already been initialized in Folium, so I don't want to initialize ...
JoeMount's user avatar
1 vote
1 answer
5k views

Draw a line between pairs of points with calculating the distance using Folium

I'm trying to achieve the exact transformation explained in this post. Basically, I have a pair of XY coordinates (in EPSG 2154) and by using Folium, I need to : display those points in a map draw a ...
Timeless.'s user avatar
  • 644
1 vote
1 answer
865 views

How to display xy coordinates (in some EPSG) using Folium

I want to display a point/place (somewhere in Hamilton/Bermuda) with Folium but all I get is a blank map in Jupyter-lab: import folium map = folium.Map(location = [-64.778389, 32.289978], tiles = &...
Timeless.'s user avatar
  • 644
0 votes
0 answers
429 views

How to mosaick two raster images (NDVI and NDWI) as one layer in GEE?

Main gist (question) I'm trying to mosaic NDVI and NDWI layers into one layer using GEE (python). This is for having land part of the map covered by the NDVI results and the water part of the map ...
Indigo Wizard's user avatar
2 votes
0 answers
564 views

Coinciding circle fills on Folium

I am trying to combine two circles to get something like this from here. However, I couldn't convert the solution in this post to Python. I need these circles to behave almost like one, but cannot ...
user3243944's user avatar
3 votes
1 answer
8k views

Folium draw and highlight polylines with distinct colours from unique GeoJSON

Main gist I have a unique GeoJSON file (roads.geojson) that only contains multiple polylines. Each polyline represent a road. I want to display each entity (road/polyline) from that same GeoJSON (...
Indigo Wizard's user avatar
1 vote
1 answer
2k views

How to rename the default base map tile on Folium?

I'm creating a map in the Folium library of Python. I'm also adding an additional terrain base map tile by using the following code: import folium m=folium.Map(location=[39.084916577250254,-94....
Will's user avatar
  • 404
1 vote
1 answer
115 views

Getting positional argument error

I have dataset of Covid-19 total death, cases and country name I want to add all details in map using folium model but I'm stuck. ## General Libraries for data analysis import pandas as pd import ...
Darshan bs's user avatar