C# WasdiLib

public class Wasdi

Fields

m_sUser

private string m_sUser

Constructors

Wasdi

public Wasdi()

Self constructor. If there is a config file initializes the class members

Methods

Init

public bool Init(string sConfigFilePath)

Init the WASDI Library starting from a configuration file. If the path is not provided, the application will attempt to use the conventional appsettings.json file.

Parameters:
  • sConfigFilePath – the name of the file to be added to the open workspace

Returns:

True if the system is initialized, False if there is any error

InternalInit

public bool InternalInit(string sConfigFilePath)

Call this after base parameters settings to init the system. Needed at least: Base Path, User, Password or SessionId.

Returns:

True if the system is initialized, False if there is any error

AddFileToWASDI

public string AddFileToWASDI(string sFileName)

Adds a generated file to current open workspace in a synchronous way.

Parameters:
  • sFileName – the name of the file to be added to the open workspace

Returns:

the process Id or empty string in case of any issues

GetDefaultProvider

public string GetDefaultProvider()

Explicit accessor for the defaultProvider property.

Returns:

the defaultProvider

SetDefaultProvider

public void SetDefaultProvider(string sProvider)

Explicit mutator for the defaultProvider property.

Parameters:
  • sProvider – the provider to be used by default

GetUser

public string GetUser()

Explicit accessor for the user property.

Returns:

the user

SetUser

public void SetUser(string sUser)

Explicit mutator for the user property.

Parameters:
  • sUser – the user

GetPassword

public string GetPassword()

Explicit accessor for the password property.

Returns:

the password

SetPassword

public void SetPassword(string sPassword)

Explicit mutator for the password property.

Parameters:
  • sPassword – the password

GetActiveWorkspace

public string GetActiveWorkspace()

Explicit accessor for the activeWorkspace property.

Returns:

the activeWorkspace

SetActiveWorkspace

public void SetActiveWorkspace(string sNewActiveWorkspaceId)

Explicit mutator for the activeWorkspace property. If the new active workspace is not null, sets also the workspace owner.

Parameters:
  • sNewActiveWorkspaceId – the new Id of the activeWorkspace

GetSessionId

public string GetSessionId()

Explicit accessor for the sessionId property.

Returns:

the sessionId

SetSessionId

public void SetSessionId(string sSessionId)

Explicit mutator for the sessionId property. Sets the sessionId only if the input is not null.

Parameters:
  • sSessionId – the sessionId

GetBaseUrl

public string GetBaseUrl()

Explicit accessor for the baseUrl property.

Returns:

the baseUrl

SetBaseUrl

public void SetBaseUrl(string sBaseUrl)

Explicit mutator for the baseUrl property. Sets the baseUrl only if the input is not null and if it represents a valid URI.

Parameters:
  • sBaseUrl – the new baseUrl

GetIsOnServer

public bool GetIsOnServer()

Explicit accessor for the isOnServer property.

Returns:

True if the application is deployed on server, False if it is running on local development machine

SetIsOnServer

public void SetIsOnServer(bool bIsOnServer)

Explicit mutator for the isOnServer property.

Parameters:
  • bIsOnServer – Indicates whether the application is deployed on server or running on local development machine

GetDownloadActive

public bool GetDownloadActive()

Explicit accessor for the downloadActive property.

Returns:

the value of the downloadActive flag

SetDownloadActive

public void SetDownloadActive(bool bDownloadActive)

Explicit mutator for the downloadActive property.

Parameters:
  • bDownloadActive – the desired value of the downloadActive flag

GetBasePath

public string GetBasePath()

Explicit accessor for the basePath property.

Returns:

the basePath

SetBasePath

public void SetBasePath(string sBasePath)

Explicit mutator for the basePath property. Sets the basePath only if the input is not null and if it represents a valid path and the user has the permissions to read and write.

Parameters:
  • sBasePath – the new basePath

GetMyProcId

public string GetMyProcId()

Explicit accessor for the myProcId property.

Returns:

the myProcId

SetMyProcId

public void SetMyProcId(string sMyProcId)

Explicit mutator for the myProcId property. Set the myProcessId only if the input is not null or empty.

Parameters:
  • sMyProcId – the value of myProcId

GetVerbose

public bool GetVerbose()

Explicit accessor for the verbose property.

Returns:

the value of the verbose flag

SetVerbose

public void SetVerbose(bool bVerbose)

Explicit mutator for the verbose property. If the verbose flag is set to True, the level of logging is INFORMATION. If the verbose flag is set to False, the level of logging is ERROR.

Parameters:
  • bVerbose – the desired value of the verbose flag

GetParams

public Dictionary<string, string> GetParams()

Get the parameters (except for the user, sessionId and workspaceid).

