C2 - Data Exploration Service¶
The service interfaces allows the researchers to discover and explore a large variety and volume of geospatial datasets including Earth Observation and Planetary Science products driven by community needs. It implements the Digital Earth concept, enabling visualization, combination, processing and download.
Explorer¶
Explorer is a web-based graphic user interface to allow users to explore, process, access and download data. Explorer integrates also data processing functionalities, a dashboard to setup the application and it has been integrated with the NEANIAS AAI core service.
It’s available at https://explorer.adamplatform.eu/
adamapi¶
The adamapi Application Processing Interfaces (APIs) provide a python-library which could be directly integrated in users’s code and application to access the ADAM data and processing capabilities. user’s code and applications.
Version¶
- adamapi==2.0.1r1
Installation¶
1. Pre-packaged¶
They are available as a pre-packaged module in the base image of the Jupyter instance (C3.1). The user can directly import it in a notebook.
import adamapi
2. Standalone python package¶
The are also available as a package that could be installed in the user environment. The following procedures had been tested on Ubuntu 18.04/20.04.
- Global installation (Pre-Requirements: python3 installed)
sudo apt-get install python3-gdal gdal-bin python3-pip --yes
python3 -m pip install --upgrade pip
pip3 install adamapi==2.0.1r1
- In a python3 virtual environment
sudo apt-get install python3-venv python3-gdal gdal-bin --yes
VENVNAME="adamapi"
python3 -m venv "${VENVNAME}"
PYTHONVERSION=$(ls ${VENVNAME}/lib/)
source "${VENVNAME}/bin/activate";
python3 -m pip install --upgrade pip;
pip install adamapi==2.0.1r1
ln -s "/usr/lib/python3/dist-packages/osgeo" "${VENVNAME}/lib/${PYTHONVERSION}/site-packages/osgeo"
APIs definition¶
The adamapi library is divided in 4 modules:
- Auth, to authenticate (using the API KEY)
- Datasets, to list available Datasets
- Search, to discover available Products for a specific Dataset, including metadata (e.g. geometry, tiles, cloud cover, …)
- GetData, to access the selected Product
1. Auth¶
To use the API the user needs to have an account on the ADAM service and retrieve her/his individual Api Key from the user profile window. The Api Key remains valid with no temporal limitation.
IMAGE
The authentication with a thematic service endpoint is performed as follows:
from adamapi import Auth
A = Auth()
a.setKey(API_Key)
a.setAdamCore(<THEMATIC-ADAM-ENDPOINT>)
a.authorize()
2. Datasets¶
This module provides the discovery functionality to get:
- the full list of available datasets
from adamapi import Datasets
datasets = Datasets(a)
items = datasets.getDatasets()
print( "Availlable datasets:")
for key in items: print( key )
- the metadata of a specific dataset
datasets = Datasets(a)
s5p_dataset = datasets.getDatasets( '57076:S5P_OFFL_L2__AER_AI_PRODUCT_AEROSOL_INDEX_340_380)
print( "Details for dataset with id 57076:S5P_OFFL_L2__AER_AI_PRODUCT_AEROSOL_INDEX_340_380:")
print( 's5p_dataset )
print( 'Dataset description:' )
print( s5p_dataset[ 'description' ] )
print( 'Dataset resolution:' )
print( s5p_dataset[ 'resolution' ] )
3. Search¶
This module provides search functionalities to retrieve the list of available products.
The getProduct() method accepts the following parameters:
position/keyword | mandatory | type | default | description |
---|---|---|---|---|
0 | True | str | The datasetId | |
outputAttributes | False | array of str | The list of attributes desired on the output dictionary. If not set all the attributes will be returned | |
maxRecords | False | 10 | Numbers of records | |
startIndex | False | 0 | Starting record index | |
startDate | False | str or [datetime] | The start date | |
completionDate | False | str or [datetime] | The end date |
It is possible to retrieve the list of all the available products and their related attributes for a dataset in a specific temporal range
from adamapi import Search
datasetId = '57076:S5P_OFFL_L2__AER_AI_PRODUCT_AEROSOL_INDEX_340_380'
search = Search(a)
search_result = search.getProducts(
datasetId,maxRecords=30,startIndex=0,outputAttributes=['productId'],startDate='2020-08-01',completionDate='2020-08-02')
print(search_result)
4. GetData¶
This modules provides a method to downoad product (GeoTiff format)
- getData() method accepts the following parameters:
position/keyword | mandatory | type | default | description |
---|---|---|---|---|
0 | True | str | The datasetId | |
1 | True | str | The productId | |
outputFname | False | str | {{productId}} | output filename pattern. if not set, the product id is the filename |
In the following example the getData method is used to retrieve a tif image. The list of available images can be discovered with the search().
from adamapi import GetData
image=data.getData('57076:S5P_OFFL_L2__AER_AI_PRODUCT_AEROSOL_INDEX_340_380', 'S5P_OFFL_L2__AER_AI_20200801T130108_20200801T144237_14516_01_010302_20200806T182656_PRODUCT_aerosol_index_340_380_4326.tif')