Download quicklooks

Download quicklooks of the images from the data search results using the API.


Introduction

In this guide, you will learn how to download the quicklooks of the images from the search results using the API. Downloading quicklooks is a free service that allows you to visually examine the low resolution previews before purchasing the geospatial datasets. Quicklooks are useful for the assessment of the overall weather conditions and the spatial distribution of clouds, in relation to your area of interest.

In the steps below, we download quicklooks of geospatial datasets provided by the following hosts: OneAtlas and Near Space Labs. OneAtlas provides access to very high resolution and high resolution satellite images (Pléiades and SPOT 6/7). Near Space Labs provides access to very high resolution images captured by the stratospheric balloons called Swifty.

Get image identifiers

  1. Depending on the host, extract the image IDs from the previous search results (OneAtlas_search_results.json and NearSpaceLabs_search_results.json) and save them in a new file.

OneAtlas

cat OneAtlas_search_results.json | jq -r \
'.features[] | .properties | .id' | uniq > OneAtlas_image_ids.json

The file OneAtlas_image_ids.json contains the following image IDs:

4b8f26a4-0e2a-489b-b65b-05fe6e3c5522
0e385a3e-21f3-41ee-95ca-20c7f6e46b4a
7288802a-69e6-46f1-b64b-149e32e8c444
43591121-2f2a-4639-83ef-252707a1a4cf
d8042143-0a81-4802-aecb-7c16e73b91eb

Near Space Labs

cat NearSpaceLabs_search_results.json | jq -r \
'.features[] | .properties | .id' | uniq > NearSpacelabs_image_ids.json

The file NearSpaceLabs_image_ids.json contains the following image IDs:

20190829T172134Z_1374_POM1_ST2_P
20190829T172132Z_1373_POM1_ST2_P
20190829T172130Z_1372_POM1_ST2_P
20190829T172128Z_1371_POM1_ST2_P
20190829T172126Z_1370_POM1_ST2_P

Download quicklooks

  1. Download the quicklook for each image ID saved in the previous files:

OneAtlas

host_name=oneatlas
while read -r image_id; do curl -s -L \
https://api.up42.com/catalog/$host_name/image/$image_id/quicklook \
-H "Authorization: Bearer $PTOKEN" -H \
'Accept: image/webp; q=0.9, image/png; q=0.8, image/jpeg; q=0.7' \
-o quicklook_$image_id.jpg; done < OneAtlas_image_ids.json

Near Space Labs

host_name=nearspacelabs
while read -r image_id; do curl -s -L \
https://api.up42.com/catalog/$host_name/image/$image_id/quicklook \
-H "Authorization: Bearer $PTOKEN" -H \
'Accept: image/webp; q=0.9, image/png; q=0.8, image/jpeg; q=0.7' \
-o quicklook_$image_id.jpg; done < NearSpaceLabs_image_ids.json

To proceed, go to Data estimation.