Returns:

the Params dictionary

GetParamsAsJsonString

public string GetParamsAsJsonString()

Get the parameters in Json format.

Returns:

the parameters as a Json string

AddParam

public void AddParam(string sKey, string sParam)

Add a parameter to the parameters dictionary.

Parameters:
  • sKey – the new key

  • sParam – the new value

GetParam

public string GetParam(string sKey)

Get a specific parameter from the parameters dictionary. If the key is not contained by the dictionary, an empty string is returned.

Parameters:
  • sKey – the key

Returns:

the value corresponding to the key or an empty string

GetParametersFilePath

public string GetParametersFilePath()

Explicit accessor for the parametersFilePath property.

Returns:

the parameters file path

SetParametersFilePath

public void SetParametersFilePath(string sParametersFilePath)

Sets the parametersFilePath only if the input is not null and if it represents a valid path.

Parameters:
  • sParametersFilePath – the parameters file path

CreateSession

public string CreateSession(string sUser, string sPassword)

Create a new session and return its Id.

Parameters:
  • sUser – the username

  • sPassword – the password

Returns:

the newly created sessionId

CheckSession

public string CheckSession(string sSessionId, string sUser)

Check the session.

Parameters:
  • sSessionId – the actual session Id

  • sUser – the username of the expected user

Returns:

True if the actual user is the same as the expected user, false otherwise

GetWorkspaceBaseUrl

public string GetWorkspaceBaseUrl()

Explicit accessor for the workspaceBaseUrl property.

Returns:

the workspace’s baseUrl

SetWorkspaceBaseUrl

public void SetWorkspaceBaseUrl(string sWorkspaceBaseUrl)

Sets the workspace’s baseUrl only if the input is not null and if it represents a valid URI.

Parameters:
  • sWorkspaceBaseUrl – the new baseUrl of the workspace

Hello

public string Hello()

Call the hello endpoint and return thre response.

Returns:

the response of the server or null in case of any error

GetWorkspaces

public List<Workspace> GetWorkspaces()

Get the list of workspaces of the logged user.

Returns:

the list of workspaces or null in case of any error

GetWorkspacesNames

public List<string> GetWorkspaces()

Get the list of workspaces’ names of the logged user.

Returns:

the list of workspaces’ names or an empty list in case of any error

GetWorkspaceIdByName

public string GetWorkspaceIdByName(string sWorkspaceName)

Get the Id of a workspace identified by name.

Parameters:
  • sWorkspaceName – the name of the workspace

Returns:

the Id of the workspace or an empty string in case of an error or if there is no workspace with the name indicated

GetWorkspaceNameById

public string GetWorkspaceNameById(string sWorkspacesId)

Get the name of a workspace identified by Id.

Parameters:
  • sWorkspacesId – the Id of the workspace

Returns:

the name of the workspace or an empty string in case of an error or if there is no workspace with the Id indicated

GetWorkspaceOwnerByName

public string GetWorkspaceOwnerByName(string sWorkspacesId)

Get the userId of the owner of a workspace identified by name.

Parameters:
  • sWorkspacesId – the name of the workspace

Returns:

the user Id of the workspace’s owner or an empty string in case of an error or if there is no workspace with the name indicated

GetWorkspaceOwnerByWSId

public string GetWorkspaceOwnerByWSId(string sWorkspaceId)

Get the userId of the owner of a workspace identified by Id.

Parameters:
  • sWorkspaceId – the Id of the workspace

Returns:

the user Id of the workspace’s owner or an empty string in case of an error or if there is no workspace with the Id indicated

GetWorkspaceUrlByWsId

public string GetWorkspaceUrlByWsId(string sWorkspaceId)

Get the workspace’s URL of a workspace identified by Id.

Parameters:
  • sWorkspaceId – the Id of the workspace

Returns:

the workspace’s URL or an empty string in case of an error or if there is no workspace with the Id indicated

OpenWorkspaceById

public string OpenWorkspaceById(string sWorkspaceId)

Open a workspace given its Id.

Parameters:
  • sWorkspaceId – the Id of the workspace

Returns:

the workspace Id if opened successfully, empty string otherwise

OpenWorkspace

public string OpenWorkspace(string sWorkspaceName)

Open a workspace.

Parameters:
  • sWorkspaceName – Workspace name to open

Returns:

the workspace Id if opened successfully, empty string otherwise

GetProductsByWorkspace

public List<string> GetProductsByWorkspace(string sWorkspaceName)

Get a List of the products in a workspace.

Parameters:
  • sWorkspaceName – the name of the workspace

Returns:

List of Strings representing the product names

GetProductsByWorkspaceId

public List<string> GetProductsByWorkspaceId(string sWorkspaceId)

