67 maxar open data
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
# !pip install -U leafmap
import leafmap
Retrieve all collections from the Maxar Open Data STAC catalog. Each collection represents a single event.
leafmap.maxar_collections()
['Gambia-flooding-8-11-2022', 'Hurricane-Fiona-9-19-2022', 'Hurricane-Ian-9-26-2022', 'Indonesia-Earthquake22', 'Kahramanmaras-turkey-earthquake-23', 'New-Zealand-Flooding22', 'New-Zealand-Flooding23', 'Sudan-flooding-8-22-2022', 'afghanistan-earthquake22', 'cyclone-emnati22', 'kentucky-flooding-7-29-2022', 'pakistan-flooding22', 'southafrica-flooding22', 'tonga-volcano21', 'volcano-indonesia21', 'yellowstone-flooding22']
Retrieve all collections for a specific event:
collections = leafmap.maxar_child_collections('Kahramanmaras-turkey-earthquake-23')
print(f"The number of collections: {len(collections)}")
The number of collections: 54
collections[:5]
['1050050044DE7E00', '1050050044DE7F00', '1040010082B85E00', '1040010082698700', '10300500D8F90C00']
Retrieve all items (tiles) for a specific collection and generate the footprints:
gdf = leafmap.maxar_items(
collection_id='Kahramanmaras-turkey-earthquake-23',
child_id='1050050044DE7E00',
return_gdf=True,
assets=['visual'],
)
gdf.head()
geometry | datetime | platform | gsd | ard_metadata_version | catalog_id | utm_zone | quadkey | view:off_nadir | view:azimuth | ... | view:sun_azimuth | view:sun_elevation | proj:epsg | proj:geometry | grid:code | proj:bbox | tile:data_area | tile:clouds_area | tile:clouds_percent | visual | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | POLYGON ((36.57098 37.22216, 36.57318 37.22217... | 2023-02-07T08:39:03Z | GE01 | 0.46 | 0.0.1 | 1050050044DE7E00 | 37 | 031133010322 | 20.8 | 312.2 | ... | 159.7 | 35.2 | 32637 | {'type': 'Polygon', 'coordinates': [[[284487.9... | MXRA-Z37-031133010322 | 284419.5556640625,4119843.75,285156.25,4122282... | 1.7 | 0.4 | 26 | https://maxar-opendata.s3.amazonaws.com/events... |
1 | POLYGON ((36.57499 37.22208, 36.57569 37.20028... | 2023-02-07T08:39:03Z | GE01 | 0.46 | 0.0.1 | 1050050044DE7E00 | 37 | 031133010323 | 20.7 | 311.7 | ... | 159.7 | 35.2 | 32637 | {'type': 'Polygon', 'coordinates': [[[284843.7... | MXRA-Z37-031133010323 | 284843.75,4119843.75,290156.25,4122264.0991210938 | 11.4 | 2.1 | 18 | https://maxar-opendata.s3.amazonaws.com/events... |
2 | POLYGON ((36.63144 37.21884, 36.63198 37.20142... | 2023-02-07T08:39:03Z | GE01 | 0.47 | 0.0.1 | 1050050044DE7E00 | 37 | 031133010332 | 21.0 | 311.1 | ... | 159.7 | 35.2 | 32637 | {'type': 'Polygon', 'coordinates': [[[289843.7... | MXRA-Z37-031133010332 | 289843.75,4119843.75,295156.25,4121777.34375 | 8.8 | 0.7 | 8 | https://maxar-opendata.s3.amazonaws.com/events... |
3 | POLYGON ((36.68789 37.21518, 36.68828 37.20253... | 2023-02-07T08:39:03Z | GE01 | 0.47 | 0.0.1 | 1050050044DE7E00 | 37 | 031133010333 | 21.3 | 310.5 | ... | 159.7 | 35.2 | 32637 | {'type': 'Polygon', 'coordinates': [[[294843.7... | MXRA-Z37-031133010333 | 294843.75,4119843.75,300156.25,4121247.55859375 | 5.3 | 0.0 | 0 | https://maxar-opendata.s3.amazonaws.com/events... |
4 | POLYGON ((36.74440 37.20960, 36.74458 37.20362... | 2023-02-07T08:39:03Z | GE01 | 0.47 | 0.0.1 | 1050050044DE7E00 | 37 | 031133011222 | 21.5 | 310.4 | ... | 159.7 | 35.2 | 32637 | {'type': 'Polygon', 'coordinates': [[[299843.7... | MXRA-Z37-031133011222 | 299843.75,4119843.75,302031.55517578125,412050... | 1.1 | 0.2 | 25 | https://maxar-opendata.s3.amazonaws.com/events... |
5 rows × 21 columns
Add the footprints to the map:
m = leafmap.Map()
m.add_gdf(gdf, layer_name="Footprints")
m
Retrieve the COG URLs for all tiles in a collection:
images = gdf['visual'].tolist()
images[:5]
['https://maxar-opendata.s3.amazonaws.com/events/Kahramanmaras-turkey-earthquake-23/ard/37/031133010322/2023-02-07/1050050044DE7E00-visual.tif', 'https://maxar-opendata.s3.amazonaws.com/events/Kahramanmaras-turkey-earthquake-23/ard/37/031133010323/2023-02-07/1050050044DE7E00-visual.tif', 'https://maxar-opendata.s3.amazonaws.com/events/Kahramanmaras-turkey-earthquake-23/ard/37/031133010332/2023-02-07/1050050044DE7E00-visual.tif', 'https://maxar-opendata.s3.amazonaws.com/events/Kahramanmaras-turkey-earthquake-23/ard/37/031133010333/2023-02-07/1050050044DE7E00-visual.tif', 'https://maxar-opendata.s3.amazonaws.com/events/Kahramanmaras-turkey-earthquake-23/ard/37/031133011222/2023-02-07/1050050044DE7E00-visual.tif']
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.
# 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:
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.
# 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:
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