How to mark your location on a map using python

Mark your location on the world map. Before getting into this we will have a python and turtle graphics library. In this case, I will use pycharm IDE. Let’s move on to a crazy project,

How to install pycharm in windowshttps://iterathon.tech//how-to-install-the-pycharm-in-windows/

Open New Projects

After opening a pycharm click on a new project and you can give it any name as my_map. In this project.

Once you give it a name and click on the create. It takes few seconds to create the project, On the current project there are some existing files are found in ide so, delete all those files using Ctrl+A and Backspace. Now Python is ready to code before that, we need one awesome python packages called folium.

Folium Library

folium is used to visualize data that’s been manipulated in Python on an interactive leaflet map. It enables both the binding of data to a map for choropleth visualizations as well as passing rich vector/raster/HTML visualizations as markers on the map.

Link to folium package: https://pypi.org/project/folium/. After getting into the link. You need to copy the magical word to install folium. That is pip install folium. If you have a mac then type python3 -m pip install folium.

Again go to the pycharm and click terminal then paste the magical word pip install folium. It takes few seconds to install packages. Once the package gets installed and then go to your project my_map.

Code

This is an easy and crazy python project to my_map. Let’s further move on to the python program.

import folium
map = folium.Map()
folium.Marker([11.11395889000553, 77.19017509371042], 
              popup = "Iterathon" ).add_to(map) #Latitude and Longitude 
map.save("map.html")
map

Once you got a successful execution. you can notice that one Html file is on the current working folder named “map.html”. You can open the map.html in the browser with the internet. Make sure you have an internet connection.

Related Post

Random Password Generator in Pythonhttps://iterathon.tech//random-password-generator-in-python/

Difference between Data Science Vs Machine learning? : https://cybrblog.tech/difference-between-data-science-vs-machine-learning/

How to Impress a Girlfriendhttps://iterathon.tech//how-to-impress-a-girlfriend-using-python/

LEARN SOMETHING NEW ❣

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *