Map Overture Buildings and Foursquare Places with Leafmap
Dr. Qiusheng Wu is an Associate Professor of Geography and Sustainability at the University of Tennessee and a Founding Editorial Board Member at the Cloud-Native Geospatial Forum (CNG). As part of his commitment to making open-source geospatial analysis and visualization more accessible, he has developed several widely used open-source packages, including geemap, leafmap, and segment-geospatial.
In this Notebook Qiusheng shows a few examples of how Cloud Native Geospatial datasets help you easily load data into a Jupyter Notebook environment using leafmap. His practical examples showcase how you can call the Overture Maps UDF and Foursquare Places UDF to load data into a custom area of interest and render it in a leaflet map.
Calling Fused UDFs to load dataโ
You first use leafmap to create a bounding box over an area of interest (AOI) user_aoi
and create a GeoDataFrame gdf_aoi
with it. Then, you can run the Overture Maps UDF, passing the AOI as a parameter to define the area to fetch data for.
Behind the scenes, the the Overture UDF reads data directly from the Overture Maps dataset hosted in Source Cooperative.
import fused
import geopandas as gpd
from shapely.geometry import shape
# Define AOI, which can be done with leafmap drawing tools
user_aoi = {'type': 'Feature','properties': {},'geometry': {'type': 'Polygon','coordinates': [[[-74.025621, 40.699967],[-74.025621, 40.730283],[-73.966055, 40.730283],[-73.966055, 40.699967],[-74.025621, 40.699967]]]}}
# Convert drawing to GeoDataFrame
gdf_aoi = gpd.GeoDataFrame([user_aoi['properties']], geometry=[shape(user_aoi['geometry'])])
# Fetch Overture Bulidings GDF with Fused UDF
gdf = fused.run("UDF_Overture_Maps_Example", bbox=aoi)