org.geotools.data.ows
Class Layer

Object
  extended by Layer
All Implemented Interfaces:
Comparable<Layer>

public class Layer
extends Object
implements Comparable<Layer>

Nested list of zero or more map Layers offered by this server. It contains only fields for information that we currently find interesting. Feel free to add your own.

Author:
rgould

Constructor Summary
Layer()
          Crate a layer with no human readable title.
Layer(String title)
          Create a layer with an optional title
 
Method Summary
 void addChildren(Layer child)
           
 void clearCache()
          Called to clear the internal cache of this layer; and any children.
 int compareTo(Layer layer)
           
 String get_abstract()
          The abstract contains human-readable information about this layer
 Map<String,CRSEnvelope> getBoundingBoxes()
          Returns every BoundingBox associated with this layer.
 int getCascaded()
           
 Layer[] getChildren()
           
 Dimension getDimension(String name)
          Look up a Dimension; note this looks up any parent supplied definitions as well
 Map<String,Dimension> getDimensions()
          The dimensions valid for this layer.
 GeneralEnvelope getEnvelope(CoordinateReferenceSystem crs)
          Look up an envelope for the provided CoordianteReferenceSystem.
 Extent getExtent(String name)
          Look up an extent by name; search includes all parent extent definitions.
 Map<String,Extent> getExtents()
          The Extents valid for this layer; this includes both extents defined by this layer and all extents contributed by parent layers.
 String[] getKeywords()
          Keywords are Strings to be used in searches
 CRSEnvelope getLatLonBoundingBox()
          Returns the LatLonBoundingBox for this layer.
 List<CRSEnvelope> getLayerBoundingBoxes()
          Get the BoundingBoxes associated with this layer.
 List<Layer> getLayerChildren()
          List of children.
 List<Dimension> getLayerDimensions()
          Direct access to the dimensions contributed by this Layer.
 List<Extent> getLayerExtents()
          The Extents contributed by this Layer.
 List<MetadataURL> getMetadataURL()
           
 String getName()
          Gets the name of the Layer.
 Layer getParent()
          DOCUMENT ME!
 double getScaleDenominatorMax()
          Max scale denominator for which it is appropriate to draw this layer.
 double getScaleDenominatorMin()
          Min scale denominator for which it is appropriate to draw this layer.
 double getScaleHintMax()
          Deprecated. Use getScaleDenomiatorMax() as there is less confusion over meaning
 double getScaleHintMin()
          Deprecated. Use getScaleDenomiatorMin() as there is less confusion over meaning
 Set<String> getSrs()
          Accumulates all of the srs/crs specified for this layer and all srs/crs inherited from its ancestors.
 List<StyleImpl> getStyles()
          Accumulates all of the styles specified for this layer and all styles inherited from its ancestors.
 String getTitle()
           
 boolean isQueryable()
          Determines if this layer is queryable.
 void set_abstract(String _abstract)
           
 void setBoundingBoxes(CRSEnvelope boundingBox)
           
 void setBoundingBoxes(Map<String,CRSEnvelope> boundingBoxes)
          Sets this layer's bounding boxes.
 void setCascaded(int cascadedValue)
           
 void setChildren(Layer[] childrenArray)
           
 void setDimensions(Collection<Dimension> dimensionList)
           
 void setDimensions(Dimension dimension)
           
 void setDimensions(Map<String,Dimension> dimensionMap)
           
 void setExtents(Collection<Extent> extentList)
           
 void setExtents(Extent extent)
           
 void setExtents(Map<String,Extent> extentMap)
           
 void setKeywords(String[] keywords)
           
 void setLatLonBoundingBox(CRSEnvelope latLonBoundingBox)
           
 void setMetadataURL(List<MetadataURL> metadataURL)
           
 void setName(String name)
          Sets the name of this layer.
 void setParent(Layer parentLayer)
          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 setScaleHintMax(double scaleHintMax)
          Deprecated. Use setScaleDenomiatorMax() as there is less confusion over meaning
 void setScaleHintMin(double scaleHintMin)
          Deprecated. Use setScaleDenomiatorMin() as there is less confusion over meaning
 void setSrs(Set<String> srs)
           
 void setStyles(List<StyleImpl> styles)
           
 void setTitle(String title)
           
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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

public Layer(String title)
Create a layer with an optional title

Parameters:
title -
Method Detail

clearCache

public void clearCache()
Called to clear the internal cache of this layer; and any children.


getLayerBoundingBoxes

public List<CRSEnvelope> 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

public Map<String,CRSEnvelope> getBoundingBoxes()
Returns every BoundingBox associated with this layer. The HashMap returned has each bounding box's SRS Name (usually an EPSG code) value as the key, and the value is the BoundingBox 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