Get a List of the products in a Workspace

Parameters:
  • sWorkspaceId – the Id of the workspace

Returns:

List of Strings representing the product names

GetProductsByActiveWorkspace

public List<string> GetProductsByWorkspaceId()

Get a List of the products in the active workspace

Returns:

List of Strings representing the product names

GetProductName

public string GetProductName(Dictionary<string, object> oProduct)

Get the name of the product provided. For the names starting with S1 or S2, add the .zip extension in case it is missing.

Parameters:
  • oProduct – the product

Returns:

the name of the product or null in case of any error

ImportAndPreprocessWithLinks

public void ImportAndPreprocessWithLinks(List<string> asProductsLink, List<string> asProductsNames, string sWorkflow, string sPreProcSuffix, string sProvider)

Import and pre-process with links.

Parameters:
  • asProductsLink – the list of product links

  • asProductsNames – the list of product names

  • sWorkflow – the workflow

  • sPreProcSuffix – the pre-process suffix

  • sProvider – the provider

ImportAndPreprocess

public void ImportAndPreprocess(List<Dictionary<string, object>> aoProductsToImport, string sWorkflow, string sPreProcSuffix)

Import and pre-process.

Parameters:
  • aoProductsToImport – the list of products

  • sWorkflow – the workflow

  • sPreProcSuffix – the pre-process suffix

ImportAndPreprocess

public void ImportAndPreprocess(List<Dictionary<string, object>> aoProductsToImport, string sWorkflow, string sPreProcSuffix, string sProvider)

Import and pre-process.

Parameters:
  • aoProductsToImport – the list of products

  • sWorkflow – the workflow

  • sPreProcSuffix – the pre-process suffix

  • sProvider – the provider

AsynchPreprocessProductsOnceDownloaded

public List<string> AsynchPreprocessProductsOnceDownloaded(List<Dictionary<string, object>> aoProductsToImport, string sWorkflow, string sPreProcSuffix, List<string> asDownloadIds)

Asynchronously pre-process products once ther are downloaded.

Parameters:
  • aoProductsToImport – the list of products

  • sWorkflow – the workflow

  • sPreProcSuffix – the pre-process suffix

  • asDownloadIds – the list of downloads Ids

Returns:

the list of workflow ids

AsynchPreprocessProductsOnceDownloadedWithNames

public List<string> AsynchPreprocessProductsOnceDownloadedWithNames(List<string> asProductsNames, string sWorkflow, string sPreProcSuffix, List<string> asDownloadIds)

Asynchronously pre-process products once ther are downloaded and names are provided.

Parameters:
  • asProductsNames – the list of product names

  • sWorkflow – the workflow

  • sPreProcSuffix – the pre-process suffix

  • asDownloadIds – the list of downloads Ids

Returns:

the list of workflow ids

GetPath

public string GetPath(string sProductName)

Get the local path of a file.

Parameters:
  • sProductName – the name of the file

Returns:

the full local path

InternalGetFullProductPath

public string InternalGetFullProductPath(string sProductName)

Get the full local path of a product given the product name. Use the output of this API to open the file.

Parameters:
  • sProductName – the product name

Returns:

the product’s full path as a String ready to open file

GetSavePath

public string GetSavePath()

Get the local Save Path to use to save custom generated files.

Returns:

the local path to use to save a custom generated file

GetWorkflows

public List<Workflow> GetWorkflows()

Get the list of workflows for the user.

Returns:

the list of the workflows or null in case of any error

AsynchExecuteWorkflow

public string AsynchExecuteWorkflow(List<string> asInputFileNames, List<string> asOutputFileNames, string sWorkflowName)

Executes a WASDI SNAP Workflow in a asynch mode.

Parameters:
  • asInputFileNames – the list of input file names

  • asOutputFileNames – the list of output file names

  • sWorkflowName – the workflow’s name

Returns:

the Id of the workflow process or empty string in case of any issue

ExecuteWorkflow

public string AsynchExecuteWorkflow(List<string> asInputFileNames, List<string> asOutputFileNames, string sWorkflowName)

Executes a WASDI SNAP Workflow waiting for the process to finish.

Parameters:
  • asInputFileNames – the list of input file names

  • asOutputFileNames – the list of output file names

  • sWorkflowName – the workflow’s name

Returns:

output status of the Workflow Process

GetProcessStatus

public string GetProcessStatus(string sProcessId)

Get WASDI Process Status.

Parameters:
  • sProcessId – the process’s Id

Returns:

process Status as a String: CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

GetProcessesStatus

public string GetProcessesStatus(List<string> asIds)

Get the status of a List of WASDI processes.

Parameters:
  • asIds – the list of processes Ids

Returns:

Process Status as a String: CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

