How to Make Interactive Maps with Python - Scatter Mapbox Example with Plotly and OpenStreetMap

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

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

  • @spooksterino5405
    @spooksterino5405 Год назад +2

    Sean, as someone just starting their path down a possible career in data science, thank you so much! This video was immensely helpful and I look forward to coming back to your channel for future insights!

  • @adawiaananda7353
    @adawiaananda7353 2 месяца назад +1

    been looking for a tutorial like this for so long! exactly what I needed and clearly explained, thank you very much!

  • @lwaziradebe8411
    @lwaziradebe8411 Год назад +5

    I just want to thank you, Sean. You have helped me a great deal!

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

    Thank you for this. This helps me a lot! Currently working as GIS and I want to upskill more of using python!

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

    Perfect a very well explained video, and very useful, you earned a like an a new follower!

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

    Hi Sean, what data set should I use to get similar result for my area(Manchester United Kingdom)?
    thanks

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

      You could check for free datasets on kaggle or something - there are some neat providers. Also check out datasetsearch.research.google.com/ as this is a great place to look.

    • @amir_farhad_jassur
      @amir_farhad_jassur Год назад

      @@seanmackenziedataengineering I appreciated Sean.🙂

  • @obeynjanjeni4466
    @obeynjanjeni4466 9 месяцев назад +1

    Very thanks Sir, this is fantastic

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

    Hi sean my data tells can only concatenate str (not "int") to str and sometimes i also get unsupported operand type(s) for /: 'str' and 'int' and i dont know when i try to use the scatter_mapbox

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

    The coding line for "Margin" is not working for IDLE shell 3.10.7. The colons are giving errors when you are putting it in.

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

    thank you for the explanation! I tried to implement this basic example. When I run it, a new tab in my browser opens. However, the plot won't show. In fact, I cannot establish a connection (ERR_CONNECTION_REFUSED). What can be the reason for this?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад

      I don't think I've seen that before. It could be security software blocking Python from starting your browser. You can try saving your figure as an html file, then opening that file directly by double-clicking it. plotly.com/python/interactive-html-export/

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

    I run your code on my dataset It just show the errors that fig is not defined. Is there anything I should define or import before running?!?

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

      Maybe you just put px.scatter_mapbox(.... instead of loading the variable fig:
      fig = px.scatter_mapbox(...
      Let me know how it goes!

  • @PaulaArias-he4ug
    @PaulaArias-he4ug 7 месяцев назад

    Thank you very much for the video! It's been really useful. But I have one question yet. Is it possible to show this maps on a tkinter frame, or in any other GUI library?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  7 месяцев назад

      Great question: There are a bunch of static output types like png, jpg, svg, or pdf, but html is the only interactive output that I know of. You might be able to open some kind of browser control on a tkinter form perhaps? Then you could consume the interactive html output.

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

    Amazing video. Thank you very much, very helpful

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

    Hi, I have copied your code and tried to run it in colab but I am getting just the title and blank white box in place of the map.
    Is there any solution to get that map in colab?
    what I am missing here?

  • @Garcia_AI_Dev
    @Garcia_AI_Dev Год назад +2

    Great explanation Sean, thanks a lot. I'm wondering how could I really interact with the map and not just see basic Info automatically provided by Plotly when we go over the marks, I mean, let's imagine we have a dataset of passengers of some car and I want a list of them when I click in some one, how could I do that? Another doubt is, can I use Google Earth to render the map? Thanks in advance.

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

      Thanks for the feedback! Yes, you can change the fields that show up in the hover over tooltip that pops up. You can add, change, or configure all of those during runtime. Open-street-maps is a really great free tool. You could also use google, but check for commercial restrictions etc.

  • @Ligress
    @Ligress 2 года назад +3

    HI Sean,
    First of all, this is a BRILLIANT VIDEO!
    Will you guide me to resources where we can plot a storm/typhoon paths
    Roadways, shipping vessels paths ...

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

      Good one! Well, you could easily do that here by just putting in a dataset with the trajectory coordinates and expected intensity/size. Just set the size of the dot equal to intensity. Mapbox may have other layers including shipping lanes etc. Just google plotly mapbox and check it out. Let me know if you find it!

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

    Hi. I have a question how do I implement a joining line for distance wise from a start point and end point, lat and lon with mapbox access token

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

      Great question! You can use line_mapbox if you're in Express, or just use Scattermapbox traces. If your lat/long coordinates are precise, you can just calculate the distance in Python using the Haversine formula.

  • @MrTeferiZ
    @MrTeferiZ 9 месяцев назад +1

    please share a link if its possible to work online without downloading any file to my office computer, which I'm restricted to download anything

  • @OmaniGamer2023
    @OmaniGamer2023 6 месяцев назад +1

    Can this map work in offline environment?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  6 месяцев назад

      You bet! The trick is to get openstreetmap tiles working offline. It is all open so you can do it. A quick search will show the way.

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

    How to make an arrow by using scatter_mapbox toindicate direction?

  • @SaravananB-d4n
    @SaravananB-d4n Год назад +1

    Thank you sir❤

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

    How can we move the legend above the map as horizontal?

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

      You can use:
      fig.update_layout(legend=dict(orientation="h"))
      You may have other arguments in your legend layout; in that case just add a comma and orientation="h".
      Example from plotly site:
      fig.update_layout(legend=dict(
      orientation="h",
      yanchor="bottom",
      y=1.02,
      xanchor="right",
      x=1
      ))

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

      @@seanmackenziedataengineering thank you very much for the answer 👍🏻

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

    Very Nice.

  • @Ananass-i3w
    @Ananass-i3w Год назад +1

    ale krasny ten mapper

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

    how to plot lat/long coordinate in ms access?

  • @novaes06
    @novaes06 Год назад

    is it possible to animate a tracking plot? Thank you.

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

      Yes, you can do it by using a kind of stop-motion. Take snaps and then put them all into something like Camtasia. I did it in this video: ruclips.net/video/S9lg0WqQWHU/видео.html
      It works better on geo-maps. The nice tiled maps you see from open-street-maps are harder to automate because the camera height auto-adjusts.

    • @novaes06
      @novaes06 Год назад

      @@seanmackenziedataengineering Thank you very much. I'll take a look and apply it!!

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

    is scatter mapbox free?
    I thought it costs money to use it