public void setBoundingBoxes(CRSEnvelope boundingBox)

setBoundingBoxes

public void setBoundingBoxes(Map<String,CRSEnvelope> boundingBoxes)
Sets this layer's bounding boxes. The HashMap must have each BoundingBox's CRS/SRS value as its key, and the BoundingBox object as its value.

Parameters:
boundingBoxes - a HashMap containing bounding boxes

getLayerDimensions

public List<Dimension> 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()

getDimensions

public Map<String,Dimension> 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

public void setDimensions(Map<String,Dimension> dimensionMap)

setDimensions

public void setDimensions(Collection<Dimension> dimensionList)

setDimensions

public void setDimensions(Dimension dimension)

getDimension

public Dimension getDimension(String name)
Look up a Dimension; note this looks up any parent supplied definitions as well


getLayerExtents

public List<Extent> 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

public Map<String,Extent> 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

public Extent getExtent(String name)
Look up an extent by name; search includes all parent extent definitions.

Parameters:
name -
Returns:
Extent or null if not found

setExtents

public void setExtents(Map<String,Extent> extentMap)

setExtents

public void setExtents(Collection<Extent> extentList)

setExtents

public void setExtents(Extent extent)

getName

public String getName()
Gets the name of the Layer. 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

public void setName(String name)
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

public Set<String> 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

public void setSrs(Set<String> srs)

getStyles

public List<StyleImpl> 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. Before 2.2-RC0 it was of type List.

Returns:
List of all styles for this layer and its ancestors

setStyles

public void setStyles(List<StyleImpl> styles)

getTitle

public String getTitle()

setTitle

public void setTitle(String title)

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

public int compareTo(Layer layer)
Specified by:
compareTo in interface Comparable<Layer>

getParent

public Layer getParent()
DOCUMENT ME!

Returns:
Returns the parent.

setParent

public void setParent(Layer parentLayer)
Set the parent; child will be added to the parents list of children (if it is not already).

Parameters:
parent - The parent to set.

getLatLonBoundingBox

public CRSEnvelope 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

public void setLatLonBoundingBox(CRSEnvelope latLonBoundingBox)

getLayerChildren

public List<Layer> getLayerChildren()
List of children.

Returns:
list of children

getChildren

public Layer[] getChildren()

setChildren

public void setChildren(Layer[] childrenArray)

addChildren

public void addChildren(Layer child)

get_abstract

public String get_abstract()
The abstract contains human-readable information about this layer

Returns:
Returns the _abstract.

set_abstract

public void set_abstract(String _abstract)
Parameters:
_abstract - The _abstract to set.

getKeywords

public String[] getKeywords()
Keywords are Strings to be used in searches

Returns:
Returns the keywords.

setKeywords

public void setKeywords(String[] keywords)
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:
Max - 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:
Min - 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


getScaleHintMax

public double getScaleHintMax()
Deprecated. Use getScaleDenomiatorMax() as there is less confusion over meaning

Maximum scale for which this layer is considered good.

We assume this calculation is done in a similar manner to getScaleDenominatorMax(); but a look at common web services such as JPL show this not to be the case.

Returns:
The second scale hint value (understood to mean the max value)

setScaleHintMax

public void setScaleHintMax(double scaleHintMax)
Deprecated. Use setScaleDenomiatorMax() as there is less confusion over meaning

Maximum scale for which this layer is considered good.

We assume this calculation is done in a similar manner to setScaleDenominatorMax(); but a look at common web services such as JPL show this not to be the case.

Parameters:
The - second scale hint value (understood to mean the max value)

getScaleHintMin

public double getScaleHintMin()
Deprecated. Use getScaleDenomiatorMin() as there is less confusion over meaning

Minimum scale for which this layer is considered good.

We assume this calculation is done in a similar manner to getScaleDenominatorMin(); but a look at common web services such as JPL show this not to be the case.

Returns:
The first scale hint value (understood to mean the min value)

setScaleHintMin

public void setScaleHintMin(double scaleHintMin)
Deprecated. Use setScaleDenomiatorMin() as there is less confusion over meaning

Minimum scale for which this layer is considered good.

We assume this calculation is done in a similar manner to setScaleDenominatorMin(); but a look at common web services such as JPL show this not to be the case.

param The first scale hint value (understood to mean the min value)


getEnvelope

public GeneralEnvelope getEnvelope(CoordinateReferenceSystem crs)
Look up an envelope for the provided CoordianteReferenceSystem.

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.

Parameters:
crs -
Returns:
GeneralEnvelope matching the provided crs; or null if unavailable.

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

public List<MetadataURL> getMetadataURL()

setMetadataURL

public void setMetadataURL(List<MetadataURL> metadataURL)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1996-2014 Geotools. All Rights Reserved.