Skip to content

Instantly share code, notes, and snippets.

@crossi202
Last active October 13, 2016 05:57
Show Gist options
  • Save crossi202/2a04e48315363bc126ea69c1f1babb00 to your computer and use it in GitHub Desktop.
Save crossi202/2a04e48315363bc126ea69c1f1babb00 to your computer and use it in GitHub Desktop.
Instructions for the Open Data Tools Session 1 of the MELODIES Exploiting Open Data Conference

MELODIES - Exploiting Open Data

Open Data Tools - Session 2: Working with Data resources

Brussels, 13rd October 2016

Prerequisites

  • You successfully performed the Open Data Tools - Session 1: Working with Cloud resources.

Get the API key

  • Open a browser,
  • Visit https://www.terradue.com/portal/settings/apikey,
  • Click on the button Generate a new API key,
  • Type your Terradue's Cloud password,
  • Click on the button copy to clipboard,
  • Logon on the Developer Cloud Sandbox,
  • Type:
export APIKEY=<paste here the API key value>

Get the Workflow ID

  • Open a browser,
  • Visit http://sandbox-ip,
  • Click on the link Oozie Web Console,
  • Copy the workflow Job Id value,
  • Access the Developer Cloud Sandbox,
  • Type:
export WORKFLOW=<paste here the workflow Job id value>

Get the enclosure metadata

  • Access the Developer Cloud Sandbox,
  • Type:
enclosure=$( opensearch-client "http://$HOSTNAME/sbws/wps/sen2cor/$WORKFLOW/results/search" enclosure )
echo $enclosure

Download the result from HDFS

  • Type:
local_result=$( ciop-copy -f -O /tmp/ "$enclosure" )
echo $local_result

Discover the Data Gateway

Upload the result to the Data Gateway

  • Access the Developer Cloud Sandbox,
  • Type:
identifier=$( basename $local_result )
echo $identifier
curl -u $USER:$APIKEY -XPUT "https://store.terradue.com/melodies-training/$USER/$identifier" -T "$local_result"

Publish on the MELODIES Geoserver

  • Type:
password=<paste here the password provided by your instructor>
curl -u "melodies-training:$password" -XPUT -H "Content-type:image/tiff" --data-binary @$local_result "http://geoserver.melodies.terradue.int/geoserver/rest/workspaces/melodies-training/coveragestores/$USER-$identifier/file.geotiff"

Discover the available indexes on the Data Agency Catalogue

Discover the melodies-training index

Discover the result metadata on the local Sandbox Catalogue

  • Access the Developer Cloud Sandbox,
  • Type:
opensearch-client "http://$HOSTNAME/sbws/wps/sen2cor/$WORKFLOW/results/search"

Publish the result metadata on the Data Agency Catalogue

  • Type:
sh /application/util/ingest.sh

Discover the result(s) metadata on the Data Agency Catalogue

Visualise the layers on Sextant

  • Visit the link provided by your instructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment