Saturday 26 November 2016

SAP Earth Observation Analysis Microservices on YaaS

Getting Started:

The following describes the steps to use the SAP Earth Observation Analysis service:

1. Sign In under My Account on YaaS. If not a member, you will need to Register under My Account on YaaS. It is free.
2. Go to the YaaS Market and choose the option Worldwide (Beta) at the top-right corner of the window. Scroll down and click on the SAP Earth Observation Analysis package.
3. Once the request for subscription is made, create a project for the organization to subscribe to a package. Enter the display name of the project as you want it to display in the Builder. The project identifier is a unique identifier.

SAP Earth Observation Analysis Microservices on YaaS

4. Click on the yellow API CONSOLE button in the API Docs page of SAP Earth Observation Analysis.

SAP Earth Observation Analysis Microservices on YaaS

5. Click on the blue GET button beside /wcs/getCapabilities.

SAP Earth Observation Analysis Microservices on YaaS

6. Click on the blue Try It tab.

SAP Earth Observation Analysis Microservices on YaaS

7. Open a new browser tab and follow the instructions how to “Create a Client”. Choose the scope as sap.eos_service and region as US. Click on the yellow Generate button to generate the authorization token.

SAP Earth Observation Analysis Microservices on YaaS

8. Paste your authorization token from the step before into the Authorization field. Remark: Make sure that the “Bearer” prefix is not lost. Then click on the blue GET.

SAP Earth Observation Analysis Microservices on YaaS

9. Scroll down to see the response.

SAP Earth Observation Analysis Microservices on YaaS

10. Celebrate your first SAP Earth Observation Analysis microservice experience on YaaS!

Getting Started using Curl:

This section describes how to use the SAP Earth Observation Analysis service via curl from your terminal. The alternative to query the offered service API as explained in Step 5 in the previous section, can be done by the following URL:

curl -H "Authorization: Bearer ACCESS_TOKEN" -X GET https://api.yaas.io/sap/earth-analysis/v1/wcs/getCapabilities

The authorization token as explained in Step 7 in previous section, can be generated alternatively by querying the following URL:

curl -X POST 'https://api.beta.yaas.io/hybris/oauth2/v1/token'  -d \
grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&scope=SERVICE_SCOPE' \
-H 'content-type: application/x-www-form-urlencoded'

The CLIENT_ID and CLIENT_SECRET are the ones obtained from Step 7 in the previous section. The SERVICE_SCOPE needs to be replaced with sap.eoa_service as already discussed. Please note that the ACCESS_TOKEN (authorization token) expires in 3,600 seconds (1 hour). However, you may generate an arbitrary number of access tokens. An example output is as follows:

{"token_type":"Bearer","access_token":"ACCESS_TOKEN","expires_in":3600,"sap_eoa_service":"hybris.tenant=eoaproject"}

It is suggested to use curl to return an image using wcs/getCoverage.

curl -H "Authorization: Bearer ACCESS_TOKEN" -X GET https://api.yaas.io/sap/earth-analysis/v1/wcs/getCoverage?
coverageId=COLORED_NDVIESAS2___S2A_OPER_PRD_MSIL1C_PDMC_20161121T222316_R108_V20161121T103332_20161121T103332T30NWN 
> image.tiff

The response for the above query is the following Geo-TIFF image:

SAP Earth Observation Analysis Microservices on YaaS

No comments:

Post a Comment