Python Maps with ipyleaflet

Поделиться
HTML-код
  • Опубликовано: 23 окт 2024

Комментарии • 47

  • @jakesanders832
    @jakesanders832 4 года назад +4

    Spent the last 4 hours trying to plot on a US map with the help of tutorials on plotly, geopandas, folium, choropleth, and more and could get none of those to work. This is the first thing that actually works and has all the features that I need and more all explained in this video thank you!

  • @maleInsights2
    @maleInsights2 2 года назад

    Sir, you are really a teacher! I see two tutorial of yours and everything is really near to perfect and very easy to understand. Please keep up your good work, sir.

  • @rblue45
    @rblue45 4 года назад +3

    Amazing, this deserves way more likes. Thank you.

  • @gazul05
    @gazul05 Год назад +1

    Awesome tutorial... Thanks!
    Greetings from Mexico

  • @mehmethaydan
    @mehmethaydan 2 года назад +1

    Thank you Ryan, I've learnt a lot from the video. It deserves much more likes!!

  • @bassamal-kaaki3253
    @bassamal-kaaki3253 3 года назад +1

    This is an excellent video of how to use ipyleaflet. Great explanation. Thanks.

    • @RyanNoonan
      @RyanNoonan  3 года назад +1

      Glad it was helpful!

    • @bassamal-kaaki3253
      @bassamal-kaaki3253 3 года назад

      @@RyanNoonan So, when I add the hotspots on the map (circles) and try to save it only saves the map without the circles I drew! I am trying to save the whole image after I conduct the drawings. ie myMap.save. It saves the image without the circles.

    • @RyanNoonan
      @RyanNoonan  3 года назад

      I have not found an easy way to save the shapes drawn with the DrawControl feature within the notebook, only the map and ability to create new shapes, etc. after saving to html. Here are a few options: if an image is needed, screenshots are an option or after the html file is saved, the map can be saved as a pdf with the map and shapes, but perhaps the best option would be to use folium because it has an export option for the draw control (exports shapes as a geojson layer).

    • @bassamal-kaaki3253
      @bassamal-kaaki3253 3 года назад

      @@RyanNoonan I will try folium. I read some stuff about it. Thanks for the insights.

    • @RyanNoonan
      @RyanNoonan  3 года назад

      Sounds good. I like to use folium for somethings and ipyleaflet for others. ipyleaflet seems to have more options for interactivity (callbacks, etc.) and folium has some options that don't seem to be available in ipyleaflet. Both are great, but have slightly different options.

  • @errissyarasywir2859
    @errissyarasywir2859 2 года назад +1

    Good explanation. Thank you sir

  • @beresteanu1
    @beresteanu1 5 лет назад +1

    Amazing video. Thank you.

  • @scottphillpott8709
    @scottphillpott8709 4 года назад +1

    Well done! Thank you.

  • @Joueswant
    @Joueswant 5 лет назад

    Hello Ryan, thanks a lot for your video! Is there a way to download your jupyter notebooks displayed in the tutorial?
    Best!

    • @RyanNoonan
      @RyanNoonan  5 лет назад +1

      Not currently, but at some point in time, I do plan to put the notebooks somewhere for download/sharing, etc. Thanks

    • @Joueswant
      @Joueswant 5 лет назад

      @@RyanNoonan Thanks for the answer, I will look for more of your amazing videos

    • @RyanNoonan
      @RyanNoonan  5 лет назад +1

      I added the ipyleaflet jupyter notebook to github - please see link in tutorial description above.

    • @Joueswant
      @Joueswant 5 лет назад

      @@RyanNoonan thanks a lot; i'll check them for sure

  • @mdahsan897
    @mdahsan897 3 года назад

    How to pass 2 map in splitmap for right_layer and left_layer

  • @alexanderrubioanasco5352
    @alexanderrubioanasco5352 4 года назад

    amazing Ryan, thanks a lot for your video!
    i have problem with a new event, i need to show markers inside of radius on my main circle.
    How to show markers only inside of radius (circle) on maps?

    • @RyanNoonan
      @RyanNoonan  4 года назад

      Below is an example:
      from ipyleaflet import Map, Marker, Circle
      latlng = [38.945749, -104.569893]
      # create map
      m = Map(center=latlng)
      # circle
      circle = Circle(location=latlng, radius=5000, color='green', fill_color='green')
      m.add_layer(circle)
      # marker
      marker = Marker(location=latlng, title='marker', draggable=False)
      m.add_layer(marker)
      # display map
      m

  • @mohamedasma8949
    @mohamedasma8949 3 года назад

    i need to do the same thing but in desktop / how to do this

  • @youkuya
    @youkuya 5 лет назад

    Could you confirm that routing and waypoints be done with ipyleaflet as it can with leaflet?

    • @RyanNoonan
      @RyanNoonan  5 лет назад

      I am not positive but I don't think those plugins are available yet in ipyleaflet or folium.

  • @nidhijasoliya2871
    @nidhijasoliya2871 4 года назад

    How can we export the interactive map as an html file?

    • @RyanNoonan
      @RyanNoonan  4 года назад

      Try ipyleaflet_map.save('my_map.html', title='My Map') however this might not provide fully interactive maps.
      For more options, ipyleaflet can be used with Voilà.

  • @gill24
    @gill24 5 лет назад

    How can we change the location markers with custom shapes?

    • @RyanNoonan
      @RyanNoonan  5 лет назад +1

      Below is an example from the ipyleaflet documentation using "Icon". Notice Icon takes icon_url, so some kind of resource for custom map icons (urls) would work.
      from ipyleaflet import Marker, Icon, Map
      center = (52.204793, 360.121558)
      m = Map(center=center, zoom=10)
      icon = Icon(icon_url='put in your custom icon url', icon_size=[38, 95], icon_anchor=[22,94])
      mark = Marker(location=center, icon=icon, rotation_angle=90, rotation_origin='22px 94px')
      m.add_layer(mark)
      m

    • @gill24
      @gill24 5 лет назад +1

      @@RyanNoonan thanks. This is really helpful

  • @newtonkanyau6036
    @newtonkanyau6036 4 года назад

    Hi...is it possible to use ipyleaflet on pycharm IDE

    • @RyanNoonan
      @RyanNoonan  4 года назад

      I have only used PyCharm a couple times but I think there might be Jupyter Notebook integration / a plugin available.

    • @mohamedasma8949
      @mohamedasma8949 3 года назад

      @@RyanNoonan how to use it with spyder ? i code with Tkinter
      and how to have a jupyter integration ????
      please help me pleaaaase

    • @RyanNoonan
      @RyanNoonan  3 года назад +1

      @mohamed asma
      There is a package called spyder-notebook that provides Jupyter notebook integration with Spyder. Visit the python package index and search for spyder-notebook for more information. I used the Anaconda Navigator to install the package into an environment, then opened Spyder using that environment, clicked the notebook tab at the bottom. I tried it with some matplotlib and seaborn plots and it works but when I tried to create maps, the maps would not display.
      Another option is to save the maps to the desktop as an html file from Spyder, then open.
      folium_map.save(‘path/folium_map.html')
      ipyleaflet_map.save(‘path/ipyleaflet_map.html')

    • @mohamedasma8949
      @mohamedasma8949 3 года назад

      @@RyanNoonan thank you so much i will try this

  • @kevinadrianhalim6335
    @kevinadrianhalim6335 4 года назад

    KeyError: 'NAME_L'. what happned? any solution?

    • @RyanNoonan
      @RyanNoonan  4 года назад

      If using the example on GitHub for the choropleth map, use the geojson_indiana_counties.geojson file, otherwise add and/or find the name used in your geojson file. See ipyleaflet documentation for additional choropleth map examples.

  • @TheFuriousShovel
    @TheFuriousShovel 4 года назад

    Is there a way to add a legend to ipyleaflet?

    • @RyanNoonan
      @RyanNoonan  4 года назад

      ipyleaflet can be used with ipywidgets to create different types of legends (colormaps, text, etc.) or you could try the ipyleaflet-legend module on the python package index.

  • @meliksahtolunaygurcu3100
    @meliksahtolunaygurcu3100 5 лет назад

    Hi ;
    Is there any way to add this map as widget
    to pyqt5.
    Thanks

    • @emirhankahraman5241
      @emirhankahraman5241 4 года назад

      You can look at pyqtlet library

    • @mohamedasma8949
      @mohamedasma8949 3 года назад

      did you find a way???

    • @mohamedasma8949
      @mohamedasma8949 3 года назад

      @@emirhankahraman5241 i look for a way to add it with Tkinter

    • @RyanNoonan
      @RyanNoonan  3 года назад +1

      I found a way to get this to work using folium and PyQt5. There is a stackoverflow post with a solution. Search for How to show Folium map inside a PyQt5 GUI?. ipyleaflet might be used outside a notebook but is mostly suited for notebooks.