Folium builds on the data wrangling strengths of the Python ecosystem and the mapping strengths of the leaflet.js library. Manipulate your data in Python, then visualize it in on a Leaflet map via folium. It supports Image, Video, GeoJSON, and TopoJSON overlays.
To install this module type the below command in the terminal.
pip install folium
Example 1: To create Base Map
The class used in the above example is folium.Map(). This class method will always be the first thing that you execute when working with Folium. The purpose of this class is to generate the default map object that will be rendered by your notebook, and the object that we will be building on top of for our visualizations.
Parameters used: There are several parameters within this class which are:
- location: this parameter basically define the default location that will be shown by the map as the central location.
- zoom_start: which defines the default magnification level of the map.
- control_scale: enables/disables the map scale for a given zoom level.
Now, to outline area using GeoJson follow these steps:
- Open geojson.io
- Mark the area you want to outline on the map.
- A JSON file will get generated on the left side, save that file with the name outline.json. See the below image.