GetProcessesStatusAsList

public string GetProcessesStatusAsList(List<string> asIds)

Get the status of a List of WASDI processes.

Parameters:
  • asIds – the list of processes Ids

Returns:

Process Status as a String: CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

UpdateStatus

public string UpdateStatus(string sStatus)

Update the status of the current process.

Parameters:
  • sStatus – the status to set

Returns:

updated status as a String or empty string in case of any issue

UpdateStatus

public string UpdateStatus(string sStatus, int iPerc)

Update the status of the current process.

Parameters:
  • sStatus – the status to set

  • iPerc – the progress in %

Returns:

updated status as a String or empty string in case of any issue

UpdateProcessStatus

public string UpdateProcessStatus(string sProcessId, string sStatus, int iPerc)

Update the status of a process.

Parameters:
  • sProcessId – the process Id

  • sStatus – the status to set

  • iPerc – the progress in %

Returns:

updated status as a String or empty string in case of any issue

UpdateProgressPerc

public string UpdateProgressPerc(int iPerc)

Update the status of a process.

Parameters:
  • iPerc – the progress in %

Returns:

updated status as a String or empty string in case of any issue

WaitProcess

public string WaitProcess(string sProcessId)

Wait for a process to finish.

Parameters:
  • sProcessId – the process Id

Returns:

the process status

WaitProcesses

public List<string> WaitProcesses(List<string> asIds)

Wait for a collection of processes to finish.

Parameters:
  • asIds – the list of processes Ids

Returns:

the list of process statuses

SetPayload

public void SetPayload(string sData)

Set the payload of the current process (only if the input is not null or empty).

Parameters:
  • sData – the payload as a String. JSON format recommended

SetProcessPayload

public string SetProcessPayload(string sProcessId, string sData)

Set the payload of the current process (only if the input is not null or empty).

Parameters:
  • sProcessId – the process Id

  • sData – the payload as a String. JSON format recommended

Returns:

the status of the process or empty string in case of any issues

RefreshParameters

public void RefreshParameters()

Refresh Parameters reading again the file.

AddFileToWASDI

public string AddFileToWASDI(string sFileName, string sStyle)

Adds a generated file to current open workspace in synchronous way.

Parameters:
  • sFileName – the name of the file to be added to the open workspace

  • sStyle – name of a valid WMS style

Returns:

the process Id or empty string in case of any issues

AsynchAddFileToWASDI

public string AsynchAddFileToWASDI(string sFileName, string sStyle)

Adds a generated file to current open workspace in asynchronous way.

Parameters:
  • sFileName – the name of the file to be added to the open workspace

  • sStyle – name of a valid WMS style

Returns:

the process Id or empty string in case of any issues

AddFileToWASDI

public string AddFileToWASDI(string sFileName)

Adds a generated file to current open workspace in synchronous way.

Parameters:
  • sFileName – the name of the file to be added to the open workspace

Returns:

the process Id or empty string in case of any issues

AsynchAddFileToWASDI

public string AsynchAddFileToWASDI(string sFileName)

Adds a generated file to current open workspace in asynchronous way.

Parameters:
  • sFileName – the name of the file to be added to the open workspace

Returns:

the process Id or empty string in case of any issues

Mosaic

public string Mosaic(List<string> asInputFiles, string sOutputFile)

Mosaic with minimum parameters: input and output files.

Parameters:
  • asInputFiles – the list of input files to mosaic

  • sOutputFile – the name of the mosaic output file

Returns:

the end status of the process

Mosaic

public string Mosaic(List<string> asInputFiles, string sOutputFile, string sNoDataValue, string sInputIgnoreValue)

Mosaic with minimum parameters: input and output files.

Parameters:
  • asInputFiles – the list of input files to mosaic

  • sOutputFile – the name of the mosaic output file

  • sNoDataValue – the value to use in output as no data

  • sInputIgnoreValue – the value to use as input no data

Returns:

the end status of the process

Mosaic

public string Mosaic(List<string> asInputFiles, string sOutputFile, string sNoDataValue, string sInputIgnoreValue, double dPixelSizeX, double dPixelSizeY)

Mosaic with minimum parameters: input and output files.

Parameters:
  • asInputFiles – the list of input files to mosaic

  • sOutputFile – the name of the mosaic output file

  • sNoDataValue – the value to use in output as no data

  • sInputIgnoreValue – the value to use as input no data

  • dPixelSizeX – the X Pixel Size

  • dPixelSizeY – the Y Pixel Size

Returns:

the end status of the process

AsynchMosaic

public string Mosaic(List<string> asInputFiles, string sOutputFile)

Asynch Mosaic with minimum parameters: input and output files.

