@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdWCSCoverageModelDecoder extends Object implements ILcdModelDecoder
ILcdModel
object.
TLcdWCSDataSource
.data=coverageIdentifier
key/value pair.TLcdWCSProxyModel
,
which is an implementation of ILcd2DBoundsIndexedModel
.TLcdWCSProxyModelDescriptor
.ILcdImageModelDescriptor
, indicating that
the model data can be accessed through the ALcdImage
API (see below).ILcdGridReference
or
an ILcdGeodeticReference
.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 the ALcdImage
API; the image instance can be retrieved through
ALcdImage#fromDomainObject(TLcdWCSProxy)}
. To render the data, the model can be given to a
general Lightspeed and GXY image layer builder builder or factory.
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);
TLcdWCSDataSource
,
TLcdWCSProxyModel
,
TLcdWCSProxy
Constructor and Description |
---|
TLcdWCSCoverageModelDecoder()
Creates a new
TLcdWCSCoverageModelDecoder instance. |
TLcdWCSCoverageModelDecoder(ILcdOWSTransport aTransport)
Creates a new
TLcdWCSCoverageModelDecoder instance,
configured with the given transport. |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(ILcdDataSource aDataSource)
Checks whether the given source represents WCS data.
|
boolean |
canDecodeSource(String aSourceName)
Checks whether the given source is a WCS server.
|
ILcdModel |
decode(String aSourceName)
Creates a new model for the WCS data in the server.
|
ILcdModel |
decodeSource(ILcdDataSource aDataSource)
Creates a new model for the WCS data in the server represented by a
TLcdWCSDataSource . |
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decodeModelMetadata, decodeModelMetadata, discoverDataSources
public TLcdWCSCoverageModelDecoder()
TLcdWCSCoverageModelDecoder
instance.public TLcdWCSCoverageModelDecoder(ILcdOWSTransport aTransport)
TLcdWCSCoverageModelDecoder
instance,
configured with the given transport.aTransport
- The transport to be used to interact with a WCS server. Must not be null
.public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
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.
canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the source to be verified.true
if the source represents a WCS server, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
aSourceName
is expected in the format of URI?data="CoverageName
.
decode
in interface ILcdModelDecoder
aSourceName
- the source to be decoded, can be a formatted as URI?data="CoverageName
to identify the server URI and layer name.IOException
- If the connections to the server fails, or if the server is not a WCS server, or if aSourceName
is not well formatted.ILcdModelDecoder.canDecodeSource(String)
public ILcdModel decodeSource(ILcdDataSource aDataSource) throws IOException
TLcdWCSDataSource
.decodeSource
in interface ILcdModelDecoder
aDataSource
- the source to be decoded, must be a TLcdWCSDataSource
.IOException
- If the connections to the server fails, or if the server is not a WCS
server.ILcdModelDecoder.canDecodeSource(ILcdDataSource)
public boolean canDecodeSource(ILcdDataSource aDataSource)
Returns true
if the object is
a TLcdWCSDataSource
.
This call will not make a connection to the server.
canDecodeSource
in interface ILcdModelDecoder
aDataSource
- the source to be verified.true
if the source is a TLcdWCSDataSource
, false
otherwise.ILcdModelDecoder.decodeSource(ILcdDataSource)
,
ILcdModelDecoder.decodeModelMetadata(ILcdDataSource)