1. How to search a dataset ?
curl –location ‘https://gdh-portal-prod.cnes.fr/api/search/collections’
–header ‘Content-Type: application/json’
—data ‘{
“page”: 1,
“query”: {
“title”:{“contains”:”oso”}
//”title”:{“eq”:”PEPS Sentinel-2 L1C tiles”}
//”description”: {“contains”: “spot”}
//”keywords”: {“contains”: “spot”}
//”dcs:sensor”:{“in”:[“VGT”,”AVHRR”]}
//”dcs:processingLevel”:{“eq”:”l3a”}
//”dcs:temporalResolutionInHours”:{“gte”:700}
//”dcs:spatialResolutionInMeters”:{“lte”:10}
//”dcs:sensor”:{“in”:[“VGT”,”AVHRR”]}
//”total_items”:{“lte”:50000}
//”extent.temporal.interval”:{“in”:[“2023-02-09T00:39:19.039Z”,”2023-05-16T22:11:16.318Z”]}
}
}’
The searchable attributes are listed here :
Attribute | Format | Description | Syntax example |
title | String | Title of the dataset | PEPS Sentinel-1 Level1 |
keywords | String | Keywords related on the datasat | [“s1″,”sentinel-1″,”l1″,”sar”,”grd”,”slc”] |
dcs:sensor | String | Name of the sensor | C-SAR |
dcs:processingLevel | String | Product level | LEVEL1 |
dcs:temporalResolutionInHours | Number | Temporal resolution in hour of the dataset | 144 |
dcs:spatialResolutionInMeters | String | Spatial resolution in meters of the dataset | 5 |
total_items | Number | Number of products in the dataset | 10 |
extent.temporal.interval | Interval de dates | Temporal interval of the dataset | [[“2023-02-09T00:39:19.039Z”,”2023-05-16T22:11:16.318Z”]]” |
The “id” attribute returned in the response will be useful to find products of a dataset.
2. How to search products from a dataset ?
curl –location ‘https://gdh-portal-ci.cnes.fr/api/search/items’
–header ‘Content-Type: application/json’
—data ‘{
“page”:1,
“limit”:10,
“query”: {
“datatype”:{“in”:[“PEPS_S2_L1C”]}
//”temporal:startDate”:{“gte”:”2013-05-24T10:50:20Z”}
//”temporal:endDate”:{“lte”:”2013-05-24T10:50:20Z”}
//”spaceborne:orbitID” : {“gte”:195, “lte”:210}
//”spaceborne:absoluteOrbitID”:{“gte”:29100, “lte”:29200}
//”spaceborne:orbitDirection”:{“eq”:”Descending”}
//”spaceborne:cloud_cover”:{“lte”:50}
//”spaceborne:tile”:{“eq”:”T19UDU”}
//”spaceborne:continentsID”:{“in”:[“eu”]}
//”spaceborne:satellitePlatform”:{“in”:[“s2b”]}
}
}’
The main searchable attributes are listed here :
Attribute | Format | Description | Syntax example |
dataType | String | Dataset of the product | “PEPS_S2_L1C” |
temporal:startDate | Date | début d’acquisition | “aaaa-mm-jjThh:mm:ss.000Z” |
temporal:endDate | Date | fin d’acquisition | “aaaa-mm-jjThh:mm:ss.000Z” |
spaceborne:orbitID | Nombre | Orbite relative | 50 |
spaceborne:absoluteOrbitID | Nombre | Orbite absolue | 30972 |
spaceborne:orbitDirection | String | Direction de l’orbite | “Descending” ou “Ascending” |
spaceborne:cloud_cover | Nombre | Couverture nuageuse | 40 |
spaceborne:tile | String | Tuile | “T01UGT” |
spaceborne:continentsID | String | code continent | “AF”, “NA”, “OC”, “AN”, “AS”, “EU”, “SA” |
spaceborne:satellitePlatform | String | plateforme | “S1A”, “S1B”, “S2A”, “S2B” |
3. How to download products from GeoDataHub ?
To download data from GeoDataHub platform, an API key is required to be authentificated. To get a personal API Key, follow the next steps. If you already have an API key, go to §3.2.
3.1. Get a GeoDataHub API key
First, create an account on https://gdh-portal-prod.cnes.fr :
Then, generate your personal API key :
Keep your personal APIkey in a safe space. If you lost it, you will have to generate an other. For security reasons, the current APIKey can’t be given back later.
3.2. Download products
The GDH Search API returns JSON containing information about the products matching the search, including the product download link.
The command to get a list of downloading links is :
<CURL COMMAND> | sed ‘s/,/\n/g’ | grep download | grep zip | sed ‘s/{“href”://g’
For example :
curl -k -H “Content-Type: application/json” -X POST -d ‘{ “page”:1,”limit”:10, “query”: {“dataType”: {“in”:[“PEPS_S2_L1C”]}}}’ “https://gdh-portal-prod.cnes.fr/api/search/items” | sed ‘s/,/\n/g’ | grep download | grep zip | sed ‘s/{“href”://g’
Then, just send a curl command including your personal API key and the links provided in “assets.href” to download the products
curl -vvv -k -L -H “X-API-Key: <APIKEY> -XGET “<DOWNLOADING_LINK>” –output <OUTPUT_NAME_FILE>
For example :
curl -vvv -k -L -H “X-API-Key: $APIKEY” -XGET “https://gdh-portal-ci.cnes.fr/api/v1/rs-catalog/downloads/URN:FEATURE:DATA:gdh:b2140343-085f-33d4-b923-52d3ae9d9dd6:V1/files/ef869eed3ad7b5e0617261e6328408c5” –output S2B_MSIL1C_20230303T080809_N0509_R078_T37UGT_20230303T111244.zip
4. Notes
GeoDataHub is providing a STAC and an Opensearch API. It is recommended to use the STAC API but some old projects could be forced to use the opensearch format.
GeoDataHub is in beta version until June 2024. We know that we are not currently 100% STAC compatible but we should fix this in the coming months. In future versions, the STAC experience will be improved. Then you will be able to use standard STAC client libraries to consume the services more easily.