68 openaerialmap
Searching and visualizing OpenAerialMap imagery interactively
OpenAerialMap (OAM) provides openly licensed satellite and unmanned aerial vehicle (UAV) imagery. Currently, it has over 12,400+ images around the globe. This notebook demonstrates how to search and visualize OAM imagery interactively. You can download images automatically with one line of code.
Uncomment the following line to install leafmap if needed.
import leafmap
Search OAM images by a bounding box and a date range. The results can be returned as a GeoDataFrame or a list of image metadata.
bbox = [-79.6344, -0.9063, -77.3383, 1.0436]
start_date = "2016-04-01"
end_date = "2016-04-30"
gdf = leafmap.oam_search(
bbox=bbox, start_date=start_date, end_date=end_date, return_gdf=True
)
print(f"Found {len(gdf)} images")
Found 55 images
gdf.head()
geometry | _id | uuid | __v | title | gsd | file_size | acquisition_start | acquisition_end | platform | provider | contact | sensor | thumbnail | tms | wmts | uploaded_at | meta_uri | bbox | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | POLYGON ((-78.10058 0.03903, -78.10058 0.22225... | 59e62b7e3d6412ef72209701 | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | 0 | Planet Labs PlanetScope Ecuador Earthquake | 3 | 3144604 | 2016-04-20T00:00:00.000Z | 2016-04-20T23:30:00.000Z | satellite | Planet Labs | Erika Reinhardt,erika@planet.com | PlanetScope | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | 2016-04-25T00:00:00.000Z | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | [-78.10058445823623, 0.03902710389879522, -77.... |
1 | POLYGON ((-78.20509 -0.11029, -78.20509 0.0732... | 59e62b7e3d6412ef7220970b | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | 0 | Planet Labs PlanetScope Ecuador Earthquake | 3 | 3831430 | 2016-04-20T00:00:00.000Z | 2016-04-20T23:30:00.000Z | satellite | Planet Labs | Erika Reinhardt,erika@planet.com | PlanetScope | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | 2016-04-25T00:00:00.000Z | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | [-78.20508551319601, -0.11029022565691535, -78... |
2 | POLYGON ((-78.15366 -0.03562, -78.15366 0.1479... | 59e62b7d3d6412ef7220968d | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | 0 | Planet Labs PlanetScope Ecuador Earthquake | 3 | 3812140 | 2016-04-20T00:00:00.000Z | 2016-04-20T23:30:00.000Z | satellite | Planet Labs | Erika Reinhardt,erika@planet.com | PlanetScope | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | 2016-04-25T00:00:00.000Z | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | [-78.15365598124903, -0.03562021446422918, -77... |
3 | POLYGON ((-78.58833 -0.65642, -78.58833 -0.472... | 59e62b7e3d6412ef722096dc | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | 0 | Planet Labs PlanetScope Ecuador Earthquake | 3 | 3248739 | 2016-04-20T00:00:00.000Z | 2016-04-20T23:30:00.000Z | satellite | Planet Labs | Erika Reinhardt,erika@planet.com | PlanetScope | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | 2016-04-25T00:00:00.000Z | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | [-78.58833199002822, -0.6564207526726079, -78.... |
4 | POLYGON ((-78.69573 -0.81214, -78.69573 -0.628... | 59e62b7d3d6412ef722096a0 | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | 0 | Planet Labs PlanetScope Ecuador Earthquake | 3 | 2777837 | 2016-04-20T00:00:00.000Z | 2016-04-20T23:30:00.000Z | satellite | Planet Labs | Erika Reinhardt,erika@planet.com | PlanetScope | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | http://tiles.openaerialmap.org/571e5c7fcd0663b... | 2016-04-25T00:00:00.000Z | http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0... | [-78.69572836359227, -0.8121394423861734, -78.... |
The tile URLs are stored in the tms
column of the GeoDataFrame.
tiles = gdf["tms"].tolist()
tiles[:5]
['http://tiles.openaerialmap.org/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb43/{z}/{x}/{y}.png', 'http://tiles.openaerialmap.org/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb46/{z}/{x}/{y}.png', 'http://tiles.openaerialmap.org/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb29/{z}/{x}/{y}.png', 'http://tiles.openaerialmap.org/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb3b/{z}/{x}/{y}.png', 'http://tiles.openaerialmap.org/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb2d/{z}/{x}/{y}.png']
The image sources (downloadable URLs) are stored in the uuid
column of the GeoDataFrame.
images = gdf["uuid"].tolist()
images[:5]
['http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb43.tif', 'http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb46.tif', 'http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb29.tif', 'http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb3b.tif', 'http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb2d.tif']
Download all images using the download_files()
function.
leafmap.download_files(images[:2])
Downloading... From: http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb43.tif To: /home/runner/work/leafmap/leafmap/docs/notebooks/571e60322b67227a79b4fb43.tif
0%| | 0.00/3.14M [00:00<?, ?B/s]
100%|██████████| 3.14M/3.14M [00:00<00:00, 57.0MB/s]
Downloading... From: http://oin-hotosm.s3.amazonaws.com/571e5c7fcd0663bb003c31f9/0/571e60322b67227a79b4fb46.tif To: /home/runner/work/leafmap/leafmap/docs/notebooks/571e60322b67227a79b4fb46.tif
0%| | 0.00/3.83M [00:00<?, ?B/s]
100%|██████████| 3.83M/3.83M [00:00<00:00, 59.2MB/s]
Add the image footprints to the map.
m = leafmap.Map()
m.add_gdf(gdf, layer_name="Footprints")
m
Search OAM imagery within the current map extent or user drawn ROI.
m = leafmap.Map(center=[4.7955, -75.6899], zoom=15)
m.add_basemap("SATELLITE", show=False)
bbox = [-75.7138, 4.7826, -75.6659, 4.808332]
m.oam_search(bbox=bbox)
m
Found 8 images. Showing the first 5.
Search OAM imagery interactively using the interactive GUI.
m = leafmap.Map(center=[4.7955, -75.6899], zoom=15)
m