Parameters:
  • asInputFiles – the list of input files to mosaic

  • sOutputFile – the name of the mosaic output file

Returns:

the end status of the process

AsynchMosaic

public string Mosaic(List<string> asInputFiles, string sOutputFile, string sNoDataValue, string sInputIgnoreValue)

Asynch Mosaic with minimum parameters: input and output files.

Parameters:
  • asInputFiles – the list of input files to mosaic

  • sOutputFile – the name of the mosaic output file

  • sNoDataValue – the value to use in output as no data

  • sInputIgnoreValue – the value to use as input no data

Returns:

the end status of the process

AsynchMosaic

public string Mosaic(List<string> asInputFiles, string sOutputFile, string sNoDataValue, string sInputIgnoreValue, double dPixelSizeX, double dPixelSizeY)

Asynch Mosaic with minimum parameters: input and output files.

Parameters:
  • asInputFiles – the list of input files to mosaic

  • sOutputFile – the name of the mosaic output file

  • sNoDataValue – the value to use in output as no data

  • sInputIgnoreValue – the value to use as input no data

  • dPixelSizeX – the X Pixel Size

  • dPixelSizeY – the Y Pixel Size

Returns:

the end status of the process

SearchEOImages

public List<QueryResult> SearchEOImages(string sPlatform, string sDateFrom, string sDateTo, Double dULLat, Double dULLon, Double dLRLat, Double dLRLon, string sProductType, int iOrbitNumber, string sSensorOperationalMode, string sCloudCoverage)

Search EO-Images

Parameters:
  • sPlatform – the Satellite Platform. Accepts “S1”,”S2”,”S3”,”S5P”,”ENVI”,”L8”,”VIIRS”,”ERA5”

  • sDateFrom – the Starting date in format “YYYY-MM-DD”

  • sDateTo – the End date in format “YYYY-MM-DD”

  • dULLat – Upper Left Lat Coordinate. Can be null.

  • dULLon – Upper Left Lon Coordinate. Can be null.

  • dLRLat – Lower Right Lat Coordinate. Can be null.

  • dLRLon – Lower Right Lon Coordinate. Can be null.

  • sProductType – the Product Type. If Platform = “S1” -> Accepts “SLC”,”GRD”, “OCN”. If Platform = “S2” -> Accepts “S2MSI1C”,”S2MSI2Ap”,”S2MSI2A”. Can be null.

  • iOrbitNumber – the Sentinel Orbit Number. Can be null.

  • sSensorOperationalMode – the Sensor Operational Mode. ONLY for S1. Accepts -> “SM”, “IW”, “EW”, “WV”. Can be null. Ignored for Platform “S2”

  • sCloudCoverage – the Cloud Coverage. Sample syntax: [0 TO 9.4]

Returns:

the list of the available products

GetFoundProductName

public string GetFoundProductName(QueryResult oProduct)

Get the name of a Product found by searchEOImage.

Parameters:
  • oProduct – the Product as returned by searchEOImage

Returns:

the name of the product

GetFoundProductName

public string GetFoundProductName(Dictionary<string, object> oProduct)

Get the name of a Product found by searchEOImage.

Parameters:
  • oProduct – the JSON Dictionary Product as returned by searchEOImage

Returns:

the name of the product

GetFoundProductLink

public string GetFoundProductLink(Dictionary<string, object> oProduct)

Get the direct download link of a Product found by searchEOImage.

Parameters:
  • oProduct – the JSON Dictionary Product as returned by searchEOImage

Returns:

the link of the product

GetFoundProductFootprint

public string GetFoundProductFootprint(QueryResult oProduct)

Get the footprint of a Product found by searchEOImage.

Parameters:
  • oProduct – the Product as returned by searchEOImage

Returns:

the footprint of the product

GetFoundProductFootprint

public string GetFoundProductFootprint(Dictionary<string, object> oProduct)

Get the footprint of a Product found by searchEOImage.

Parameters:
  • oProduct – the JSON Dictionary Product as returned by searchEOImage

Returns:

the footprint of the product

AsynchImportProduct

public string AsynchImportProduct(Dictionary<string, object> oProduct)

Asynchronously import a product.

Parameters:
  • oProduct – the product to be imported

Returns:

the status of the Import process

AsynchImportProduct

public string AsynchImportProduct(Dictionary<string, object> oProduct, string sProvider)

Asynchronously import a product.

Parameters:
  • oProduct – the product to be imported

  • sProvider – the provider of choice. If null, the default provider will be used

Returns:

the status of the Import process

ImportProduct

public string ImportProduct(Dictionary<string, object> oProduct)

Import a Product from a Provider in WASDI.

Parameters:
  • oProduct – the product to be imported

Returns:

the status of the Import process

ImportProduct

