Class Layer
- All Implemented Interfaces:
Comparable<Layer>
- Direct Known Subclasses:
WMTSLayer
- Author:
- rgould
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildren
(Layer child) void
Called to clear the internal cache of this layer; and any children.int
protected Collection<String>
The abstract contains human-readable information about this layerReturns every BoundingBox associated with this layer.int
Layer[]
getDimension
(String name) Look up a Dimension; note this looks up any parent supplied definitions as wellThe dimensions valid for this layer.Look up an envelope for the provided CoordinateReferenceSystem.Look up an extent by name; search includes all parent extent definitions.The Extents valid for this layer; this includes both extents defined by this layer and all extents contributed by parent layers.String[]
Keywords are Strings to be used in searchesReturns the LatLonBoundingBox for this layer.Get the BoundingBoxes associated with this layer.List of children.Direct access to the dimensions contributed by this Layer.The Extents contributed by this Layer.getName()
Gets the name of theLayer
.double
Max scale denominator for which it is appropriate to draw this layer.double
Min scale denominator for which it is appropriate to draw this layer.getSrs()
Accumulates all of the srs/crs specified for this layer and all srs/crs inherited from its ancestors.Accumulates all of the styles specified for this layer and all styles inherited from its ancestors.getTitle()
boolean
Determines if this layer is queryable.void
set_abstract
(String _abstract) void
setAttribution
(Attribution attribution) void
setBoundingBoxes
(Map<String, CRSEnvelope> boundingBoxes) Sets this layer's bounding boxes.void
setBoundingBoxes
(CRSEnvelope boundingBox) void
setCascaded
(int cascadedValue) void
setChildren
(Layer[] childrenArray) void
setDimensions
(Collection<Dimension> dimensionList) void
setDimensions
(Map<String, Dimension> dimensionMap) void
setDimensions
(Dimension dimension) void
setExtents
(Collection<Extent> extentList) void
setExtents
(Map<String, Extent> extentMap) void
setExtents
(Extent extent) void
setKeywords
(String[] keywords) void
setLatLonBoundingBox
(CRSEnvelope latLonBoundingBox) void
setMetadataURL
(List<MetadataURL> metadataURL) void
Sets the name of this layer.void
Set the parent; child will be added to the parents list of children (if it is not already).void
setQueryable
(boolean queryable) void
setScaleDenominatorMax
(double scaleDenominatorMax) Max scale denominator for which it is appropriate to draw this layer.void
setScaleDenominatorMin
(double scaleDenominatorMin) Min scale denominator for which it is appropriate to draw this layer.void
void
void
void
setVendorParameters
(Map<String, String> vendorParameters) toString()
-
Field Details
-
srs
A set of Strings representing SRSs. These are the SRSs contributed by this layer. For the complete list you need to consider these values and those defined by its parent.
-
-
Constructor Details
-
Layer
public Layer()Crate a layer with no human readable title.These layers are simply for organization and storage of common settings (like SRS or style settings). These settings will be valid for all children.
-
Layer
Create a layer with an optional title
-
-
Method Details
-
clearCache
public void clearCache()Called to clear the internal cache of this layer; and any children. -
getLayerBoundingBoxes
Get the BoundingBoxes associated with this layer.If you modify the contents of this List please call clearCache() so that the getBoundingBoxes() method can return the correct combination of this list and the parent bounding boxes.
-
getBoundingBoxes
Returns every BoundingBox associated with this layer. TheHashMap
returned has each bounding box's SRS Name (usually an EPSG code) value as the key, and the value is theBoundingBox
object itself.Implements inheritance: if this layer's bounding box is null, query ancestors until the first bounding box is found or no more ancestors
- Returns:
- a HashMap of all of this layer's bounding boxes or null if no bounding boxes found
-
setBoundingBoxes
-
setBoundingBoxes
Sets this layer's bounding boxes. The HashMap must have each BoundingBox's CRS/SRS value as its key, and theBoundingBox
object as its value.- Parameters:
boundingBoxes
- a HashMap containing bounding boxes
-
getLayerDimensions
Direct access to the dimensions contributed by this Layer. For the complete list of Dimensions applicable to the layer this value must be combined with any Dimensions supplied by the parent - this work is done for you using the getDimensions() method.- Returns:
- List of Dimensions contributed by this Layer definition
- See Also:
-
getDimensions
The dimensions valid for this layer. Includes both getLauerDimensions() and all Dimensions contributed by parent layers. The result is an unmodifiable map indexed by Dimension name.- Returns:
- Map of valid dimensions for this layer indexed by Dimension name.
-
setDimensions
-
setDimensions
-
setDimensions
-
getDimension
Look up a Dimension; note this looks up any parent supplied definitions as well -
getLayerExtents
The Extents contributed by this Layer.Please note that for the complete list of Extents valid for this layer you should use the getExtents() method which will consider extents defined as part of a Dimension and all those contributed by Parent layers.
This is an accessor; if you modify the provided list please call clearCache().
- Returns:
- Extents directly defined by this layer
-
getExtents
The Extents valid for this layer; this includes both extents defined by this layer and all extents contributed by parent layers.In keeping with the WMS 1.3.0 specification some extents may be defined as part of a Dimension definition.
- Returns:
- All extents valid for this layer.
-
getExtent
Look up an extent by name; search includes all parent extent definitions.- Returns:
- Extent or null if not found
-
setExtents
-
setExtents
-
setExtents
-
getName
Gets the name of theLayer
. It is designed to be machine readable, and if it is present, this layer is determined to be drawable and is a valid candidate for use in a GetMap or GetFeatureInfo request.- Returns:
- the machine-readable name of the layer
-
setName
Sets the name of this layer. Giving the layer name indicates that it can be drawn during a GetMap or GetFeatureInfo request.- Parameters:
name
- the layer's new name
-
getSrs
Accumulates all of the srs/crs specified for this layer and all srs/crs inherited from its ancestors. No duplicates are returned.- Returns:
- Set of all srs/crs for this layer and its ancestors
-
setSrs
-
getStyles
Accumulates all of the styles specified for this layer and all styles inherited from its ancestors. No duplicates are returned.The List that is returned is of type List<org.geotools.api.layer.Style>. Before 2.2-RC0 it was of type List<java.lang.String>.
- Returns:
- List of all styles for this layer and its ancestors
-
setStyles
-
getTitle
-
setTitle
-
isQueryable
public boolean isQueryable()Determines if this layer is queryable. Implements inheritance: if this layer's Queryable attribute is null, check ancestors until the first Queryable attribute is found or no more ancestors. If a Queryable attribute is not found for this layer, it will return the default value of false.- Returns:
- true is this layer is Queryable
-
setQueryable
public void setQueryable(boolean queryable) -
compareTo
- Specified by:
compareTo
in interfaceComparable<Layer>
-
getParent
- Returns:
- Returns the parent.
-
setParent
Set the parent; child will be added to the parents list of children (if it is not already).- Parameters:
parentLayer
- The parent to set.
-
getLatLonBoundingBox
Returns the LatLonBoundingBox for this layer. Implements inheritance: if this layer's bounding box is null, query ancestors until the first bounding box is found or no more ancestors.- Returns:
- the LatLonBoundingBox for this layer or null if no lat/lon bounding box is found
-
setLatLonBoundingBox
-
getLayerChildren
List of children.- Returns:
- list of children
-
getChildren
-
setChildren
-
addChildren
-
get_abstract
The abstract contains human-readable information about this layer- Returns:
- Returns the _abstract.
-
set_abstract
- Parameters:
_abstract
- The _abstract to set.
-
getKeywords
Keywords are Strings to be used in searches- Returns:
- Returns the keywords.
-
setKeywords
- Parameters:
keywords
- The keywords to set.
-
setScaleDenominatorMax
public void setScaleDenominatorMax(double scaleDenominatorMax) Max scale denominator for which it is appropriate to draw this layer.Scale denominator is calculated based on the bounding box of the central pixel in a request (ie not a scale based on real world size of the entire layer).
- Parameters:
scaleDenominatorMax
- scale denominator for which it is approprirate to draw this layer
-
getScaleDenominatorMax
public double getScaleDenominatorMax()Max scale denominator for which it is appropriate to draw this layer.Scale denominator is calculated based on the bounding box of the central pixel in a request (ie not a scale based on real world size of the entire layer).
Some web map servers will refuse to render images at a scale greater than the value provided here.
return Max scale denominator for which it is appropriate to draw this layer.
-
setScaleDenominatorMin
public void setScaleDenominatorMin(double scaleDenominatorMin) Min scale denominator for which it is appropriate to draw this layer.Scale denominator is calculated based on the bounding box of the central pixel in a request (ie not a scale based on real world size of the entire layer).
- Parameters:
scaleDenominatorMin
- scale denominator for which it is appropriate to draw this layer
-
getScaleDenominatorMin
public double getScaleDenominatorMin()Min scale denominator for which it is appropriate to draw this layer.Scale denominator is calculated based on the bounding box of the central pixel in a request (ie not a scale based on real world size of the entire layer).
Some web map servers will refuse to render images at a scale less than the value provided here.
return Min scale denominator for which it is appropriate to draw this layer
-
getEnvelope
Look up an envelope for the provided CoordinateReferenceSystem.Please note that the lookup is performed based on the SRS Name of the provided CRS which is assumed to be one of its identifiers. This method returns the first envelope found; this may not be valid for sparse data sets that indicate data location using multiple envelopes for a provided CRS.
- Returns:
- GeneralEnvelope matching the provided crs; or null if unavailable.
-
extractCRSNames
-
getCascaded
public int getCascaded()- Returns:
0
if the layer is not cascaded, the number of times it has been cascaded otherwise.
-
setCascaded
public void setCascaded(int cascadedValue) - Parameters:
cascadedValue
-0
if the layer is not cascaded, the number of times it has been cascaded otherwise.
-
getMetadataURL
-
setMetadataURL
-
getAttribution
-
setAttribution
-
toString
-
getVendorParameters
-
setVendorParameters
-