If you are having any problems using the geocoder module with osm, for example, you might try another service with the module such as Bing with an API key, etc.
I just completed a four week intro to python programming. I struggled to create the markers for the folium map, so had a bit of help from my instructor, but was able to make the heatmap by myself!! Thanks so much Ryan for the tutorial!!
My dude!! This is by far the best video displaying how powerful folium and other packages are! Your examples are simplistic and really effective. You took a big portion of my questions and answered them in 30 minutes! 🌟🌟🌟🌟🌟🌟💯💯💯💯💥💥💥💥💥😎😎😎😎😎
You put every ugly parts of the map making in such an easy and to the point. I have visited materials in this regard no one of them was as simple and resize as this one. Thanks and, Keep up the good work bro!
Hi thank you very much. When i use DrawControl() and heat save button, no json file created or saved. This feature work some week age but for to reason it stopped working. shoul i do anything special?
Great video. I wonder if you can help me. I have many multipoligons from diferent animal species. Some one are from diferents places and some ones are overlap. I am trying to make a Popoup map, that when I click, the pop up read all layers and give the species that can be find on the click region. Can you help me?
Thank you very much for the video! It's been really useful. But I have one question yet. Is it possible to integrate and show this maps on a tkinter frame, or in any other GUI library?
This is a great video! It helped me understand folium a bit better. I'm trying to make a choropleth map for a project and I am stuck on the folium.Choropleth portion. This is the error I get TypeError: attribute of type 'str' is not callable It has the red line on the highlight=True argument. Not matter at what argument I stop, it always highlights the last one with that same error. Not sure how I can address this. Any tips on what to look out for? Edit: Nevermind, I just figured it out after re-watching the video. My data argument was wrong!
When I do what you do at 4:33, the map becomes all grey. No error messages are returned. The only one that appears normally is "Open Street Map". What do I do?
I have not run into this issue. I just downloaded the Jupyter notebook I posted to GitHub for this tutorial, ran the code in a colab environment and it worked fine. Have you tried the code in another notebook environment such as Jupyter on your local machine? Do the other maps render in the layer control example (example below the ipywidgets example)? Note that for JupyterLab, it might require an extension to use ipywidgets. Some other suggestions - maybe try a different browser, or restart the notebook, or double check the code. Let me know if any of those suggestions help.
I spent 2 weeks to get this video. Really awesome. Thanks for sharing your knowledge. i have one question. Can i create the polygon or grid based on the data (ex: Population, Salary of the people in specific region, Censes consider that i have the data) . What is the best approach i can consider to start implement this? Could you please share some tips. Awaiting your response.
Selenium is an option but again, as EPSG of Folium is 4326 n if you want to save it along with a world file, then it is a real pain; honestly, I don’t know the solution yet but it is mandatory if you want it to be in the right projection as QGIS map layout does it automatically when you export it as a PNG.
Simply awesome ... very clear, top-level explanation and excellent examples. I however did have some trouble with the VegaLite package: vega = folium.features.VegaLite(sw_bar, width='100%', height='100%') NameError: name 'sw_bar' is not defined
Thanks. altair/VegaLite can be tricky however the error message seems to indicate that the cell with sw_bar has not been run possibly because the package(s) have not been completely installed. I cannot tell you exactly how to fix but I can give some tips to help. Make sure altair and vega have been installed. You may need to use jupyter nbextension enable or install... in the terminal with vega. Check your renderer (altair.renderers.enable...). Check the altair documentation for details on nbextension and renderers. I use the anaconda package environment to manage the packages. After everything is installed and set-up - you may need to close everything and restart/reopen, etc.
@@RyanNoonan Thanks for that clarification and making the effort. I think closing down and re-running resolved this issue for me. What I personally would really appreciate is another clear tutorial about the differences between matplotlib, folium, plotly and leaflet, with some examples of where each of them shine to help guid me through the library zoo. At this point I've gone with folium, in part thanks to your very clear video, but feel that perhaps plotly would be the more powerful and "most up-to-date".
Hi Ryan. First of all, thank you for this material... honestly helped me so much and it`s the project that I think can change my life because of the project I'm driving based on it inside my company. I`d like to ask you a question. While I`m creating the markers if I add a popup or a tooltip in addition to the icon the maps just stop to show up... have you already overcome this issue?
Thanks. I have not experienced this issue. Maybe the code examples will help. The link for the Jupyter notebook code examples on GitHub is in the tutorial description.
Great tutorial Ryan, thanks for sharing! As I would like to create a map with around 15 different layers and options to switch them on and off, I am worried how well does Folium handles big datasets? Some shapefiles I have are around 40mb. Would the rendering performance improve if I would host this map/app in the cloud? Thanks
I will try to look into this. Large datasets will probably slow things down. Have you explored Datashader? It works well with very large datasets. At some point, I plan to do a tutorial. Not sure if Datashader would meet your needs but it might be an option.
Thanks. Nice video. A small question, If we have 2 values (say Yes, No) across the same latitude and longitude values, how can we display the 2 in different colours at the same location? I have tried to do so, but it is displaying the first value only. Thanks. Looking forward for a solution.
If 2 markers are at the same exact location, only one will be seen and the other is underneath the marker on top. Set the Marker argument draggable=True, drag the top marker over and you can see there are 2 markers there. Maybe you could offset one marker just slightly so both markers can be seen.
I have a Jupyter Notebook on github with some code that might help. The link is in the tutorial notes. Look for the link next to folium jupyter notebook toggle marker groups.
hii @Ryan need a help How to plot a individual geolocation map using CSV file having 2 rows of value ,lat and long iterate over each coordinate and save it in a file I am having a csv file having 2 rows of value long and lat as heading. now i want to plot a map of each location one by one and would like to save it as an image or html file. right now i am able to plot all location over a single frame using all lat and long value stored in csv file . as you had done in this video, and i am also able to store it in directory but with all location in a single html file.
@@RyanNoonan Yes, I enabled the collapse of the LayerControl element immediately after reading the documentation, my question is different. Is it possible to collapse layer groups inside Layer Control itself, as shown here: github.com/ismyrnow/leaflet-groupedlayercontrol/pull/46
Hi Ryan, thank you very much for the amazing tutorial, really! I am trying to add the following functionality on folium maps for a long time now: 'On clicking a normal marker, the map displays a circle marker around that normal marker. On clicking it again, it should go off'. I tried the similar code you used to add vega to the popup. I added a circle marker to the popup of my normal marker but it doesn't seem to work out. Can you please tell me if its possible on folium or do i have to use shift to core JS for just adding this functionality in my project. Thank you for your time. Look forward to your inferences on that.
@@RyanNoonan Thank-you Ryan. In that case, i will go through your tutorials on ipyleaflet and ipywidgets as well. And then come to back you updated whether I am able to achieve it. Thank you for your reply. I wish the best for you.
Sounds good. Note that the use of ipyleaflet callbacks such as on_click can be a little tricky and callback function arguments have to be set a certain way. Also, it took me a while to figure out a good test for if markers are on the screen or not to set up the option to click the marker and have a radius circle appear and then be removed. I do plan to do a ipyleaflet part 2 tutorial soon on callbacks / handlers / observers, etc. Let me know if there are other callback function scenarios you would be interested in (i.e.-click event or hover event activates function to accomplish some task, etc.).
Hi Ryan, I was able to solve my purpose by using a ground overlay image around the marker co-ordinates. For that,I put a set of ground overlay images on the layer control bar and whenever i want to display them around my marker, i simply select the respective image layer and de-select them when i don't want them. However, it's just a work-around. It would be great if you get make a tutorial on click events that would help us in: 1. Displaying something on a map (in my case a ground overlay image) as we left click on the marker. And remove it as we left click again. 2. Display something on map (in my case details about the marker) as we right click on the marker. (This can be accomplished using a popup, but popup comes up on right click). 3. Another click functionality on click events that i wish if you could introduce is: If we turn a separate mode on map (by using ipywidget perhaps) if i want to select ten out of 100 markers of my choice that are there on map. Then as I would press the 'Ctrl' key on key-board, then all the markers that i click while 'Ctrl' key is pressed get downloaded with their lat/long info. And all that we can do with clicks and key board. Ryan, your tutorials are literally very very helpful for making my project! Your explanations are just amazing. It would great if you make a tutorial on click-events whenever you find time.
hi I am getting this error on line df.apply(lambda row:folium.Marker(location=[row['LAT(x)'],row['LONG(y)']]).add_to(map2),axis=1) maximum recursion depth exceeded in comparison
I'm trying to create a heatmap and I'm following your instructions but it always seems to be based off the lat, lon and not the weight value. The closer the lat,lon positions the denser the colors. I see the same issue on Stackoverflow but no solution.
@@RyanNoonan Hi Ryan, So after playing around with the code I find the weight value does have an effect on the map, it just doesn't feel noticeable. I was able to adjust the size using CircleMarkerby using this code: for index, row in df.iterrows(): fl.CircleMarker(location=(row["LATITUDE"], row["LONGITUDE"]), radius= row['MG_L_WATER'], color="#007849", popup=row['NAME'], fill=False).add_to(m) I can adjust the size of the circles this way but now I'm trying to do the same with HeatMap(). I 'm still working on it. Any suggestions will be helpful. Helpful video BTW.
Try to adjust the values for the following HeatMap arguments: min_opacity, max_zoom, max_val, radius, blur (run plugins.HeatMap? in a notebook cell to see defaults). Also, you could rescale your data values (weights) by dividing or multiplying by a number or even give different values different weights to create different effects.
I am having a problem while using AntPath :-- AttributeError: module 'folium.plugins' has no attribute 'antpath' i have installed the latest version of folium and in folium directory their is antpath.py but still it is giving this error plzzzzzz help!!!
I'm not able to use the apply method to plot markers on the map, it says, 'DataFrame object has no attribute 'apply'. Can someone help me out with this?
Hey men, I it amazing the way you do it. You are a pro. Thanks for the video. Please reply this would be even better for me. Thanks Is it possible to save the map in HTML with layers? Can I put the layer inside the map?
Amazing !! Truly thankful to you. ! Can you tell me how to create popup labels with hover effect ? You can provide me some link or something. Thank You
My first thought - one option might be to try and join/combine the dataframes together into one dataframe based on some common element or ID. Can you provide an example?
@@RyanNoonan its not much. just the basics. I haven't done the rest. got an error initially itself. I tried adding all the packages. but nothing happened. i'm running this in pycharm with venv of that's any help import folium from folium import plugins import os import ipywidgets import geocoder import geopy import numpy as np import pandas as pd from vega_datasets import data as vds folium.Marker m=folium.Map(location=[234,243],zoom_start=23) stop_data = os.path.join('data files', 'OTRAIN-STOPS.csv') stop_data.apply(lambda row: folium.Marker(location=[row['stop_lat'],row['stop_lon']],popup=row['stop_name']).add_to(m),axis=1) m.save('m3.html')
I see a few things that might cause an error but it might be easiest if you check out the code examples I have created and posted on GitHub. The links for these Jupyter Notebooks are in the tutorial description and there are many examples showing how to create maps with multiple markers. If you are using csv data it might be a good idea to pull the data in using pandas to create a dataframe. Also, if the maps won't render in PyCharm make sure you have the necessary add-ons/plug-ins (i.e.-Jupyter Notebook plug-in) or similar or save to html or open with browser, etc. or use a Jupyter Notebook environment.
Hi Ryan, could you help me please, I'm new in this but I try to practice in Jupyter, I have a shapefile call "nep_districts" type "geopandas.geodataframe.GeoDataFrame" with variables like district, geometry, area, population. How can I save into shp?. Thanks in advance, grettings from Perú
Are you trying to use a shapefile to create a folium map? A couple options include converting the shapefile to geojson however this can be tricky. Shapefiles can also be used directly in QGIS. QGIS supports Python. Another possible option is to try to plot shapefiles with cartopy and folium.
@@RyanNoonan I wanted to plot my shp and I made it. Is it possible to visualize my variables like population in each polygone of my map. Any tips or help would be really appreciated.
i have a little problem please anyone hrlp / I wonna create a desktop app with python . so how to show map in my interface and plot the file.shp .xhp .prj .dbf //// i wonna show the roads / please help
Are you using a GUI package? PyQt, Tkinter, wxPython, PySide, etc.? Some of the GUI packages are better for certain things. For folium, you might have luck with PyQt. I have not tried to plot a shapefile using a GUI package yet but if I do, I’ll let you know.
Examples in tutorial are on GitHub. See tutorial description. If you want to save a map, see example below: import folium m = folium.Map(location=[39.739192, -104.990337], zoom_start=8) # change path to your path m.save('path/map.html')
If you are having any problems using the geocoder module with osm, for example, you might try another service with the module such as Bing with an API key, etc.
I am facing this error '__init__() got an unexpected keyword argument 'tooltip' pls help
api for desktop app ???
use nominatim or photon, no API key needed
I'm live in Japan. Thanks for detail explanations.
You are welcome!
I can't thank you enough for sharing this content with the world! A big thank you from NYC
Exceptional. You just jumpstarted me from level zero to pro. Truly grateful, live long for us
Subject aside, without a doubt one of the best tutorials online. Clear, concise instructions and code.
Very appreciated. Thanks.
This is amazing! If I only I knew about this sooner. Would definitely implement it in my next map-based project.
I just completed a four week intro to python programming. I struggled to create the markers for the folium map, so had a bit of help from my instructor, but was able to make the heatmap by myself!! Thanks so much Ryan for the tutorial!!
My dude!! This is by far the best video displaying how powerful folium and other packages are! Your examples are simplistic and really effective. You took a big portion of my questions and answered them in 30 minutes!
🌟🌟🌟🌟🌟🌟💯💯💯💯💥💥💥💥💥😎😎😎😎😎
I appreciate that!
Just what i wanted
Thanks!
Welcome!
You put every ugly parts of the map making in such an easy and to the point. I have visited materials in this regard no one of them was as simple and resize as this one. Thanks and, Keep up the good work bro!
You are such a life saver! Thank you for the tutorial on Folium, it went a long long way!
Excellent job and such a wealth of material!
Thanks
Excellent tutorial, thanks! It shows many features of this amazing library that I did not know yet.
Glad you enjoyed it. Thanks.
Wonderful tutorial... Congratulations!
THANKS i don't need to read boring documentation anymore
Thanks, great intro video with plenty of ideas!
Glad you liked it!
This is an incredible video! Very well done.
Thank you very much!
Hi thank you very much. When i use DrawControl() and heat save button, no json file created or saved. This feature work some week age but for to reason it stopped working. shoul i do anything special?
This tutorial is very useful for me.
Thank you so much for make this wonderful video.
Glad it was helpful!
Wow, thank you so much for sharing. I am on day 2 of working on geojson files and this was amazing. So informative! Thank you!
Greetings from Pakistan. Great Tutorial. Excellent and easy explanation.
Awesome!, Just what I need it in a very compact video! Thank you so much!
Love your efficiency and accuracy!!!! Thank you!
This is amazing ! Thank you so much for sharing this !
You're so welcome!
Great video. I wonder if you can help me. I have many multipoligons from diferent animal species. Some one are from diferents places and some ones are overlap. I am trying to make a Popoup map, that when I click, the pop up read all layers and give the species that can be find on the click region. Can you help me?
thankyou for sharing knowledge. love from india !
Great Tutorial, just made my project look super cool, thank you.
Glad it helped!
Thank you very much for the video! It's been really useful. But I have one question yet. Is it possible to integrate and show this maps on a tkinter frame, or in any other GUI library?
thank you, this very easy to understand, and comprehensif. God Bless You, hope you stayhealthy and wealthy. Thank you again
This is a great video! It helped me understand folium a bit better.
I'm trying to make a choropleth map for a project and I am stuck on the folium.Choropleth portion. This is the error I get
TypeError: attribute of type 'str' is not callable
It has the red line on the highlight=True argument. Not matter at what argument I stop, it always highlights the last one with that same error. Not sure how I can address this. Any tips on what to look out for?
Edit: Nevermind, I just figured it out after re-watching the video. My data argument was wrong!
I love this tutorial!!!! Thank you so much Ryan!!!
When I do what you do at 4:33, the map becomes all grey. No error messages are returned. The only one that appears normally is "Open Street Map". What do I do?
I am using colab. And it's the same code you are using.
I have not run into this issue. I just downloaded the Jupyter notebook I posted to GitHub for this tutorial, ran the code in a colab environment and it worked fine. Have you tried the code in another notebook environment such as Jupyter on your local machine? Do the other maps render in the layer control example (example below the ipywidgets example)? Note that for JupyterLab, it might require an extension to use ipywidgets. Some other suggestions - maybe try a different browser, or restart the notebook, or double check the code. Let me know if any of those suggestions help.
Thank you so much !!. Your work is absolutely amazing.
Many thanks!
fantastic! thank you for your information
Glad it was helpful!
Nice tutorial! Thanks a lot Ryan!
I spent 2 weeks to get this video. Really awesome. Thanks for sharing your knowledge. i have one question.
Can i create the polygon or grid based on the data (ex: Population, Salary of the people in specific region, Censes consider that i have the data) . What is the best approach i can consider to start implement this? Could you please share some tips. Awaiting your response.
Very good !! Tks !!
Where do I go to find the lat/lng boundaries? I've tried googling this question and haven't had any luck. Thanks for your help!
Can you provide more details on what you are trying to accomplish?
Hi Ryan, it is very well explained, thank you. Can you please guide that how to save these maps as JPG or Png?
Selenium is an option but again, as EPSG of Folium is 4326 n if you want to save it along with a world file, then it is a real pain; honestly, I don’t know the solution yet but it is mandatory if you want it to be in the right projection as QGIS map layout does it automatically when you export it as a PNG.
Can I control layer from flask. For example after generating map just clicking a button on webpage to add new choropleth map
Thanks so much for this video! Keep up the great work
Thanks you are the best ,How can I add the filter and search feature and can I sort by cities on the map (markercluster)?
is it possible to do in a regular vs code and not jupyter or does this only work with jupyter?
Simply awesome ... very clear, top-level explanation and excellent examples. I however did have some trouble with the VegaLite package:
vega = folium.features.VegaLite(sw_bar, width='100%', height='100%')
NameError: name 'sw_bar' is not defined
Thanks.
altair/VegaLite can be tricky however the error message seems to indicate that the cell with sw_bar has not been run possibly because the package(s) have not been completely installed. I cannot tell you exactly how to fix but I can give some tips to help. Make sure altair and vega have been installed. You may need to use jupyter nbextension enable or install... in the terminal with vega. Check your renderer (altair.renderers.enable...). Check the altair documentation for details on nbextension and renderers. I use the anaconda package environment to manage the packages. After everything is installed and set-up - you may need to close everything and restart/reopen, etc.
@@RyanNoonan Thanks for that clarification and making the effort. I think closing down and re-running resolved this issue for me.
What I personally would really appreciate is another clear tutorial about the differences between matplotlib, folium, plotly and leaflet, with some examples of where each of them shine to help guid me through the library zoo. At this point I've gone with folium, in part thanks to your very clear video, but feel that perhaps plotly would be the more powerful and "most up-to-date".
Hi Ryan.
First of all, thank you for this material... honestly helped me so much and it`s the project that I think can change my life because of the project I'm driving based on it inside my company.
I`d like to ask you a question. While I`m creating the markers if I add a popup or a tooltip in addition to the icon the maps just stop to show up... have you already overcome this issue?
Thanks. I have not experienced this issue. Maybe the code examples will help. The link for the Jupyter notebook code examples on GitHub is in the tutorial description.
Very well explained! Thank you so much. Subbed!
Really Nice piece of work!
now you mentioned "colab". i could not get the heatmaptime slider to appear there. is this a known issue?
Thank you very much Ryan.
Sure thing!
hi...i created a button popup for a folium map location.. for every button click, how can i get the location name for another html page
Thank you very much!
Welcome!
thx Mr Ryan.
Welcome!
Great tutorial Ryan, thanks for sharing! As I would like to create a map with around 15 different layers and options to switch them on and off, I am worried how well does Folium handles big datasets? Some shapefiles I have are around 40mb. Would the rendering performance improve if I would host this map/app in the cloud?
Thanks
I will try to look into this. Large datasets will probably slow things down. Have you explored Datashader? It works well with very large datasets. At some point, I plan to do a tutorial. Not sure if Datashader would meet your needs but it might be an option.
@@RyanNoonan Thanks for quick response. Will have a look, that might be a good option.
Amazing tut !!
Which software should I download for this?
Thanks. Nice video. A small question, If we have 2 values (say Yes, No) across the same latitude and longitude values, how can we display the 2 in different colours at the same location? I have tried to do so, but it is displaying the first value only. Thanks. Looking forward for a solution.
If 2 markers are at the same exact location, only one will be seen and the other is underneath the marker on top. Set the Marker argument draggable=True, drag the top marker over and you can see there are 2 markers there. Maybe you could offset one marker just slightly so both markers can be seen.
@@RyanNoonan Thanks that worked.
How do you put a marker in the map by clicking on a map location?
Thank you for the video Ryan. Do you know of a way to layer groups of markers, in order to toggle them on and off?
kind regards
I have a Jupyter Notebook on github with some code that might help. The link is in the tutorial notes. Look for the link next to folium jupyter notebook toggle marker groups.
God grant you health, mate!
hii @Ryan
need a help
How to plot a individual geolocation map using CSV file having 2 rows of value ,lat and long iterate over each coordinate and save it in a file
I am having a csv file having 2 rows of value long and lat as heading. now i want to plot a map of each location one by one and would like to save it as an image or html file.
right now i am able to plot all location over a single frame using all lat and long value stored in csv file . as you had done in this video,
and i am also able to store it in directory but with all location in a single html file.
Thank you for your detailed explanation. Is it possible to collapse the items in the group legend?
Example below is an option:
folium.LayerControl(collapsed=True).add_to(map)
@@RyanNoonan Yes, I enabled the collapse of the LayerControl element immediately after reading the documentation, my question is different. Is it possible to collapse layer groups inside Layer Control itself, as shown here:
github.com/ismyrnow/leaflet-groupedlayercontrol/pull/46
I'll look for a way. A possible work around option is to create a layer control widget using ipywidgets or panel.
Also what is the code to read in the raster image?
Great 👍
Thank you 👍
Hello, how do i convert northings and eastings to latitude and longitude
Hi Ryan, thank you very much for the amazing tutorial, really!
I am trying to add the following functionality on folium maps for a long time now:
'On clicking a normal marker, the map displays a circle marker around that normal marker. On clicking it again, it should go off'.
I tried the similar code you used to add vega to the popup. I added a circle marker to the popup of my normal marker but it doesn't seem to work out. Can you please tell me if its possible on folium or do i have to use shift to core JS for just adding this functionality in my project.
Thank you for your time. Look forward to your inferences on that.
I know how to do this with ipyleaflet. Let me know if that would be of interest.
@@RyanNoonan Thank-you Ryan. In that case, i will go through your tutorials on ipyleaflet and ipywidgets as well. And then come to back you updated whether I am able to achieve it.
Thank you for your reply. I wish the best for you.
Sounds good. Note that the use of ipyleaflet callbacks such as on_click can be a little tricky and callback function arguments have to be set a certain way. Also, it took me a while to figure out a good test for if markers are on the screen or not to set up the option to click the marker and have a radius circle appear and then be removed. I do plan to do a ipyleaflet part 2 tutorial soon on callbacks / handlers / observers, etc. Let me know if there are other callback function scenarios you would be interested in (i.e.-click event or hover event activates function to accomplish some task, etc.).
@@RyanNoonan Sure Ryan, i will update you by this weekend. Thanks!
Hi Ryan, I was able to solve my purpose by using a ground overlay image around the marker co-ordinates. For that,I put a set of ground overlay images on the layer control bar and whenever i want to display them around my marker, i simply select the respective image layer and de-select them when i don't want them.
However, it's just a work-around. It would be great if you get make a tutorial on click events that would help us in:
1. Displaying something on a map (in my case a ground overlay image) as we left click on the marker. And remove it as we left click again.
2. Display something on map (in my case details about the marker) as we right click on the marker. (This can be accomplished using a popup, but popup comes up on right click).
3. Another click functionality on click events that i wish if you could introduce is: If we turn a separate mode on map (by using ipywidget perhaps) if i want to select ten out of 100 markers of my choice that are there on map. Then as I would press the 'Ctrl' key on key-board, then all the markers that i click while 'Ctrl' key is pressed get downloaded with their lat/long info.
And all that we can do with clicks and key board.
Ryan, your tutorials are literally very very helpful for making my project! Your explanations are just amazing. It would great if you make a tutorial on click-events whenever you find time.
hi I am getting this error on line df.apply(lambda row:folium.Marker(location=[row['LAT(x)'],row['LONG(y)']]).add_to(map2),axis=1)
maximum recursion depth exceeded in comparison
Maybe the data has strings that should be floats (lat/long coordinates) and/or there are missing values (none, nan, etc.).
Beautifull work! Thank's!!
This is amazing! Thank you for sharing.
My pleasure!
I'm trying to create a heatmap and I'm following your instructions but it always seems to be based off the lat, lon and not the weight value.
The closer the lat,lon positions the denser the colors. I see the same issue on Stackoverflow but no solution.
Can you share an example so I can see the code?
@@RyanNoonan Hi Ryan,
So after playing around with the code I find the weight value does have an effect on the map, it just doesn't feel noticeable.
I was able to adjust the size using CircleMarkerby using this code:
for index, row in df.iterrows():
fl.CircleMarker(location=(row["LATITUDE"],
row["LONGITUDE"]),
radius= row['MG_L_WATER'],
color="#007849",
popup=row['NAME'],
fill=False).add_to(m)
I can adjust the size of the circles this way but now I'm trying to do the same with HeatMap().
I 'm still working on it. Any suggestions will be helpful.
Helpful video BTW.
Try to adjust the values for the following HeatMap arguments: min_opacity, max_zoom, max_val, radius, blur (run plugins.HeatMap? in a notebook cell to see defaults). Also, you could rescale your data values (weights) by dividing or multiplying by a number or even give different values different weights to create different effects.
How do I use bing maps instead of geocoder?
I am having a problem while using AntPath :-- AttributeError: module 'folium.plugins' has no attribute 'antpath'
i have installed the latest version of folium and in folium directory their is antpath.py but still it is giving this error
plzzzzzz help!!!
Like it.!!
Thanks!
I'm not able to use the apply method to plot markers on the map, it says, 'DataFrame object has no attribute 'apply'. Can someone help me out with this?
Please share the code you are using that is causing the error.
Thanks
Hey men, I it amazing the way you do it. You are a pro. Thanks for the video. Please reply this would be even better for me. Thanks
Is it possible to save the map in HTML with layers? Can I put the layer inside the map?
Thanks.
Yes, this should work for most maps:
folium_map.save('path/folium_map.html')
AWesome
Amazing !! Truly thankful to you. !
Can you tell me how to create popup labels with hover effect ? You can provide me some link or something.
Thank You
thanks for awesome Tutorial, how can use several dataframe in a same Map?
My first thought - one option might be to try and join/combine the dataframes together into one dataframe based on some common element or ID. Can you provide an example?
@@RyanNoonan Thank you Ryan,i founded a solution
can we not create actual route rather than straight line path
See my tutorial on openrouteservice. It might help.
AttributeError: 'str' object has no attribute 'Apply'
i'm getting this error while trying to get multiple markers
Please share the code and I'll try to help.
@@RyanNoonan its not much. just the basics. I haven't done the rest. got an error initially itself. I tried adding all the packages. but nothing happened.
i'm running this in pycharm with venv of that's any help
import folium
from folium import plugins
import os
import ipywidgets
import geocoder
import geopy
import numpy as np
import pandas as pd
from vega_datasets import data as vds
folium.Marker
m=folium.Map(location=[234,243],zoom_start=23)
stop_data = os.path.join('data files', 'OTRAIN-STOPS.csv')
stop_data.apply(lambda row: folium.Marker(location=[row['stop_lat'],row['stop_lon']],popup=row['stop_name']).add_to(m),axis=1)
m.save('m3.html')
I see a few things that might cause an error but it might be easiest if you check out the code examples I have created and posted on GitHub. The links for these Jupyter Notebooks are in the tutorial description and there are many examples showing how to create maps with multiple markers. If you are using csv data it might be a good idea to pull the data in using pandas to create a dataframe. Also, if the maps won't render in PyCharm make sure you have the necessary add-ons/plug-ins (i.e.-Jupyter Notebook plug-in) or similar or save to html or open with browser, etc. or use a Jupyter Notebook environment.
How to see one continent only once in the map
i draw a polygons i want save this polygons in postgis db. How should do ?
Could you also share your Ipyleaflet notebook on github?
Thanks and great content!
I added the ipyleaflet jupyter notebook to github - see link in tutorial description. Thanks
Thanks a lot sir....
Most welcome
Hi Ryan, could you help me please, I'm new in this but I try to practice in Jupyter, I have a shapefile call "nep_districts" type "geopandas.geodataframe.GeoDataFrame" with variables like district, geometry, area, population. How can I save into shp?. Thanks in advance, grettings from Perú
Are you trying to use a shapefile to create a folium map?
A couple options include converting the shapefile to geojson however this can be tricky. Shapefiles can also be used directly in QGIS. QGIS supports Python. Another possible option is to try to plot shapefiles with cartopy and folium.
@@RyanNoonan I wanted to plot my shp and I made it. Is it possible to visualize my variables like population in each polygone of my map. Any tips or help would be really appreciated.
Ideally you would have a file or files with data including geometry and values and then you could create a choropleth map or a heat map, etc.
i have a little problem please anyone hrlp / I wonna create a desktop app with python . so how to show map in my interface and plot the file.shp .xhp .prj .dbf //// i wonna show the roads / please help
Are you using a GUI package? PyQt, Tkinter, wxPython, PySide, etc.? Some of the GUI packages are better for certain things. For folium, you might have luck with PyQt. I have not tried to plot a shapefile using a GUI package yet but if I do, I’ll let you know.
@@RyanNoonan i use Tkinter 💔
Hi! How i can remove a custom marker?
Great video bro
Am I the only person who can't use folium plugins?
I try to import plugins on googlecolabs with "from folium import plugins" and it never works
use from folium import plugins and then just use plugins.something
how to dowload the created maps ?
Examples in tutorial are on GitHub. See tutorial description.
If you want to save a map, see example below:
import folium
m = folium.Map(location=[39.739192, -104.990337], zoom_start=8)
# change path to your path
m.save('path/map.html')