Map GLOBE Citizen Science Data#
Visualize the GLOBE Mosquito Habitat Mapper and Land Cover data on maps.
import numpy as np
import pandas as pd
import geopandas as gpd
import seaborn as sns
import matplotlib.pyplot as plt
import folium
from folium.plugins import HeatMap
mosquito = gpd.read_file('https://github.com/geo-di-lab/emerge-lessons/raw/refs/heads/main/docs/data/globe_mosquito.zip')
land_cover = gpd.read_file('https://github.com/geo-di-lab/emerge-lessons/raw/refs/heads/main/docs/data/globe_land_cover.zip')
Load the boundary of Florida (downloaded the state boundaries file from the U.S. Census and filtered to Florida), which we will use to crop the data to focus on Florida.
fl = gpd.read_file('https://github.com/geo-di-lab/emerge-lessons/raw/refs/heads/main/docs/data/florida_boundary.geojson')[['geometry']]
mosquito = gpd.sjoin(mosquito, fl, how="inner", predicate='intersects') \
.drop(columns=['index_right']) \
.reset_index(drop=True)
land_cover = gpd.sjoin(land_cover, fl, how="inner", predicate='intersects') \
.drop(columns=['index_right']) \
.reset_index(drop=True)
Map mosquito data in Florida from 2018 to 2024.
# List of columns we have access to
mosquito.columns
Index(['CountryCode', 'CountryName', 'Elevation', 'AbdomenCloseupPhotoUrls',
'BreedingGroundEliminated', 'Comments', 'DataSource', 'ExtraData',
'Genus', 'GlobeTeams', 'LarvaFullBodyPhotoUrls', 'LarvaeCount',
'LastIdentifyStage', 'LocationAccuracyM', 'LocationMethod',
'MeasuredAt', 'MeasurementElevation', 'MeasurementLatitude',
'MeasurementLongitude', 'MosquitoAdults', 'MosquitoEggs',
'MosquitoHabitatMapperId', 'MosquitoPupae', 'Species', 'Userid',
'WaterSource', 'WaterSourcePhotoUrls', 'WaterSourceType',
'OrganizationId', 'OrganizationName', 'Protocol', 'SiteId', 'SiteName',
'MeasuredDate', 'LarvaeCountProcessed', 'geometry'],
dtype='object')
# Create empty map zoomed to Florida
map = folium.Map(location=[28.263363, -83.497652], tiles="Cartodb dark_matter", zoom_start=7)
# Add each point as a marker on the map
for idx, row in mosquito.iterrows():
popup_content = f"<b>Date:</b> {row['MeasuredDate']}<br><b>Water Source:</b> {row['WaterSourceType']}<br><b>Longitude:</b> {row['MeasurementLongitude']}<br><b>Latitude:</b> {row['MeasurementLatitude']}"
folium.Marker(
location=[row.geometry.y, row.geometry.x],
popup=folium.Popup(popup_content, max_width=300)
).add_to(map)
display(map)
Make this Notebook Trusted to load map: File -> Trust Notebook
In the map, click on one of the points to see a pop-up that includes the date, water source type, longitude and latitude of the observation (which was submitted via the GLOBE Observer app).
Map land cover data from 2018 to 2024.
# List of columns we have access to
land_cover.columns
Index(['CountryCode', 'CountryName', 'Elevation', 'DataSource',
'DownwardCaption', 'DownwardExtraData', 'DownwardPhotoUrl', 'DryGround',
'EastCaption', 'EastClassifications', 'EastExtraData', 'EastPhotoUrl',
'Feature1Caption', 'Feature1ExtraData', 'Feature1PhotoUrl',
'Feature2Caption', 'Feature2ExtraData', 'Feature2PhotoUrl',
'Feature3Caption', 'Feature3ExtraData', 'Feature3PhotoUrl',
'Feature4Caption', 'Feature4ExtraData', 'Feature4PhotoUrl',
'FieldNotes', 'GlobeTeams', 'LandCoverId', 'LeavesOnTrees',
'LocationAccuracyM', 'LocationMethod', 'MeasuredAt',
'MeasurementElevation', 'MeasurementLatitude', 'MeasurementLongitude',
'MucCode', 'MucDescription', 'MucDetails', 'Muddy', 'NorthCaption',
'NorthClassifications', 'NorthExtraData', 'NorthPhotoUrl',
'RainingSnowing', 'SnowIce', 'SouthCaption', 'SouthClassifications',
'SouthExtraData', 'SouthPhotoUrl', 'StandingWater', 'UpwardCaption',
'UpwardExtraData', 'UpwardPhotoUrl', 'Userid', 'WestCaption',
'WestClassifications', 'WestExtraData', 'WestPhotoUrl',
'OrganizationId', 'OrganizationName', 'Protocol', 'SiteId', 'SiteName',
'MeasuredDate', 'geometry'],
dtype='object')
# Create empty map zoomed to Florida
map = folium.Map(location=[28.263363, -83.497652], tiles="Cartodb dark_matter", zoom_start=7)
# Add each point as a marker on the map
for idx, row in land_cover.iterrows():
popup_content = f"<b>Date:</b> {row['MeasuredDate']}<br><b>MUC:</b> {row['MucDescription']}<br><b>Longitude:</b> {row['MeasurementLongitude']}<br><b>Latitude:</b> {row['MeasurementLatitude']}"
folium.Marker(
location=[row.geometry.y, row.geometry.x],
popup=folium.Popup(popup_content, max_width=300)
).add_to(map)
display(map)
Make this Notebook Trusted to load map: File -> Trust Notebook
We created some simple interactive maps of the GLOBE data. In the next session, we’ll make heatmaps showing the global distribution of these points.