Python Folium #5 - Sending coordinates to Python

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • Series Repository: github.com/bas...
    Folium Playlist: • Python Folium
    ChromeDriver: chromedriver.c...
    folium pypi: pypi.org/proje...
    folium docs: python-visuali...
    folium github: github.com/pyt...
    code editor: code.visualstu...
    Music: • [no copyright music] '...
    Part 5 of the Folium series where I go over how to send coordinates from the folium map to the a python program. So that they can be processed/handles/redrawn by python. This video is kind of long an goes over the entire creation as well as debugging process.

КОМЕНТАРІ • 17

  • @62_neilcardoz65
    @62_neilcardoz65 5 місяців тому +1

    Thank you so much. My project just needed your help!!

    • @bvdlio
      @bvdlio  5 місяців тому

      Glad it helped ^^

  • @khalidseflan301
    @khalidseflan301 Рік тому +1

    Thank you very much. What about making videos about and injecting/displaying HTML form when clicking on the marker. 👍

    • @bvdlio
      @bvdlio  Рік тому +2

      Thanks 🙏
      It would be the same as injecting any other javascript/html. You might need to host the the Folium file, for includes and such.
      Thanks for the video suggestion.

  • @isaaclim76
    @isaaclim76 Рік тому

    Hi, May I know if Polylines (with an existing lat,long) and Marker can be used for visualization?

    • @isaaclim76
      @isaaclim76 Рік тому

      ok. I found it.. =) thanks for the tutorial.. its a great guide together with your github repo.

  • @merickk02
    @merickk02 Рік тому +1

    Your tutorials helps a lot. What about loading the json file and displaying on map and editing the markers/polygons and resaving json.

    • @bvdlio
      @bvdlio  Рік тому

      Good question :) it's fairly similar. You just have to add the JSON data to the js that you inject into the Folium file.
      Let me know if you get it to work. If not, I'll make a short follow up video in it :)

    • @merickk02
      @merickk02 Рік тому +1

      @@bvdlio I've been trying using geojson and draw. I can save a json file but when I load them up in a new map I can't edit whats been loaded. Though the injection method might prove to be better than the geojson/draw I've been trying to get working.

    • @bvdlio
      @bvdlio  Рік тому +1

      Okay, I'll see what I can do :)
      Just so that I understand correctly. Your goal is to load a JSON file containing some geo data (marker locations, or lines, etc) so that it is visible on the Folium map. You then want to be able to add new markers to the map, and update the JSON file so that it now also contains that new geo data.
      That is your goal right?

    • @merickk02
      @merickk02 Рік тому

      @@bvdlio mainly edit the markers/polygons that are loaded. Like change the fill color of a pre loaded geojson object. Thanks for your replies .

    • @bvdlio
      @bvdlio  Рік тому

      @@merickk02
      Ah, okay :)
      So like some interactable gui in the folium map to edit your loaded geojson objects color or other attributes?
      No worries, thanks for your responses too. I'll gladly try and help :)

  • @user-tk1kk4qv4d
    @user-tk1kk4qv4d Рік тому

    I have run your code and it returns null in coords.json file, can you please correct it so that I can save the lat long that I clicked through marker

    • @bvdlio
      @bvdlio  Рік тому

      Hey, unfortunate to hear. I just tested to code in the repo, and on my end it still works as intended.
      Can you elaborate on what you mean with: 'returns null in coords.json file' . I'll gladly help :)
      Here are some tips:
      - Make sure to have the correct version of the chromedriver.
      - Make sure that selenium opens the file, and don't just open the html by clicking on it.
      - Try to test if you can get other data to send.
      - The coordinates are only added to the file when the 'quit' button is clicked, so add some markers, then click quit.

  • @isaaclim76
    @isaaclim76 Рік тому

    Is there anyway instead of running selenium, i can use streamlit to run the html?

    • @bvdlio
      @bvdlio  Рік тому

      I am not too familiar with streamlit. But you can open it in browser with whatever method you want.
      You can also just double click the html file or right click open with: your browser.
      It's not automatic but it works too.
      Does selenium not work for you?

    • @isaaclim76
      @isaaclim76 Рік тому +1

      @@bvdlio building a dashboard with streamlit for more interactions.
      Anyway I found it by changing the Class object to fit the JavaScript in..