The information in this guide is only needed if you want to perform your own WCS request, for example a
To set up a connection to a WCS service you first need to create a new WCS client:
String serverURL = "https://sampleservices.luciad.com/wcs"; TLcdWCSClient wcsClient = TLcdWCSClient.createWCSClient(new URI(serverURL));
You can use one client instance for just one OGC service. Therefore, you must identify the service at construction time.
The client you just created will connect with the WCS service by retrieving its capabilities. As described in the OGC specifications, a version negotiation process will also take place to determine a commonly supported version between the web service and the web client.
When a version has been agreed, the corresponding capabilities document is cached locally. To access the document, you can
use the method
Requests are modeled by the interface
which supports (if applicable):
Key-value pair requests
You cannot instantiate these request objects directly. Instead, they are created by factory methods in the client.
The created requests are automatically initialized with the parameters
The value of the
VERSION parameter corresponds to the version agreed during the version negotiation
process upon initialization.
Each request will have a specific type of response.
The LuciadLightspeed OGC Web Client Suite offer a number of predefined response types.
The general response type
is an extension of
java.io.FilterInputStream, which adds the content type and some extra metadata to the result stream.
It is also possible to create custom requests. To support custom requests, you must override the appropriate client class, to provide access to the new requests.
Extensions can perform custom
ILcdOWSRequest implementations by invoking the protected method
Next to the request itself, the name of the operation associated with the request is required. This operation must correspond to an operation defined in the capabilities of the OGC service.
GetCapabilities is a mandatory operation supported by each OGC service.
If the operation is not supported, the request will not be performed and an
UnsupportedOperationException is thrown.
You can retrieve the list of available operations at an OGC service through the method
which returns a list of
These default implementations of the interface
ILcdOWSRequest model the mandatory WCS requests:
The request objects are created by factory methods in
// Create a GetCapabilities request TLcdWCSGetCapabilitiesRequest getCapabilitiesRequest = wcsClient.createGetCapabilitiesRequest(); // Create a DescribeCoverage request TLcdWCSDescribeCoverageRequest describeCoverageRequest = wcsClient.createDescribeCoverageRequest(); // Create a GetCoverage request TLcdWCSGetCoverageRequest getCoverageRequest = wcsClient.createGetCoverageRequest();
When the request is configured, you can send it to the WCS service. For each pre-defined request, a separate
method is defined in
TLcdWCSClient that performs the request.
The following code snippet illustrates how to perform the requests:
// Send a GetCapabilities request TLcdWCSCapabilities capabilities = wcsClient.getCapabilities(getCapabilitiesRequest); // Send a DescribeCoverage request TLcdWCSCoverageDescription describeCoverageResult = wcsClient.describeCoverage(describeCoverageRequest); // Send a GetCoverage request TLcdOWSInputStream getCoverageResult = wcsClient.getCoverage(getCoverageRequest);
The type of a response is specific for each request. These response types mach the pre-defined requests in
The list of available operations at a WCS service can be retrieved through the method
which returns a list of
TLcdOWSOperation objects. By default, it reads the operations defined in the 'Capability/Request' section (version 1.0.0)
of the capabilities. If a WCS service uses other sections to define supplementary operations, in the vendor-specific section
for example, this method can be overridden to take these into account.