Class ALcdWMSLayer
- Direct Known Subclasses:
TLcdWMSLayer
This class is a direct representation of the layer concept introduced in the OGC WMS specification.
A WMS layer is used to represent the data offered by a WMS. When a client performs a GetCapabilities
request,
the XML response will (amongst other content) contain a (hierarchical) list of layers that can be requested
by the client. This list of layers is modeled via the ALcdWMSLayer
domain object.
A WMS layer is identified by a unique key, represented by the name
property. This property
is used by the client to identify a layer in a request. It is however possible to hide the name towards the client
(see isNameVisible()
); in that case, the client cannot request the layer. A layer can contain data by itself
(see getSourceName()
), and/or it can group other layers (see getChildWMSLayer(int)
). A layer
should also have a title
, intended as a human-readable name to describe the layer.
To further describe the layer's content, a number of optional metadata properties are available, such as
abstract
, keywords
etc.
A layer can be parametrized via the WMS dimension concept, see getDimension(int)
. Common parameters
are time and elevation, to allow clients to request the data respectively for a given time instant and altitude.
A layer can also be given a number of styles which the client can request, see getWMSLayerStyle(int)
.
To indicate whether a client can perform GetFeatureInfo
requests on the layer, the
queryable
property is used.
ILcdModel
) and create a Luciad layer (ILcdLayer
) to generate the resulting map.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindWMSLayer
(String aLayerName) Search for a layer in the hierarchy with the requested layer name.abstract String
Returns an abstract for this layer.abstract ALcdWMSAuthorityURL
getAuthorityURL
(int aIndex) Returns theALcdWMSAuthorityURL
at a given index.abstract int
Returns the number ofALcdWMSAuthorityURL
objects specified within thisALcdWMSLayer
.int
Returns the number of times this layer has been retransmitted.abstract ALcdWMSLayer
getChildWMSLayer
(int aIndex) Returns the sub-layer at an index.abstract int
Returns the number of sub-layers this layer is composed of.abstract String
getCoordinateReferenceSystem
(int aIndex) Returns the extra coordinate reference system in which this layer can be displayed.abstract int
Returns the number of extra coordinate reference systems in which this layer can be displayed.getDataURL
(int aIndex) Returns theTLcdWMSURL
representing a DataURL at the given index.int
Returns the number ofTLcdWMSURL
objects representing DataURLs.getDimension
(int aIndex) Returns the dimensional parameter definition at the given index.int
Returns the number of dimensional parameters associated with this layer (and child layers).Returns the expiry date of this layer.getFeatureListURL
(int aIndex) Returns theTLcdWMSURL
representing a FeatureListURL at the given index.int
Returns the number ofTLcdWMSURL
objects representing FeatureListURLs.int
Returns the fixed height of this layer.int
Returns the fixed width of this layer.abstract TLcdWMSIdentifier
getIdentifier
(int aIndex) Returns theTLcdWMSIdentifier
at a given index.abstract int
Returns the number ofTLcdWMSIdentifier
of thisALcdWMSLayer
.abstract String
getKeyword
(int aIndex) Returns the keyword at the given index.abstract int
Returns the number of keywords.abstract double
Returns the max scale denominator range value.getMetadataURL
(int aIndex) Returns theTLcdWMSURL
representing a MetadataURL at the given index.int
Returns the number ofTLcdWMSURL
objects representing MetadataURLs.abstract double
Returns the min scale denominator range value.Returns the modification date of this layer.abstract String
getName()
Returns the name of this layer.Returns the parent layer of this layer.abstract Object
getProperty
(String aKey) Searches the property with the specified key.abstract Object
getProperty
(String aKey, Object aDefaultValue) Searches the property with the specified key.abstract String
Returns the source name of the data for this layer.abstract String
getTitle()
Returns the title of this layer.Returns the update sequence value associated with this capabilities object.abstract ILcdBounds
Returns the bounding box of this layer in WGS84.abstract ALcdWMSLayerStyle
getWMSLayerStyle
(int aIndex) Returns one of the new styles defined by this layer (for the specific index).abstract int
Returns the number of new styles this layer defines.abstract boolean
Each layer has a key, but this might not be visible to the WMS user (if the implementor of the WMS service does not want the layer to be retrievable).boolean
Returns the value of the 'noSubsets' parameter of this layer.isOpaque()
Returns whether the layer represents map data that is mostly or completely opaque.abstract boolean
Returns if the layer has extra (meta) information available.abstract void
putProperty
(String aKey, Object aObject) Maps the specified key to the specified object.void
setExpiryDate
(long aDate) Sets an expiry date for this layer.void
setModificationDate
(Long aDate) Sets a modification date for this layer.protected void
setParentLayer
(ALcdWMSLayer aParentLayer) Sets the given layer as parent layer of this layer.void
setUpdateSequence
(String aUpdateSequence) Sets the update sequence value associated with this capabilities object.
-
Constructor Details
-
ALcdWMSLayer
public ALcdWMSLayer()
-
-
Method Details
-
getTitle
Returns the title of this layer.- Returns:
- the title of this layer.
-
getName
Returns the name of this layer. This name has to be unique !- Returns:
- the name of this layer.
-
isNameVisible
public abstract boolean isNameVisible()Each layer has a key, but this might not be visible to the WMS user (if the implementor of the WMS service does not want the layer to be retrievable).- Returns:
- true if the name is visible, else false .
-
getAbstract
Returns an abstract for this layer. Value may be null.- Returns:
- an abstract for this layer.
-
getWGS84LonLatBounds
Returns the bounding box of this layer in WGS84.- Returns:
- a
ILcdBounds
containing the lon lat bounding box.
-
isQueryable
public abstract boolean isQueryable()Returns if the layer has extra (meta) information available. If thequeryable
property has the valuefalse
client applications cannot makeGetFeatureInfo
requests on this WMS layer.- Returns:
- true if the layer is queryable.
-
isOpaque
Returns whether the layer represents map data that is mostly or completely opaque. If false, the layer typically represents vector data that does not completely fills space. By default,null
is returned.- Returns:
Boolean.TRUE
if the layer represents map data that is mostly or completely opaque.
-
getParentWMSLayer
Returns the parent layer of this layer. If this layer has no parent,null
is returned.- Returns:
- The parent layer of this layer, or
null
otherwise.
-
getChildWMSLayerCount
public abstract int getChildWMSLayerCount()Returns the number of sub-layers this layer is composed of.- Returns:
- the number of sub-layers this layer is composed of.
-
getChildWMSLayer
Returns the sub-layer at an index.- Parameters:
aIndex
- the index of the sub-layer.- Returns:
- the sub-layer at an index.
- Throws:
IndexOutOfBoundsException
- in case of an invalid index.
-
getSourceName
Returns the source name of the data for this layer. This is OPTIONAL: the value returned may be null.- Returns:
- the source name of the data for this layer.
-
getWMSLayerStyleCount
public abstract int getWMSLayerStyleCount()Returns the number of new styles this layer defines.- Returns:
- the number of new styles this layer defines.
-
getWMSLayerStyle
Returns one of the new styles defined by this layer (for the specific index).- Parameters:
aIndex
- index of the new style to return.- Returns:
- one of the new styles defined by this layer (for the specific index).
- Throws:
IndexOutOfBoundsException
- in case of an invalid index.
-
putProperty
Maps the specified key to the specified object.- Parameters:
aKey
- the key to use for the property list.aObject
- the value corresponding to the key.
-
getProperty
Searches the property with the specified key. If not found null is returned.- Parameters:
aKey
- the key to search for.- Returns:
- the value of the property with the specified key, null if not found.
-
getProperty
Searches the property with the specified key. If not found the default value is returned.- Parameters:
aKey
- the key to search for.aDefaultValue
- the default value to return if no property is found with the specified key.- Returns:
- the value of the property with the specified key. The default specified value if not found.
-
getAuthorityURLCount
public abstract int getAuthorityURLCount()Returns the number ofALcdWMSAuthorityURL
objects specified within thisALcdWMSLayer
.- Returns:
- the number of
ALcdWMSAuthorityURL
objects specified within thisALcdWMSLayer
.
-
getAuthorityURL
Returns theALcdWMSAuthorityURL
at a given index.- Parameters:
aIndex
- the index of theALcdWMSAuthorityURL
.- Returns:
- the
ALcdWMSAuthorityURL
at a given index. - Throws:
IndexOutOfBoundsException
- if the index value is invalid.
-
getMetadataURLCount
public int getMetadataURLCount()Returns the number ofTLcdWMSURL
objects representing MetadataURLs. By default, 0 is returned.- Returns:
- the number of
TLcdWMSURL
objects representing MetadataURLs.
-
getMetadataURL
Returns theTLcdWMSURL
representing a MetadataURL at the given index. By default, no MetaDataURLs are available and anIndexOutOfBoundsException
will be thrown.- Parameters:
aIndex
- the index of theTLcdWMSURL
representing a MetadataURL.- Returns:
- the
TLcdWMSURL
representing a MetadataURL at the given index. - Throws:
IndexOutOfBoundsException
- if the index value is invalid.
-
getDataURLCount
public int getDataURLCount()Returns the number ofTLcdWMSURL
objects representing DataURLs. By default, 0 is returned.- Returns:
- the number of
TLcdWMSURL
objects representing DataURLs.
-
getDataURL
Returns theTLcdWMSURL
representing a DataURL at the given index. By default, no DataURLs are available and anIndexOutOfBoundsException
will be thrown.- Parameters:
aIndex
- the index of theTLcdWMSURL
representing a DataURL.- Returns:
- the
TLcdWMSURL
representing a DataURL at the given index. - Throws:
IndexOutOfBoundsException
- if the index value is invalid.
-
getFeatureListURLCount
public int getFeatureListURLCount()Returns the number ofTLcdWMSURL
objects representing FeatureListURLs. By default, 0 is returned.- Returns:
- the number of
TLcdWMSURL
objects representing FeatureListURLs.
-
getFeatureListURL
Returns theTLcdWMSURL
representing a FeatureListURL at the given index. By default, no FeatureListURLs are available and anIndexOutOfBoundsException
will be thrown.- Parameters:
aIndex
- the index of theTLcdWMSURL
representing a FeatureListURL.- Returns:
- the
TLcdWMSURL
representing a FeatureListURL at the given index. - Throws:
IndexOutOfBoundsException
- if the index value is invalid.
-
getIdentifierCount
public abstract int getIdentifierCount()Returns the number ofTLcdWMSIdentifier
of thisALcdWMSLayer
.- Returns:
- the number of
TLcdWMSIdentifier
of thisALcdWMSLayer
.
-
getIdentifier
Returns theTLcdWMSIdentifier
at a given index.- Parameters:
aIndex
- the index of theTLcdWMSIdentifier
.- Returns:
- the
TLcdWMSIdentifier
at a given index. - Throws:
IndexOutOfBoundsException
- if the index value is invalid.
-
getCascadeCount
public int getCascadeCount()Returns the number of times this layer has been retransmitted. By default, 0 is returned.- Returns:
- the number of times this layer has been retransmitted.
-
getCoordinateReferenceSystemCount
public abstract int getCoordinateReferenceSystemCount()Returns the number of extra coordinate reference systems in which this layer can be displayed.- Returns:
- the number of extra coordinate reference systems in which this layer can be displayed.
-
getCoordinateReferenceSystem
Returns the extra coordinate reference system in which this layer can be displayed.- Parameters:
aIndex
- the index of the extra coordinate reference system.- Returns:
- the extra coordinate reference system in which this layer can be displayed.
- Throws:
IndexOutOfBoundsException
- if the index value is invalid.
-
getMinScaleDenominator
public abstract double getMinScaleDenominator()Returns the min scale denominator range value. If there is no such minimum scale condition, the default value has to be 0.- Returns:
- the min scale denominator range value.
-
getMaxScaleDenominator
public abstract double getMaxScaleDenominator()Returns the max scale denominator range value. If there is no such maximum scale condition, the default value has to be Double.POSITIVE_INFINITY.- Returns:
- the max scale denominator range value.
-
getKeywordCount
public abstract int getKeywordCount()Returns the number of keywords.- Returns:
- the number of keywords.
-
getKeyword
Returns the keyword at the given index.- Parameters:
aIndex
- the index of the keyword to return.- Returns:
- the keyword at the given index.
- Throws:
IndexOutOfBoundsException
- if invalid index.
-
getDimension
Returns the dimensional parameter definition at the given index. By default, no dimensional parameters are available and anIndexOutOfBoundsException
will be thrown.- Parameters:
aIndex
- The index of the dimensional parameter to be retrieved.- Returns:
- the dimensional parameter definition at the given index.
- Throws:
IndexOutOfBoundsException
- if invalid index.
-
getDimensionCount
public int getDimensionCount()Returns the number of dimensional parameters associated with this layer (and child layers). By default, 0 is returned.- Returns:
- the number of dimensional parameters associated with this layer (and child layers).
-
setParentLayer
Sets the given layer as parent layer of this layer. To remove the currently registered parent layer,null
can be supplied.- Parameters:
aParentLayer
- The parent layer of this layer, ornull
.
-
isNoSubsets
public boolean isNoSubsets()Returns the value of the 'noSubsets' parameter of this layer. If 'noSubsets' is set, the server is not able to make a map of a geographic area other than this layer's bounding box.- Returns:
- The value of the 'noSubsets' parameter. Defaults to false.
-
getFixedWidth
public int getFixedWidth()Returns the fixed width of this layer. If this value is different from 0, the server can only produce maps with the given width for this layer.- Returns:
- The fixed width of this layer if it is set, 0 otherwise.
-
getFixedHeight
public int getFixedHeight()Returns the fixed height of this layer. If this value is different from 0, the server can only produce maps with the given height for this layer.- Returns:
- The fixed height of this layer if it is set, 0 otherwise.
-
setExpiryDate
public void setExpiryDate(long aDate) Sets an expiry date for this layer. The date is expressed by the number of milliseconds since January 1, 1970, 00:00:00 GMT. When set, the date is used to fill in theExpires
HTTP header onGetMap
andGetFeatureInfo
responses.- Parameters:
aDate
- an expiry date for this layer- See Also:
-
getExpiryDate
Returns the expiry date of this layer. By default,null
is returned.- Returns:
- the expiry date associated of this layer
- See Also:
-
setModificationDate
Sets a modification date for this layer. The date is expressed by the number of milliseconds since January 1, 1970, 00:00:00 GMT. When set, the date is used to fill in theLast-Modified
HTTP header onGetMap
andGetFeatureInfo
responses.- Parameters:
aDate
- a modification date for this layer- See Also:
-
getModificationDate
Returns the modification date of this layer. By default,null
is returned.- Returns:
- the modification date associated with this layer.
- See Also:
-
getUpdateSequence
Returns the update sequence value associated with this capabilities object. This update sequence identifies the state of the layer, including all dependencies such as styles, layer factory implementation etc...
The update sequence should comply with a number of conditions:
- The sequence number should be different from all previous update sequences for this WMS layer (if the WMS layer has changed).
- If the WMS layer is different (i.e. different data/style/...), the sequence number should be different as well. Failing to do so will cause malfunctions in combination with caching.
- If the WMS layer doesn't change, the sequence number should also remain the same. Failing to do so lowers the effect of caching, and will result in worse performance.
- The sequence number should be unique across sessions. Failing to do so may cause malfunctions in combination with caching. An easy mistake to make would for example be to use a counter that is reset when the server is restarted.
By default, this method always returns
"0"
. This means that the default implementation assumes that WMS layers never change. If WMS layers change, the update sequence should be modified using thesetUpdateSequence(java.lang.String)
method.One way to generate update sequences would be to use a (persistent) counter that gets incremented on every change. Another way would be to use
System.currentTimeMillis()
from a correct clock. It is also an option to return aString
that is concatenated with update sequences from a number of underlying concepts, such as styles, layer factory versions, data, ...Note that it is not needed to take into account the update sequence of the data (see
ILcdModelProvider.getModelUpdateSequence(java.lang.String, com.luciad.ogc.common.ALcdRequestContext)
) when calling thesetUpdateSequence(java.lang.String)
method. Instead, any code that makes use of the layer update sequence returned by this method should also take into account the update sequence of the model. An example are GetMap request caches. A cache entry should be invalidated if the layer update sequence changes, or if the model update sequence changes.- Returns:
- the update sequence value associated with this capabilities object, never
null
. - Since:
- 2017.0
-
setUpdateSequence
Sets the update sequence value associated with this capabilities object. See
getUpdateSequence()
for more information.- Parameters:
aUpdateSequence
- the new update sequence.- Since:
- 2017.0
-
findWMSLayer
Search for a layer in the hierarchy with the requested layer name.- Parameters:
aLayerName
- the name of the layer searched for.- Returns:
- The layer if found,
null
otherwise. - Since:
- 2017.1
-