Questions tagged [folium]
A Python library for producing maps with Leaflet.js
149
questions
0
votes
0
answers
66
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/...
0
votes
0
answers
95
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 = ...
0
votes
0
answers
18
views
Geometry browser / slideshow in Folium?
Using Folium, I'd like to render the individual geometries in a GeoPandas dataframe one-by-one, like a slideshow, using next / prev buttons.
Is there a built-in way to do this?
Alternatively, is there ...
1
vote
1
answer
80
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.
...
1
vote
0
answers
106
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()
...
0
votes
0
answers
103
views
Export selected area in Leaflet Folium
I am using Folium library with Python to visualize some data (markers, polylines...) where those objects have some values in popup window. I am looking for a option to select an area (for example by ...
0
votes
0
answers
107
views
Leaflet on-click circle doesn't work in Python folium
I would like to make the Leaflet circle an on-click feature in my Python folium map.
Unfortunately, the code returns nothing despite no information from the console.
range_js = """
$(...
0
votes
0
answers
90
views
Python folium: ValueError: Marker location must be assigned when added directly to map
I am working on customizing the marker in Folium
The initial link, from where I took the approach is here:
https://github.com/python-visualization/folium/blob/main/folium/vector_layers.py#L318
now, my ...
2
votes
1
answer
123
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 = -...
0
votes
0
answers
42
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....
3
votes
1
answer
248
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-...
1
vote
1
answer
139
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/...
0
votes
0
answers
99
views
Label contour lines in a web map (folium)
I'm trying to create a HTML map in python using folium. I would like to show elevation contours as a layer on my map.
I've exported the contours to a .geojson in QGIS and imported it into my map:
f = '...
0
votes
0
answers
313
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 ...
1
vote
1
answer
365
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 ...
3
votes
1
answer
413
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 ...
0
votes
0
answers
201
views
Folium Marker-Cluster map is not visualized for a large dataset
Im trying to create a Marker-Cluster map using folium for some data, I first tried with a sample dataset where the sample size is 1000 row points, which ran fine with no error. But when im trying to ...
0
votes
1
answer
53
views
Folium: ValueError: key_on `'FIPS'` not found
I'm working on a Folium choropleth map, using a shape file 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:
...
2
votes
1
answer
380
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....
1
vote
0
answers
91
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 ...
0
votes
0
answers
70
views
Plotting an image in right location (leaflet/folium)
So, I have some civil engineering plans that I'd like to plot in a web map using folium. I tried to plot the CAD files directly by exporting them to GeoJSONs. This worked OK but a lot of information ...
1
vote
0
answers
131
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 ...
0
votes
0
answers
487
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 ...
1
vote
1
answer
562
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 ...
0
votes
1
answer
548
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 &...
0
votes
0
answers
162
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 ...
0
votes
0
answers
57
views
LatLngPopup in Gmaps in Jupyter notebook
Does gmaps support the LatLngPopup function in folium where it shows the latitude and longitude by clicking in the map?
I saw this page explaining how to do it in javascript, css and HTML, but is it ...
0
votes
1
answer
256
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 ...
0
votes
0
answers
305
views
How to add popup in a folium map matching a loop format?
I have a folium map code (python) working in a loop mode, the following code works well except that the popup insert does not work.
(database columns : "Latitude", "Longitude", &...
0
votes
0
answers
311
views
How to create folium loop for clustering visualization?
I have a dataframe composed of 3 columns latitude,longitude and cluster. It contains 4000 rows grouped in 51 clusters (0 to 50). As the dataframe represent geographic coordinates I would like to ...
0
votes
0
answers
387
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 ...
0
votes
1
answer
97
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 ...
1
vote
1
answer
428
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 ...
1
vote
1
answer
2k
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 ...
1
vote
1
answer
347
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 = &...
0
votes
0
answers
225
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 ...
2
votes
0
answers
294
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 ...
3
votes
1
answer
4k
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 (...
0
votes
0
answers
522
views
Using Folium.DivIcon to plot multiple LineStrings Length on 1 map
I have the following GeoDataFrame "melissa_segs" which is a result of an exploded Polygon and CRS is 'ESRI:102009'
poly_id
vertex_id
seg_length
geometry
0
1
103.0
LINESTRING (-1224668.715 ...
1
vote
1
answer
695
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....
0
votes
0
answers
194
views
polygon segments length as labels on folium maps
I have done this on QGIS, as shown in the screenshot, but I need the same on folium python,
I have used this answer getting length of segments of polygon
to generate the same but missing the part of ...
1
vote
1
answer
85
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 ...
0
votes
1
answer
400
views
Folium map rendering grey squares on data loaded from geopandas frame
I have a geodata frame loaded in from census data that shows the Dutch population density per 500 by 500 meter square. I am trying to load this data into an interactive map with folium and my geodata ...
1
vote
0
answers
350
views
Draw vector tiles on folium map [closed]
How can I have some vector tiles drawn on a folium map in Python? Or any other alternative to folium.
Context: I did some filtering based on some positions of map features I fetched from Mapillary and ...
1
vote
1
answer
1k
views
Column color based when plotting a GeoDataFrame with 'explore' method
I'd like to color the cities that belong to one hemisphere or another with the color specified at 'Color' column. All the cities of each hemisphere (each category) have the same value for that column. ...
0
votes
0
answers
1k
views
Saving map in folder for further use
I want to use my map for further offline calculations. I used the below code referred from ' https://gis.stackexchange.com/questions/313382/click-event-on-maps-with-folium-and-information-retrieval/...
0
votes
1
answer
1k
views
Folium and heatmap is not opening in pycharm
I'm using PyCharm version 3.7.
When I tried to open simple folium map I'm not getting any output.
I tried something like this
import folium
import pandas as pd
import csv
dataframe=pd.read_csv("...
1
vote
1
answer
1k
views
Google Earth Engine Python Folium Map Inspector
I'm calculating the Enhanced Vegetation Index (EVI) of Sentinel-2 data on Google Earth Engine's Python API, specifically in a Jupyter Notebook. I'd like to check that the calculations are producing ...
1
vote
2
answers
2k
views
Folium plot GeoJSON polygon with fill color based on custom values
I have polygons with lat/long values associated with identifiers in a GeoDataFrame as shown below. Consider an example with two identifiers A and B, polygon A has three points and B has four points, ...
1
vote
0
answers
609
views
Dynamically scale line weight in Folium (polyline or antpath)
I draw lines and ant path in folium and I need to scale width of line for example 12 km width line but I can't use simple weight because it has dynamic width that changed when zoom in or out
loc = [[...