<jupyter_start><jupyter_text>Getting started with Folium; a Python wrapper for Leaflet.js<jupyter_code># Loading the required libraries
import folium
from folium.plugins import MarkerCluster
import pandas as pd
# Defining the coordinates of the center of our map
nbo_coords = [-1.29, 36.82]

# Creating the map
nbo_map = folium.Map(location = nbo_coords, zoom_start = 13)

# Display the map
nbo_map<jupyter_output><empty_output><jupyter_text>Adding markers to our map<jupyter_code># Defining the coordinates of our markers
Britam_tower_coords = [-1.2971424017095319, 36.813182931123535]
Family_basilica_coords = [-1.2847644863281125, 36.8198589915004]
Archives_coords = [-1.2847525061129854, 36.82588334598308]

# Adding markers to the map
folium.Marker(Britam_tower_coords, popup= 'Britam Tower').add_to(nbo_map)
folium.Marker(Family_basilica_coords, popup = 'Holy Familica Basilica').add_to(nbo_map)
folium.Marker(Archives_coords, popup = 'Kenya National Archives').add_to(nbo_map)

# Displaying the map
nbo_map
# Changing the tiles since OSM is the default
# from branca.element import Figure 
# # branca is a spinoff from folium that hosts non-map specific features
# # we are using it here to resize the map 

# fig = Figure(width=550,height=350)
# fig.add_child(nbo_map)

# Adding other tile layers
folium.TileLayer('Stamen Terrain').add_to(nbo_map)
folium.TileLayer('Stamen Toner').add_to(nbo_map)
folium.TileLayer('Stamen Water Color').add_to(nbo_map)
folium.TileLayer('cartodbpositron').add_to(nbo_map)
folium.TileLayer('cartodbdark_matter').add_to(nbo_map)
folium.LayerControl().add_to(nbo_map)
nbo_map
# Adding custom base maps
# Creating a dictionary to hold the basemaps
basemap = {
    'Google Maps' : folium.TileLayer(
        tiles = 'https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',
        attr = 'Google',
        name = 'Google Maps',
        overlay = True,
        control = True
    ),
    'Google Satellite Hybrid' : folium.TileLayer(
        tiles = 'https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}',
        attr = 'Google',
        name = 'Google Satellite',
        overlay = True,
        control = True
    )
}

# Adding the custom base layers
ke_map = folium.Map(location=[-0.176, 37.91])
basemap['Google Maps'].add_to(ke_map)
ke_map
basemap['Google Satellite Hybrid'].add_to(ke_map)
display(ke_map)
# Next steps
# Integrating with GEE
# Plotting paths; polylines
# Case study: choropleths, time series etc.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11434343434343434, 'fraction_numerical': 0.050101010101010104, 'mean_word_length': 4.895238095238096, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '446081', 'license': 'CC0-1.0', 'n_tokens_mistral': 996, 'n_tokens_neox': 890, 'n_words': 209, 'path': 'Folium.ipynb', 'repo_name': 'WanjikuGithu/Geo', 'size': '2475'}