Package com.luciad.ogc.wcs.client
Class TLcdWCSCoverageModelDecoder
java.lang.Object
com.luciad.ogc.wcs.client.TLcdWCSCoverageModelDecoder
- All Implemented Interfaces:
ILcdModelDecoder
@LcdService(service=ILcdModelDecoder.class,
priority=20000)
public class TLcdWCSCoverageModelDecoder
extends Object
implements ILcdModelDecoder
This model decoder decodes a WCS coverage data source encoded as GeoTIFF into an
ILcdModel
object.
Input
- An instance of
TLcdWCSDataSource
. - A String referring to the WCS base URL.
- A String referring to the WCS base URL and coverage identifier, specified as a
data=coverageIdentifier
key/value pair.
Supported transfer protocols
- This model decoder supports http and https protocols.
Model structure
- This model decoder creates a model per WCS coverage source.
- All models returned by this model decoder are of type
TLcdWCSProxyModel
, which is an implementation ofILcd2DBoundsIndexedModel
.
Model descriptor
- All models returned by this model decoder have a
TLcdWCSProxyModelDescriptor
. - The model descriptor is an implementation of
ILcdImageModelDescriptor
, indicating that the model data can be accessed through theALcdImage
API (see below). - The type name of the model descriptor is the display name of this decoder.
Model reference
- All models returned by this model decoder have an
ILcdGridReference
or anILcdGeodeticReference
.
Model elements
- Each decoded model contains a single element of the type
TLcdWCSProxy
. This element acts as a client-side proxy towards the WCS coverage data. The recommended way to access the WCS coverage data is by using theALcdImage
API; the image instance can be retrieved throughALcdImage#fromDomainObject(TLcdWCSProxy)}
. To render the data, the model can be given to a general Lightspeed and GXY image layer builder builder or factory.
Sample code
Decoding a WCS data source:
String serverURL = "https://sampleservices.luciad.com/wcs";
String coverageName = "world_elevation_6714a770-860b-4878-90c9-ab386a4bae0f";
//Create the data source
TLcdWCSDataSource dataSource = TLcdWCSDataSource.newBuilder()
.uri(serverURL)
.coverageName(coverageName)
.build();
//Decode the model
ILcdModelDecoder decoder = new TLcdWCSCoverageModelDecoder();
ILcdModel model = decoder.decodeSource(dataSource);
Decoding a string containing the server URL and WCS coverage
String serverURL = "https://sampleservices.luciad.com/wcs";
String coverageName = "world_elevation_6714a770-860b-4878-90c9-ab386a4bae0f";
//Concat the url and layer name to a single string
String sourceName = String.format("%s?data=%s", serverURL, coverageName);
//Decode the model
ILcdModelDecoder decoder = new TLcdWCSCoverageModelDecoder();
ILcdModel model = decoder.decode(sourceName);
Thread safety
- The decoding of models is thread-safe.
- The decoded models are thread-safe for read access.
Supported versions and specifications
- This model decoder supports WCS coverage data sources that comply with the OGC WCS 1.0 specification and that are available in the GeoTIFF exchange format. For more information about the OGC WCS specification, please refer to http://www.opengeospatial.org.
- Since:
- 2018.0
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a newTLcdWCSCoverageModelDecoder
instance.TLcdWCSCoverageModelDecoder
(ILcdOWSTransport aTransport) Creates a newTLcdWCSCoverageModelDecoder
instance, configured with the given transport. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(ILcdDataSource aDataSource) Checks whether the given source represents WCS data.boolean
canDecodeSource
(String aSourceName) Checks whether the given source is a WCS server.Creates a new model for the WCS data in the server.decodeSource
(ILcdDataSource aDataSource) Creates a new model for the WCS data in the server represented by aTLcdWCSDataSource
.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
decodeModelMetadata, decodeModelMetadata, discoverDataSources
-
Constructor Details
-
TLcdWCSCoverageModelDecoder
public TLcdWCSCoverageModelDecoder()Creates a newTLcdWCSCoverageModelDecoder
instance. -
TLcdWCSCoverageModelDecoder
Creates a newTLcdWCSCoverageModelDecoder
instance, configured with the given transport.- Parameters:
aTransport
- The transport to be used to interact with a WCS server. Must not benull
.- Since:
- 2018.1
-
-
Method Details
-
getDisplayName
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
canDecodeSource
Checks whether the given source is a WCS server.Returns
true
if the source is a HTTP or HTTPS url referring to a WCS server. The WCS server test is done by performing a GetCapabilities operation and verifying the result.- Specified by:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the source to be verified.- Returns:
true
if the source represents a WCS server,false
otherwise.- See Also:
-
decode
Creates a new model for the WCS data in the server.aSourceName
is expected in the format ofURI?data="CoverageName
.- If you only provide the server URI, the coverage description is requested from the server and the first coverage is used to make a request from the WCS server.
- If you provide both URI and coverage name, it will return the model for specified coverage.
- Specified by:
decode
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the source to be decoded, can be a formatted asURI?data="CoverageName
to identify the server URI and layer name.- Returns:
- The decoded model
- Throws:
IOException
- If the connections to the server fails, or if the server is not a WCS server, or ifaSourceName
is not well formatted.- See Also:
-
decodeSource
Creates a new model for the WCS data in the server represented by aTLcdWCSDataSource
.- Specified by:
decodeSource
in interfaceILcdModelDecoder
- Parameters:
aDataSource
- the source to be decoded, must be aTLcdWCSDataSource
.- Returns:
- The decoded model
- Throws:
IOException
- If the connections to the server fails, or if the server is not a WCS server.- See Also:
-
canDecodeSource
Checks whether the given source represents WCS data.Returns
true
if the object is aTLcdWCSDataSource
.This call will not make a connection to the server.
- Specified by:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aDataSource
- the source to be verified.- Returns:
true
if the source is aTLcdWCSDataSource
,false
otherwise.- See Also:
-