public string ImportProduct(QueryResult oProduct)

Import a Product from a Provider in WASDI.

Parameters:
  • oProduct – the product to be imported

Returns:

the status of the Import process

ImportProduct

public string ImportProduct(string sFileUrl, string sFileName)

Import a Product from a Provider in WASDI.

Parameters:
  • sFileUrl – the Direct link of the product

  • sFileName – the name of the file

Returns:

the status of the Import process

ImportProduct

public string ImportProduct(string sFileUrl, string sFileName, string sBoundingBox)

Import a Product from a Provider in WASDI.

Parameters:
  • sFileUrl – the Direct link of the product

  • sFileName – the name of the file

  • sBoundingBox – the bounding box

Returns:

the status of the Import process

ImportProduct

public string ImportProduct(string sFileUrl, string sFileName, string sBoundingBox, string sProvider)

Import a Product from a Provider in WASDI.

Parameters:
  • sFileUrl – the Direct link of the product

  • sFileName – the name of the file

  • sBoundingBox – the bounding box

  • sProvider – the provider

Returns:

the status of the Import process

AsynchImportProduct

public string AsynchImportProduct(string sFileUrl, string sFileName)

Import a Product from a Provider in WASDI asynchronously.

Parameters:
  • sFileUrl – the Direct link of the product

  • sFileName – the name of the file

Returns:

the status of the Import process

AsynchImportProduct

public string AsynchImportProduct(string sFileUrl, string sFileName, string sBoundingBox)

Import a Product from a Provider in WASDI asynchronously.

Parameters:
  • sFileUrl – the Direct link of the product

  • sFileName – the name of the file

  • sBoundingBox – the bounding box

Returns:

the status of the Import process

AsynchImportProduct

public string AsynchImportProduct(string sFileUrl, string sFileName, string sBoundingBox, string sProvider)

Import a Product from a Provider in WASDI asynchronously.

Parameters:
  • sFileUrl – the Direct link of the product

  • sFileName – the name of the file

  • sBoundingBox – the bounding box

  • sProvider – the provider

Returns:

the status of the Import process

AsynchImportProductListWithMaps

public List<string> AsynchImportProductListWithMaps(List<Dictionary<string, object>> aoProductsToImport)

Imports a list of product asynchronously.

Parameters:
  • aoProductsToImport – the list of products to import

Returns:

a list of String containing the WASDI process ids of all the imports

AsynchImportProductList

public List<string> AsynchImportProductList(List<string> asProductsToImport, List<string> asNames)

Imports a list of product asynchronously.

Parameters:
  • asProductsToImport – the list of products to import

  • asNames – the list of names

Returns:

a list of String containing the WASDI process ids of all the imports

ImportProductListWithMaps

public List<string> ImportProductListWithMaps(List<Dictionary<string, object>> aoProductsToImport)

Imports a list of product.

Parameters:
  • aoProductsToImport – the list of products to import

Returns:

a list of String containing the WASDI process ids of all the imports

ImportProductList

public List<string> ImportProductList(List<string> asProductsToImport, List<string> asNames)

Imports a list of product.

Parameters:
  • asProductsToImport – the list of products to import

  • asNames – the list of names

Returns:

a list of String containing the WASDI process ids of all the imports

Subset

public string Subset(string sInputFile, string sOutputFile, double dLatN, double dLonW, double dLatS, double dLonE)

Make a Subset (tile) of an input image in a specified Lat Lon Rectangle.

Parameters:
  • sInputFile – the name of the input file

  • sOutputFile – the name of the output file

  • dLatN – the Lat North Coordinate

  • dLonW – the Lon West Coordinate

  • dLatS – the Lat South Coordinate

  • dLonE – the Lon East Coordinate

Returns:

the status of the operation

MultiSubset

public string MultiSubset(string sInputFile, List<string> asOutputFiles, List<Double> adLatN, List<Double> adLonW, List<Double> adLatS, List<Double> adLonE)

Creates a Many Subsets from an image. MAX 10 TILES PER CALL. Assumes big tiff format by default.

Parameters:
  • sInputFile – the name of the input file

  • asOutputFiles – the name of the output file

  • adLatN – the list of Lat North Coordinates

  • adLonW – the list of Lon West Coordinates

  • adLatS – the list of Lat South Coordinates

  • adLonE – the list of Lon East Coordinates

Returns:

the status of the operation

MultiSubset

public string MultiSubset(string sInputFile, List<string> asOutputFiles, List<Double> adLatN, List<Double> adLonW, List<Double> adLatS, List<Double> adLonE, bool bBigTiff)

Creates a Many Subsets from an image. MAX 10 TILES PER CALL.

