Questions tagged [folium]

A Python library for producing maps with Leaflet.js

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

Does Folium support a custom map to create a route network?

I found that Folium uses OpenStreetMap to create the route. Can I use other than OSM to create a simple route? Suppose I want to create a route between two points and use the network layer I already ...
  • 1
0 votes
0 answers
13 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", &...
  • 11
0 votes
0 answers
18 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 ...
  • 11
0 votes
0 answers
20 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 ...
  • 374
0 votes
1 answer
26 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 ...
0 votes
0 answers
66 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
185 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 ...
  • 125
1 vote
1 answer
63 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 = &...
  • 125
0 votes
0 answers
75 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 ...
1 vote
0 answers
51 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 ...
0 votes
1 answer
852 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
213 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
205 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....
  • 374
0 votes
0 answers
92 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
42 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
188 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
181 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 ...
  • 11
1 vote
1 answer
451 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
518 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/...
  • 1
0 votes
1 answer
750 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
506 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 ...
  • 181
1 vote
2 answers
931 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, ...
  • 95
1 vote
0 answers
391 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 = [[...
  • 11
0 votes
0 answers
120 views

Python Folium, marker does not draw on map

I have a dataframe which is shown as follow: df X Y latitude longitude fatalCount 199 1503534.0 5139947.0 -43.88726825747297 171.799068750087 1.0 302 1764742.0 5904564.0 -36....
1 vote
1 answer
225 views

Identifying coordinate system from dataset (without using GIS software)

I've got a CSV file which I downloaded from a Waka Kotahi open data website. The file has got X,Y coordinates of locations. I am using that file in Python to generate markers in Folium. I don't have ...
1 vote
1 answer
172 views

Creating map of New Zealand with coordinates in Folium

I want to create a map of New Zealand in Folium Python. I want to show the map of New Zealand. Later on I will add the markers on the map. I started coding as follow: nz_map = folium.Map(location=(lat,...
1 vote
2 answers
337 views

Extracting points from a (FIRMS)Google Earth Engine layer in Python

My goal is to extract data from FIRMS to further analyze it in a tabular data format. How can I extract those orange marks that indicate fire? Can I output them as a CSV or a pandas dataframe? I would ...
1 vote
0 answers
149 views

Displaying polygon big data on a map with Python (Folium)

I want to plot around 90.000 polygon data (~250MB GeoJSON file) on Python. I tried to plot it with Folium, but it's really computationally heavy (CPU load and out of memory problem). I also tried to ...
0 votes
1 answer
150 views

Page becomes unresponsive

I created a html file using leaflet to add markers to leaflet map using csv data. For parsing csv data I used papaparse. I did the same thing with python folium too and saved the output to a file ...
1 vote
0 answers
350 views

Remove default OpenStreetMap tile layer in Leaflet - Folium?

I have multiple maps in my Folium map (map1 and map2) however, I see OpenStreetMap as the default option. I want to remove the OSM option altogether and keep just my two custom layers. If I set tiles ...
0 votes
1 answer
47 views

Google Earth Engine_Python code error (Post-2)

I am confused by this error. I had written it on Anaconda and I am trying to run the script on GEE. I started and closed the second parentheses but the error persists. Rectify my error as I am new to ...
's user avatar
1 vote
0 answers
312 views

Folium map not updating when adding Tooltip attribute in PyQt GUI

I am trying to create a geospatial Python GUI app using PyQT5, Geopandas, OSMnX, and Folium. I am converting the app into an .EXE file using pyinstaller. The app looks something like this: I am using ...
1 vote
0 answers
196 views

Get coordinates from Folium's feature LocateControl() in Python

I have this problem. I have this to get the information from the mobile phone from folium.plugins import LocateControl m = folium.Map() # With default settings LocateControl().Add_to(m) m and I need ...
0 votes
0 answers
124 views

Pause the folium timestampedgeojson plugin using a PyQt button

We can play the timestampedgeojson plugin over the folium map using a PyQt button but how can we pause the folium timestampedgeojson plugin using a PyQt button in PyQt GUI and without using the plugin ...
  • 1
1 vote
1 answer
447 views

Making Loop for reading multiple Rasters in python+folium

I am a newbie in programming and wanted to ask if someone could help me with example of loading/reading multiple rasters using for loop (or maybe another alternatives to deal with multiple files?). ...
  • 13
5 votes
0 answers
705 views

Controlling the visibility of a FeatureGroup in Folium with an HTML checkbox

I'm working on a project in Django where I want to show layers on a map by checking or unchecking boxes which I created using bootstrap. I am aware it is possible to use LayerControl to get these ...
1 vote
1 answer
8k views

How to fully customise LayerControl() in Folium?

I currently have a Folium map with this LayerControl component. Would it be possible to fully customise the layer control panel? For example, I would like it to not show the map style button saying &...
1 vote
1 answer
355 views

map GeoPandas dataframe with folium no results

I am trying to display on a folium map a set of polygons from a geodataframe. The code returns no errors but the polygons do not appear. I have checked the projections ('epsg:3857') and the ...
  • 85
0 votes
0 answers
1k views

Icons that do not resize in Folium

My understanding is that Folium still does not have capability to create labels for polygons. Tooltips do not work for my use-case since I can have hundreds of small polygons and I don't want users to ...
0 votes
3 answers
2k views

Fixing this error "NoneType object is not subscriptable"

Since days and days, I could not figure out this issue. I got this error 'NoneType' object is not subscriptable. lib/python3.8/site-packages/folium/features.py The problem is at this point: layer=...
  • 193
0 votes
1 answer
151 views

I want to hide WMS layer in Leaflet

I want to hide WMS layer in Leaflet. But in a condition, display again. I tried removelayer. But once It is removed, it can not add again. here is the relevant code (generated with folium): if (zoom &...
  • 327
1 vote
2 answers
584 views

Issue in displaying Folium Map inside a function call using Python

I am using the following code to display folium map: import folium map_hooray = folium.Map(location=[51.5074, 0.1278], zoom_start = 11) map_hooray Using the above code the map gets displayed ...
  • 576
4 votes
1 answer
4k views

Folium draw polygons with distinct colours

I have trouble with my assignment. I have to draw over 100 polygons from the xml file and every of them has to have other color. I don't know how to accomplish it. First I tried to draw polygons in ...
0 votes
0 answers
1k views

Plotting Landsat Image on Folium Maps

By using the following code I am trying to plot Landsat 8 RGB image onto the folium maps. Following is the code: import rasterio as rio import folium from pyproj import Transformer ## LC08 RGB Image ...
  • 576
2 votes
1 answer
1k views

Reset map zoom based on added layers in Folium

I have a folium map object that I am displaying in a notebook and adding layers to it and displaying again. So I want to update the zoom level of a map each time I add a layer based on the extent of ...
  • 1,527
1 vote
0 answers
4k views

Modify GeoJSON tooltip format when using Folium to produce a map

I am producing a map using Folium. I wish to show some data using tooltips when hovering over a country. I can do this using the folium.features.GeoJsonTooltip() function and have the following result ...
  • 111
1 vote
0 answers
313 views

Submit a form in Folium HTML Popup

In my flask application I have a folium map displayed inside an iframe. I defined a folium html popup with a form. How can I route the form? Here is my popup html code: """<!DOCTYPE ...
0 votes
1 answer
1k views

How to identify correct key_on parameter from JSON file for Folium Choropleth

I'm trying to make a Folium Choropleth map. But I'm stuck for long time on completing it. My map shows boundaries correctly, even shows legend correctly but the map is not filled with choropleth ...
1 vote
1 answer
2k views

Not getting different colors on Folium package

I am trying to plot some points on the map, where the points are marked based on geo-coordinates and each point belongs to a category. I am trying to set the color of the categories from the color ...
2 votes
1 answer
399 views

Finding nearest points based on distance and the user location and display on a Folium or Leaflet map?

I want to display the nearest services points using the distance function on the Folium map. I need to pass the user location from the form and find the nearest services based on the current location. ...