.. _publication-metadata-generation : Metadata generation =================== Metadata is a set of information that describes actual data (in our case the outputs of a processing job) in order to make that data retrievable for further use and reprocessing. Metadata can be generated in two ways: * By using an automated generic process that extracts metadata automatically, the recast process, or * Manually with more specific knowledge of the product contents and purpose. A mixed approach by which the data is recast and then manually refined is also possible. .. _publication-recast : Using the recast service ------------------------- Recasting is the process of automatically extracting metadata from output files of processing jobs or uploaded data in order to make them searchable and retrievable for users or other applications and further processing. It also performs an analysis and publication of the data in order to ensure correct visualization on the platform. This is done by the recast web service (compliant with the OGC WPS standard) at the following URL: https://recast.terradue.com/t2api/ows?service=WPS&request=DescribeProcess&version=1.0.0&identifier=analyzeResults&status=true It requires the following input parameters: * ``repoKey``: The name of the repository. - e.g. *eo-samples* * ``folderPath``: The path to the folder (relative to the repository root) containing the files to be processed. - e.g. *data-publication-sample/data-publication-sample.tif* * ``mode``: The recasting mode, one of the values *none*, *basic* or *extended*. - Set it to *extended* in order to create also a map overlay (if possible) to be visualised in the GeoBrowser map tool. * ``_T2Username``: The name of the Terradue platform user performing the recast operation (requires reading access to the repository containing the products). * ``_T2ApiKey``: The corresponding Terradue platform API key. You can get it from your account profile on terradue.com Using the web service with Python is very simple; below is the relevant code snippet to show the basic usage: .. code-block:: python # Set WPS server information wps_url = "https://recast.terradue.com/t2api/ows" wps_process_id = "analyzeResults" # Define parameters repo_name = '...' # the name of the repository on the Terradue storage containing the data to be analysed folder_path = '...' # the folder within that repository to be analysed username = '...' # Ellip username (see above) api_key = '...' # corresponding API key wps_inputs = [ ('repoKey', repo_name), ('folderPath', folder_path), ('mode', 'extended'), ('_T2Username', username), ('_T2ApiKey', api_key) ] # Get WPS instance wps = WebProcessingService(wps_url) # Invoke recast process wps_execution = wps.execute(wps_process_id, wps_inputs, output = [('result_osd', True)] ) # Poll job status until job finishes (takes a few seconds) monitorExecution(wps_execution, sleepSecs=10) The following Jupyter notebook demonstrates how to use Python code to generate a metadata file for a product via the recast service: `Publish metadata on the Terradue catalog `_ (up to step 2). .. _publication-metadata-generation-manual : Alternative: Fully manual metadata generation --------------------------------------------- The metadata we need to generate is an ATOM feed containing entries for individual products. A product often consist of several files (if not packaged as a zipped archive), and those files are enclosure links within the same entry. .. code-block:: xml data-publication-sample data-publication-sample 2019-04-23T13:16:10.643Z 2019-04-24T08:45:54.447055Z https://creativecommons.org/licenses/by/4.0 SAMPLE_TYPE 40.604756 13.587901 41.234180 13.737746 41.077912 14.856833 40.448583 14.695978 40.604756 13.587901 2017-02-11T05:10:43.490699Z/2018-01-01T05:10:51.413166Z data-publication-sample ... The ```` node contains the most important information, and there can also be specialised subtypes for different types of data (e.g. RADAR or optical products). Below is an example for SAR metadata: .. code-block:: xml 2017-02-11T05:10:43.490699Z 2018-01-01T05:10:51.413166Z PLATFORM INSTRUMENT Sample Instrument RADAR IW 22 Right 40.604756 13.587901 41.234180 13.737746 41.077912 14.856833 40.448583 14.695978 40.604756 13.587901 EPSG4326 EPSG4326 31624950 data-publication-sample OTHER SAMPLE_TYPE ARCHIVED ON-LINE NOMINAL DEGRADED Sample processing centre 2018-05-22T23:32:23Z Sample method Sample processor 2.5 L2 ASCII verticalResolution 37 .. note:: Vendor-specific information for which there are no standard elements in the metadata schema has to go into the ```` node within the ```` element (see at the bottom of content above).