Parameters:
  • sInputFile – the name of the input file

  • asOutputFiles – the name of the output file

  • adLatN – the list of Lat North Coordinates

  • adLonW – the list of Lon West Coordinates

  • adLatS – the list of Lat South Coordinates

  • adLonE – the list of Lon East Coordinates

  • bBigTiff – flag indicating whether to use the bigtiff format, for files bigger than 4 GB

Returns:

the status of the operation

AsynchMultiSubset

public string MultiSubset(string sInputFile, List<string> asOutputFiles, List<Double> adLatN, List<Double> adLonW, List<Double> adLatS, List<Double> adLonE)

Asynchronous multisubset: creates a Many Subsets from an image. MAX 10 TILES PER CALL. Assumes big tiff format by default.

Parameters:
  • sInputFile – the name of the input file

  • asOutputFiles – the name of the output file

  • adLatN – the list of Lat North Coordinates

  • adLonW – the list of Lon West Coordinates

  • adLatS – the list of Lat South Coordinates

  • adLonE – the list of Lon East Coordinates

Returns:

the status of the operation

AsynchMultiSubset

public string MultiSubset(string sInputFile, List<string> asOutputFiles, List<Double> adLatN, List<Double> adLonW, List<Double> adLatS, List<Double> adLonE, bool bBigTiff)

Asynchronous multisubset: creates a Many Subsets from an image. MAX 10 TILES PER CALL.

Parameters:
  • sInputFile – the name of the input file

  • asOutputFiles – the name of the output file

  • adLatN – the list of Lat North Coordinates

  • adLonW – the list of Lon West Coordinates

  • adLatS – the list of Lat South Coordinates

  • adLonE – the list of Lon East Coordinates

  • bBigTiff – flag indicating whether to use the bigtiff format, for files bigger than 4 GB

Returns:

the status of the operation

ExecuteProcessor

public string ExecuteProcessor(string sProcessorName, Dictionary<string, object> aoParams)

Executes a synchronous process, i.e., runs the process and waits for it to complete.

Parameters:
  • sProcessorName – the name of the processor

  • aoParams – the dictionary of params

Returns:

the WASDI processor Id

AsynchExecuteProcessor

public string AsynchExecuteProcessor(string sProcessorName, Dictionary<string, object> aoParams)

Execute a WASDI processor in Asynch way.

Parameters:
  • sProcessorName – the name of the processor

  • aoParams – the dictionary of params

Returns:

the WASDI processor Id

ExecuteProcessor

public string ExecuteProcessor(string sProcessorName, string sEncodedParams)

Executes a synchronous process, i.e., runs the process and waits for it to complete.

Parameters:
  • sProcessorName – the name of the processor

  • sEncodedParams – a JSON formatted string of parameters for the processor

Returns:

the WASDI processor Id

AsynchExecuteProcessor

public string AsynchExecuteProcessor(string sProcessorName, string sEncodedParams)

Execute a WASDI processor in Asynch way.

Parameters:
  • sProcessorName – the name of the processor

  • sEncodedParams – a JSON formatted string of parameters for the processor

Returns:

the WASDI processor Id

DeleteProduct

public string DeleteProduct(string sProduct)

Delete a Product in the active Workspace.

Parameters:
  • sProduct – the product’s name

Returns:

the status of the operation

WasdiLog

public void WasdiLog(string sLogRow)

Write one row of Log.

Parameters:
  • sLogRow – the text to log

GetProcessorPath

public string GetProcessorPath()

Get the processor Path. The value should resemble the following path: C:/dev/WasdiLib.Client/bin/Debug/net6.0

Returns:

the processor path

CreateWorkspace

public string CreateWorkspace(string sWorkspaceName)

Create a workspace using the provided name. Once the workspace is created, it is also opened.

Parameters:
  • sWorkspaceName – the name of the workspace

Returns:

the Id of the newly created workspace or empty string in case of any issues

CreateWorkspace

public string CreateWorkspace(string sWorkspaceName, string nodeCode)

Create a workspace using the provided name on the indicated node. Once the workspace is created, it is also opened.

Parameters:
  • sWorkspaceName – the name of the workspace

  • nodeCode – the node on which to create the workspace

Returns:

the Id of the newly created workspace or empty string in case of any issues

DeleteWorkspace

public string DeleteWorkspace(string workspaceId)

Deletes the workspace given its Id.

Parameters:
  • workspaceId – the Id of the workspace

Returns:

the Id of the workspace as a String if succesful, empty string otherwise

GetProcessWorkspacesByWorkspaceId

public List<ProcessWorkspace> GetProcessWorkspacesByWorkspaceId(string workspaceId)

Get the process workspaces by workspace id

Parameters:
  • workspaceId – the Id of the workspace

Returns:

the list of process workspaces or an empty list in case of any issues

