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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindWMSLayer(String aLayerName) Search for a layer in the hierarchy with the requested layer name.abstract StringReturns an abstract for this layer.abstract ALcdWMSAuthorityURLgetAuthorityURL(int aIndex) Returns theALcdWMSAuthorityURLat a given index.abstract intReturns the number ofALcdWMSAuthorityURLobjects specified within thisALcdWMSLayer.abstract Optional<ILcdBounds> getBoundingBox(String aCoordinateReferenceSystem) Returns the bounding box of this layer in the extra coordinate reference, if it has been provided.intReturns the number of times this layer has been retransmitted.abstract ALcdWMSLayergetChildWMSLayer(int aIndex) Returns the sub-layer at an index.abstract intReturns the number of sub-layers this layer is composed of.abstract StringgetCoordinateReferenceSystem(int aIndex) Returns the extra coordinate reference system in which this layer can be displayed.abstract intReturns the number of extra coordinate reference systems in which this layer can be displayed.getDataURL(int aIndex) Returns theTLcdWMSURLrepresenting a DataURL at the given index.intReturns the number ofTLcdWMSURLobjects representing DataURLs.getDimension(int aIndex) Returns the dimensional parameter definition at the given index.intReturns the number of dimensional parameters associated with this layer (and child layers).Returns the expiry date of this layer.getFeatureListURL(int aIndex) Returns theTLcdWMSURLrepresenting a FeatureListURL at the given index.intReturns the number ofTLcdWMSURLobjects representing FeatureListURLs.intReturns the fixed height of this layer.intReturns the fixed width of this layer.abstract TLcdWMSIdentifiergetIdentifier(int aIndex) Returns theTLcdWMSIdentifierat a given index.abstract intReturns the number ofTLcdWMSIdentifierof thisALcdWMSLayer.abstract StringgetKeyword(int aIndex) Returns the keyword at the given index.abstract intReturns the number of keywords.abstract doubleReturns the max scale denominator range value.getMetadataURL(int aIndex) Returns theTLcdWMSURLrepresenting a MetadataURL at the given index.intReturns the number ofTLcdWMSURLobjects representing MetadataURLs.abstract doubleReturns the min scale denominator range value.Returns the modification date of this layer.abstract StringgetName()Returns the name of this layer.Returns the parent layer of this layer.abstract ObjectgetProperty(String aKey) Searches the property with the specified key.abstract ObjectgetProperty(String aKey, Object aDefaultValue) Searches the property with the specified key.abstract StringReturns the source name of the data for this layer.abstract StringgetTitle()Returns the title of this layer.Returns the update sequence value associated with this capabilities object.abstract ILcdBoundsReturns the bounding box of this layer in WGS84.abstract ALcdWMSLayerStylegetWMSLayerStyle(int aIndex) Returns one of the new styles defined by this layer (for the specific index).abstract intReturns the number of new styles this layer defines.abstract booleanEach 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).booleanReturns the value of the 'noSubsets' parameter of this layer.isOpaque()Returns whether the layer represents map data that is mostly or completely opaque.abstract booleanReturns if the layer has extra (meta) information available.abstract voidputProperty(String aKey, Object aObject) Maps the specified key to the specified object.voidsetExpiryDate(long aDate) Sets an expiry date for this layer.voidsetModificationDate(Long aDate) Sets a modification date for this layer.protected voidsetParentLayer(ALcdWMSLayer aParentLayer) Sets the given layer as parent layer of this layer.voidsetUpdateSequence(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
ILcdBoundscontaining the lon lat bounding box.
-
isQueryable
public abstract boolean isQueryable()Returns if the layer has extra (meta) information available. If thequeryableproperty has the valuefalseclient applications cannot makeGetFeatureInforequests 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,nullis returned.- Returns:
Boolean.TRUEif 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,nullis returned.- Returns:
- The parent layer of this layer, or
nullotherwise.
-
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 ofALcdWMSAuthorityURLobjects specified within thisALcdWMSLayer.- Returns:
- the number of
ALcdWMSAuthorityURLobjects specified within thisALcdWMSLayer.
-
getAuthorityURL
Returns theALcdWMSAuthorityURLat a given index.- Parameters:
aIndex- the index of theALcdWMSAuthorityURL.- Returns:
- the
ALcdWMSAuthorityURLat a given index. - Throws:
IndexOutOfBoundsException- if the index value is invalid.
-
getMetadataURLCount
public int getMetadataURLCount()Returns the number ofTLcdWMSURLobjects representing MetadataURLs. By default, 0 is returned.- Returns:
- the number of
TLcdWMSURLobjects representing MetadataURLs.
-
getMetadataURL
Returns theTLcdWMSURLrepresenting a MetadataURL at the given index. By default, no MetaDataURLs are available and anIndexOutOfBoundsExceptionwill be thrown.- Parameters:
aIndex- the index of theTLcdWMSURLrepresenting a MetadataURL.- Returns:
- the
TLcdWMSURLrepresenting a MetadataURL at the given index. - Throws:
IndexOutOfBoundsException- if the index value is invalid.
-
getDataURLCount
public int getDataURLCount()Returns the number ofTLcdWMSURLobjects representing DataURLs. By default, 0 is returned.- Returns:
- the number of
TLcdWMSURLobjects representing DataURLs.
-
getDataURL
Returns theTLcdWMSURLrepresenting a DataURL at the given index. By default, no DataURLs are available and anIndexOutOfBoundsExceptionwill be thrown.- Parameters:
aIndex- the index of theTLcdWMSURLrepresenting a DataURL.- Returns:
- the
TLcdWMSURLrepresenting a DataURL at the given index. - Throws:
IndexOutOfBoundsException- if the index value is invalid.
-
getFeatureListURLCount
public int getFeatureListURLCount()Returns the number ofTLcdWMSURLobjects representing FeatureListURLs. By default, 0 is returned.- Returns:
- the number of
TLcdWMSURLobjects representing FeatureListURLs.
-
getFeatureListURL
Returns theTLcdWMSURLrepresenting a FeatureListURL at the given index. By default, no FeatureListURLs are available and anIndexOutOfBoundsExceptionwill be thrown.- Parameters:
aIndex- the index of theTLcdWMSURLrepresenting a FeatureListURL.- Returns:
- the
TLcdWMSURLrepresenting a FeatureListURL at the given index. - Throws:
IndexOutOfBoundsException- if the index value is invalid.
-
getIdentifierCount
public abstract int getIdentifierCount()Returns the number ofTLcdWMSIdentifierof thisALcdWMSLayer.- Returns:
- the number of
TLcdWMSIdentifierof thisALcdWMSLayer.
-
getIdentifier
Returns theTLcdWMSIdentifierat a given index.- Parameters:
aIndex- the index of theTLcdWMSIdentifier.- Returns:
- the
TLcdWMSIdentifierat 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.
-
getBoundingBox
Returns the bounding box of this layer in the extra coordinate reference, if it has been provided.- Parameters:
aCoordinateReferenceSystem- the extra coordinate reference.- Returns:
- the bounding box of this layer in the extra coordinate reference, if it has been provided.
- Since:
- 2025.0
-
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 anIndexOutOfBoundsExceptionwill 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,nullcan 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 theExpiresHTTP header onGetMapandGetFeatureInforesponses.- Parameters:
aDate- an expiry date for this layer- See Also:
-
getExpiryDate
Returns the expiry date of this layer. By default,nullis 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-ModifiedHTTP header onGetMapandGetFeatureInforesponses.- Parameters:
aDate- a modification date for this layer- See Also:
-
getModificationDate
Returns the modification date of this layer. By default,nullis 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 aStringthat 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,
nullotherwise. - Since:
- 2017.1
-