#!/usr/bin/env python # coding: utf-8 # [![image](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/opengeos/maxar-open-data/blob/master/examples/maxar_open_data.ipynb) # [![image](https://img.shields.io/badge/Open-Planetary%20Computer-black?style=flat&logo=microsoft)](https://pccompute.westeurope.cloudapp.azure.com/compute/hub/user-redirect/git-pull?repo=https://github.com/opengeos/maxar-open-data&urlpath=lab/tree/maxar-open-data/examples/maxar_open_data&branch=master) # [![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/maxar-open-data/blob/master/examples/maxar_open_data.ipynb) # [![image](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/opengeos/maxar-open-data/master?urlpath=lab%2Ftree%2Fexamples) # # # **Visualizing Maxar Open Data with Leafmap** # # The [Maxar Open Data Program](https://www.maxar.com/open-data) provides pre- and post-event high-resolution satellite imagery in support of emergency planning, risk assessment, monitoring of staging areas and emergency response, damage assessment, and recovery. Check out the links below for more information. # - [Maxar Open Data Program](https://www.maxar.com/open-data) # - [Maxar Open Data on AWS](https://registry.opendata.aws/maxar-open-data/) # - [Maxar Open Data on STAC Index](https://stacindex.org/catalogs/maxar-open-data-catalog-ard-format#/) # - [Maxar Open Data on STAC Browser](https://radiantearth.github.io/stac-browser/#/external/maxar-opendata.s3.amazonaws.com/events/catalog.json?.language=en) # # The Maxar Open Data STAC catalog URL is: https://maxar-opendata.s3.amazonaws.com/events/catalog.json # # In[ ]: # !pip install -U leafmap geopandas # In[ ]: import pandas as pd import geopandas as gpd import leafmap.foliumap as leafmap # In[ ]: repo = "https://raw.githubusercontent.com/opengeos/maxar-open-data/master/" # In[ ]: datasets = pd.read_csv(f"{repo}datasets.csv") datasets # In[ ]: dataset = "Kahramanmaras-turkey-earthquake-23" # In[ ]: df = pd.read_csv(f"{repo}datasets/{dataset}.tsv", sep="\t") df.head() # In[ ]: geojson = f"{repo}datasets/{dataset}.geojson" # In[ ]: m = leafmap.Map() m.add_geojson(geojson, layer_name=dataset) gdf = gpd.read_file(geojson) m.zoom_to_gdf(gdf) m