GetProcessesByWorkspaceAsListOfJson

public List<string> GetProcessesByWorkspaceAsListOfJson(int iStartIndex, Int32 iEndIndex, string sStatus, string sOperationType, string sNamePattern)

Get a paginated list of processes in the active workspace, each element of which is a JSON string.

Parameters:
  • iStartIndex – the start index of the process (0 by default is the last one)

  • iEndIndex – the end index of the process (optional)

  • sStatus – the status filter, null by default. Can be CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

  • sOperationType – the Operation Type Filter, null by default. Can be RUNPROCESSOR, RUNIDL, RUNMATLAB, INGEST, DOWNLOAD, GRAPH, DEPLOYPROCESSOR

  • sNamePattern – the Name filter. The name meaning depends by the operation type, null by default. For RUNPROCESSOR, RUNIDL and RUNMATLAB is the name of the application

Returns:

a list of process IDs

GetProcessesByWorkspace

public List<string> GetProcessesByWorkspaceAsListOfJson(int iStartIndex, Int32 iEndIndex, string sStatus, string sOperationType, string sNamePattern)

Get a paginated list of processes in the active workspace.

Parameters:
  • iStartIndex – the start index of the process (0 by default is the last one)

  • iEndIndex – the end index of the process (optional)

  • sStatus – the status filter, null by default. Can be CREATED, RUNNING, STOPPED, DONE, ERROR, WAITING, READY

  • sOperationType – the Operation Type Filter, null by default. Can be RUNPROCESSOR, RUNIDL, RUNMATLAB, INGEST, DOWNLOAD, GRAPH, DEPLOYPROCESSOR

  • sNamePattern – the Name filter. The name meaning depends by the operation type, null by default. For RUNPROCESSOR, RUNIDL and RUNMATLAB is the name of the application

Returns:

a list of process IDs

GetProcessorPayload

public Dictionary<string, object> GetProcessorPayload(string sProcessObjId)

Gets the processor payload as a dictionary.

Parameters:
  • sProcessObjId – the Id of the processor

Returns:

the processor payload as a dictionary

GetProcessorPayloadAsJSON

public Dictionary<string, object> GetProcessorPayloadAsJSON(string sProcessObjId)

Retrieve the payload of a processor formatted as a JSON string.

Parameters:
  • sProcessObjId – the Id of the processor

Returns:

the payload as a JSON string, or null if error occurred

GetProductBbox

public string GetProductBbox(string sFileName)

Get the product bounding box.

Parameters:
  • sFileName – the file name

Returns:

the product bounding box

DownloadFile

public string DownloadFile(string sFileName)

Download a file on the local PC.

Parameters:
  • sFileName – the name of the file

Returns:

the full path of the file

UploadFile

public bool UploadFile(string sFileName)

Uploads and ingest a file in WASDI.

Parameters:
  • sFileName – the name of the file to upload

Returns:

True if the file was uploaded, False otherwise

Throws:

CopyFileToSftp

public string CopyFileToSftp(string sFileName)

Copy a file from a workspace to the WASDI user’s SFTP Folder in a synchronous way.

Parameters:
  • sFileName – the filename to move to the SFTP folder

Returns:

the Process Id is synchronous execution, end status otherwise. An empty string is returned in case of failure

CopyFileToSftp

public string CopyFileToSftp(string sFileName, string sRelativePath)

Copy a file from a workspace to the WASDI user’s SFTP Folder in a synchronous way.

Parameters:
  • sFileName – the filename to move to the SFTP folder

  • sRelativePath – the relative path in the SFTP root

Returns:

the Process Id is synchronous execution, end status otherwise. An empty string is returned in case of failure

AsynchCopyFileToSftp

public string CopyFileToSftp(string sFileName)

Copy a file from a workspace to the WASDI user’s SFTP Folder in a asynchronous way.

Parameters:
  • sFileName – the filename to move to the SFTP folder

Returns:

the Process Id is asynchronous execution, end status otherwise. An empty string is returned in case of failure

AsynchCopyFileToSftp

public string CopyFileToSftp(string sFileName, string sRelativePath)

Copy a file from a workspace to the WASDI user’s SFTP Folder in a asynchronous way.

Parameters:
  • sFileName – the filename to move to the SFTP folder

  • sRelativePath – the relative path in the SFTP root

Returns:

the Process Id is asynchronous execution, end status otherwise. An empty string is returned in case of failure

SetSubPid

public string SetSubPid(string sProcessId, int iSubPid)

Sets the sub pid.

Parameters:
  • sProcessId – the process Id

  • iSubPid – the subPid of the process

Returns:

the updated status of the processs

PrintStatus

public void PrintStatus()

Print the status information ot the Wasdi application.