#!/usr/bin/env python # coding: utf-8 # [![image](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://demo.leafmap.org/lab/index.html?path=notebooks/97_overture_data.ipynb) # [![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/leafmap/blob/master/docs/notebooks/97_overture_data.ipynb) # [![image](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/opengeos/leafmap/HEAD) # # **Download Overture Maps Data** # # Uncomment the following line to install [leafmap](https://leafmap.org) if needed. # In[ ]: # %pip install -U leafmap overturemaps # In[ ]: import leafmap # Create an interactive map. # In[ ]: m = leafmap.Map(center=[36.120725, -115.203795], zoom=17) m.add_basemap("SATELLITE") m # Draw a rectangle on the map to download the data within the rectangle. # In[ ]: if m.user_roi is not None: bbox = m.user_roi_coords() else: bbox = [-115.2081, 36.119, -115.1994, 36.1226] # Download Overature Maps building data. # In[ ]: columns = ["id", "height", "geometry"] output = "buildings.geojson" buildings_gdf = leafmap.get_overture_data( "building", bbox=bbox, columns=columns, output=output ) # In[ ]: m = leafmap.Map(center=[36.120725, -115.203795], zoom=17) m.add_basemap("SATELLITE") m.add_gdf(buildings_gdf, layer_name="Buildings") # Download Overature Maps transportation data. # In[ ]: output = "roads.geojson" columns = ["id", "subtype", "class", "geometry"] roads_gdf = leafmap.get_overture_data( "segment", bbox=bbox, columns=columns, output=output ) # In[ ]: m.add_gdf(roads_gdf, layer_name="Roads", style={"color": "red", "weight": 2}) m # The overture maps data type can be one of the following: # # address|building|building_part|division|division_area|division_boundary|place|segment|connector|infrastructure|land|land_cover|land_use|water # ![image](https://github.com/user-attachments/assets/e584348b-5e36-425b-9d39-8f436b7477a3)