Skip to content

67 maxar open data

image image image

Visualizing Maxar Open Data with Leafmap

The Maxar Open Data Program 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 - Maxar Open Data on AWS - Maxar Open Data on STAC Index - Maxar Open Data on STAC Browser

The Maxar Open Data STAC catalog URL is: https://maxar-opendata.s3.amazonaws.com/events/catalog.json

1
# !pip install -U leafmap
1
import leafmap

Retrieve all collections from the Maxar Open Data STAC catalog. Each collection represents a single event.

1
leafmap.maxar_collections()

Retrieve all collections for a specific event:

1
2
collections = leafmap.maxar_child_collections("Kahramanmaras-turkey-earthquake-23")
print(f"The number of collections: {len(collections)}")
1
collections[:5]

Retrieve all items (tiles) for a specific collection and generate the footprints:

1
2
3
4
5
6
7
gdf = leafmap.maxar_items(
    collection_id="Kahramanmaras-turkey-earthquake-23",
    child_id="1050050044DE7E00",
    return_gdf=True,
    assets=["visual"],
)
gdf.head()

Add the footprints to the map:

1
2
3
m = leafmap.Map()
m.add_gdf(gdf, layer_name="Footprints")
m

Retrieve the COG URLs for all tiles in a collection:

1
2
images = gdf["visual"].tolist()
images[:5]

Create a mosaic json file for the collection. You need to install cogeo-mosaic first using pip install cogeo-mosaic. Creating a mosaic json file might take a few minutes. Please be patient.

1
# leafmap.create_mosaicjson(images, output='1050050044DE7E00.json')

Make the mosaic json file available on the web, then you can add the mosaic to the map:

1
2
3
4
5
m = leafmap.Map()
url = "https://geospatial.glitch.me/1050050044DE7E00.json"
m.add_stac_layer(url, name="Mosaic")
m.add_gdf(gdf, layer_name="Footprints")
m

Retrieve the footprint of all tiles for a specific event. This might take 15+ minutes. Please be patient.

1
2
3
4
5
6
7
# gdf = leafmap.maxar_all_items(
#     collection_id='Kahramanmaras-turkey-earthquake-23',
#     return_gdf=True,
#     verbose=True
#     )
# gdf.to_file('maxar_footprints.geojson', driver='GeoJSON')
# gdf

Add the footprints to the map:

1
2
3
4
5
m = leafmap.Map(center=[36.844461, 37.386475], zoom=8)
# m.add_gdf(gdf, layer_name="Footprints")
url = "https://cdn.glitch.global/cc5b7737-d8d0-4b07-bf2f-867b9009e986/maxar_footprints.geojson?v=1676583955698"
m.add_geojson(url, layer_name="Footprints")
m