deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.ogcwebservices.wms.capabilities
Class Layer

java.lang.Object
  extended by org.deegree.ogcwebservices.wms.capabilities.Layer

public class Layer
extends java.lang.Object

Each available map is advertised by a <Layer> element in the Capabilities XML. A single parent Layer encloses any number of additional layers, which may be hierarchically nested as desired. Some properties defined in a parent layer are inherited by the children it encloses. These inherited properties may be either redefined or added to by the child.

A Map Server shall include at least one <Layer> element for each map layer offered. If desired, layers may be repeated in different categories when relevant. No controlled vocabulary has been defined, so at present Layer and Style Names, Titles and Keywords are arbitrary.

The <Layer> element can enclose child elements providing metadata about the Layer.

Version:
2002-03-01
Author:
Katharina Lupp , Markus Schneider , last edited by: $Author: aschmitz $

Constructor Summary
Layer(boolean queryable, int cascaded, boolean opaque, boolean noSubsets, int fixedWidth, int fixedHeight, java.lang.String name, java.lang.String title, java.lang.String abstract_, Envelope latLonBoundingBox, Attribution attribution, ScaleHint scaleHint, java.lang.String[] keywordList, java.lang.String[] srs, LayerBoundingBox[] boundingBoxes, Dimension[] dimensions, Extent[] extents, AuthorityURL[] authorityURLs, Identifier[] identifiers, MetadataURL[] metadataURLs, DataURL[] dataURLs, FeatureListURL[] featureListURLs, Style[] styles, Layer[] layers, AbstractDataSource[] dataSource, Layer parent)
          constructor initializing the class with the <Layer>
 
Method Summary
 void addAuthorityURL(AuthorityURL authorityURL)
          adds the authority attribute of the Identifier element
 void addBoundingBox(Envelope boundingBox)
          adds the <BoundingBox>
 void addDataSource(AbstractDataSource dataSource)
          source where the WMS can find the data of a layer.
 void addDataURL(DataURL dataURL)
          adds the dataURL
 void addDimension(Dimension dimension)
          adds the dimension
 void addExtent(Extent extent)
          adds the extent declarations
 void addFeatureListURL(FeatureListURL featureListURL)
          adds the <FeatureListURL>
 void addIdentifier(Identifier identifier)
          adds the <Identifier>
 void addKeyword(java.lang.String keyword)
          adds the keywordList
 void addLayer(Layer layer)
          adds a list of layers the are enclosed by this layer.
 void addMetadataURL(MetadataURL metadataURL)
          adds the metadataURL
 void addSrs(java.lang.String srs)
          adds the spatial reference system (srs)
 void addStyles(Style style)
          adds a list of style that can be used form rendering the layer.
 java.lang.String getAbstract()
          Abstract is a narrative description of the map layer.
 Attribution getAttribution()
          The optional <Attribution> element provides a way to identify the source of the map data used in a Layer or collection of Layers.
 AuthorityURL[] getAuthorityURL()
          The authority attribute of the Identifier element corresponds to the name attribute of a separate <AuthorityURL> element.
 LayerBoundingBox[] getBoundingBoxes()
          Layers may have zero or more <BoundingBox> elements that are either stated explicitly or inherited from a parent Layer.
 int getCascaded()
           
 AbstractDataSource[] getDataSource()
          source where the WMS can find the data of a layer.
 DataURL[] getDataURL()
          A Map Server may use DataURL to offer more information about the data represented by a particular layer.
 Dimension[] getDimension()
          Dimension declarations are inherited from parent Layers.
 Extent[] getExtent()
          Extent declarations are inherited from parent Layers.
 FeatureListURL[] getFeatureListURL()
          A Map Server may use a <FeatureListURL> element to point to a list of the features represented in a Layer.
 int getFixedHeight()
           
 int getFixedWidth()
           
 Identifier[] getIdentifier()
          A Map Server may use zero or more <Identifier> elements to list ID numbers or labels defined by a particular Authority.
 java.lang.String[] getKeywordList()
          KeywordList contains zero or more Keywords to aid in catalog searches.
 Envelope getLatLonBoundingBox()
          Every Layer shall have exactly one <LatLonBoundingBox> element that is either stated explicitly or inherited from a parent Layer.
 Layer[] getLayer()
          returns a list of layers the are enclosed by this layer.
 MetadataURL[] getMetadataURL()
          A Map Server should use one or more <MetadataURL> elements to offer detailed, standardized metadata about the data underneath a particular layer.
 java.lang.String getName()
          If, and only if, a layer has a <Name>, then it is a map layer that can be requested by using that Name in the LAYERS parameter of a GetMap request.
 Layer getParent()
           
 ScaleHint getScaleHint()
          Layers may include a <ScaleHint> element that suggests minimum and maximum scales for which it is appropriate to display this layer.
 java.lang.String[] getSrs()
          Every Layer is available in one or more spatial reference systems Every Layer shall have at least one >SRS> element that is either stated explicitly or inherited from a parent Layer .
 UserStyle getStyle(java.lang.String name)
          returns the UserStyle (SLD) representation of the style identified by the submitted name.
 Style getStyleResource(java.lang.String name)
          returns the Style identified by the submitted name.
 Style[] getStyles()
           
 java.lang.String getTitle()
          A <Title> is required for all layers; it is a human-readable string for presentation in a menu.
 boolean hasNoSubsets()
           
 boolean isOpaque()
           
 boolean isQueryable()
           
 boolean isSrsSupported(java.lang.String srs)
           
 Layer removeLayer(java.lang.String name)
          removes a Layer identified by its name from the parent Layer.
 Layer removeLayerByTitle(java.lang.String title)
          removes a Layer identified by its title from the parent Layer.
 void setAbstract(java.lang.String abstract_)
          sets the a narrative description of the map layer
 void setAttribution(Attribution attribution)
          sets the optional <Attribution> element
 void setAuthorityURL(AuthorityURL[] authorityURL)
          sets the authority attribute of the Identifier element
 void setBoundingBox(LayerBoundingBox[] boundingBox)
          sets the boundingBox
 void setDataSource(AbstractDataSource[] dataSource)
          source where the WMS can find the data of a layer.
 void setDataURL(DataURL[] dataURL)
          sets the dataURL
 void setDimension(Dimension[] dimension)
          sets the dimension
 void setExtent(Extent[] extent)
          sets the extent
 void setFeatureListURL(FeatureListURL[] featureListURL)
          sets the <FeatureListURL>
 void setIdentifier(Identifier[] identifier)
          sets the <Identifier>
 void setKeywordList(java.lang.String[] keywordList)
          sets the keywordList
 void setLatLonBoundingBox(Envelope latLonBoundingBox)
          sets the LatLonBoundingBox element that is either stated explicitly or inherited from a parent Layer.
 void setLayer(Layer[] layer)
          sets a list of layers the are enclosed by this layer.
 void setMetadataURL(MetadataURL[] metadataURL)
          sets the metadataURL
 void setName(java.lang.String name)
          sets the name of the layer
 void setParent(Layer parent)
          sets the parent layer of this layer.
 void setScaleHint(ScaleHint scaleHint)
          sets the
 void setSrs(java.lang.String[] srs)
          sets the srs
 void setStyles(Style[] styles)
          sets a list of style that can be used form rendering the layer.
 void setTitle(java.lang.String title)
          sets the title for the layer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Layer

public Layer(boolean queryable,
             int cascaded,
             boolean opaque,
             boolean noSubsets,
             int fixedWidth,
             int fixedHeight,
             java.lang.String name,
             java.lang.String title,
             java.lang.String abstract_,
             Envelope latLonBoundingBox,
             Attribution attribution,
             ScaleHint scaleHint,
             java.lang.String[] keywordList,
             java.lang.String[] srs,
             LayerBoundingBox[] boundingBoxes,
             Dimension[] dimensions,
             Extent[] extents,
             AuthorityURL[] authorityURLs,
             Identifier[] identifiers,
             MetadataURL[] metadataURLs,
             DataURL[] dataURLs,
             FeatureListURL[] featureListURLs,
             Style[] styles,
             Layer[] layers,
             AbstractDataSource[] dataSource,
             Layer parent)
constructor initializing the class with the <Layer>

Parameters:
queryable -
cascaded -
opaque -
noSubsets -
fixedWidth -
fixedHeight -
name -
title -
abstract_ -
latLonBoundingBox -
attribution -
scaleHint -
keywordList -
srs -
boundingBoxes -
dimensions -
extents -
authorityURLs -
identifiers -
metadataURLs -
dataURLs -
featureListURLs -
styles -
layers -
dataSource -
parent -
Method Detail

getName

public java.lang.String getName()
If, and only if, a layer has a <Name>, then it is a map layer that can be requested by using that Name in the LAYERS parameter of a GetMap request. If the layer has a Title but no Name, then that layer is only a category title for all the layers nested within. A Map Server that advertises a Layer containing a Name element shall be able to accept that Name as the value of LAYERS argument in a GetMap request and return the corresponding map. A Client shall not attempt to request a layer that has a Title but no Name.

Returns:
the name

setName

public void setName(java.lang.String name)
sets the name of the layer

Parameters:
name -

getTitle

public java.lang.String getTitle()
A <Title> is required for all layers; it is a human-readable string for presentation in a menu. The Title is not inherited by child Layers.

Returns:
the title

setTitle

public void setTitle(java.lang.String title)
sets the title for the layer

Parameters:
title -

getAbstract

public java.lang.String getAbstract()
Abstract is a narrative description of the map layer. The Abstract elements are not inherited by child Layers.

Returns:
the abstract

setAbstract

public void setAbstract(java.lang.String abstract_)
sets the a narrative description of the map layer

Parameters:
abstract_ -

getKeywordList

public java.lang.String[] getKeywordList()
KeywordList contains zero or more Keywords to aid in catalog searches. The KeywordList elements are not inherited by child Layers.

Returns:
the keywords

addKeyword

public void addKeyword(java.lang.String keyword)
adds the keywordList

Parameters:
keyword -

setKeywordList

public void setKeywordList(java.lang.String[] keywordList)
sets the keywordList

Parameters:
keywordList -

getSrs

public java.lang.String[] getSrs()
Every Layer is available in one or more spatial reference systems Every Layer shall have at least one >SRS> element that is either stated explicitly or inherited from a parent Layer . The root <Layer> element shall include a sequence of zero or more SRS elements listing all SRSes that are common to all subsidiary layers. Use a single SRS element with empty content (like so: "<SRS></SRS> ") if there is no common SRS. Layers may optionally add to the global SRS list, or to the list inherited from a parent layer. Any duplication shall be ignored by clients. When a Layer is available in several Spatial Reference Systems, there are two ways to encode the list of SRS values. The first of these is new in this version of the specification, the second is deprecated but still included for backwards compatibility.

1. Optional, recommended: Multiple single-valued <SRS> elements: a list of SRS values is represented as a sequence of <SRS> elements, each of which contains only a single SRS name. Example: <SRS>EPSG:1234</SRS> <SRS>EPSG:5678</SRS>.

2. Deprecated: Single list-valued <SRS> element: a list of SRS values is represented asa whitespace-separated list of SRS names contained within a single <SRS> element. Example: <SRS>EPSG:1234 EPSG:5678</SRS>.

Returns:
the srs

isSrsSupported

public boolean isSrsSupported(java.lang.String srs)
Parameters:
srs -
Returns:
s true if the submitted srs (name) is supported by the layer

addSrs

public void addSrs(java.lang.String srs)
adds the spatial reference system (srs)

Parameters:
srs -

setSrs

public void setSrs(java.lang.String[] srs)
sets the srs

Parameters:
srs -

getLatLonBoundingBox

public Envelope getLatLonBoundingBox()
Every Layer shall have exactly one <LatLonBoundingBox> element that is either stated explicitly or inherited from a parent Layer. LatLonBoundingBox states the minimum bounding rectangle of the map data in the EPSG:4326 geographic coordinate system. The LatLonBoundingBox attributes minx, miny, maxx, maxy indicate the edges of an enclosing rectangle in decimal degrees. LatLonBoundingBox shall be supplied regardless of what SRS the map server may support, but it may be approximate if EPSG:4326 is not supported. Its purpose is to facilitate geographic searches without requiring coordinate transformations by the search engine.

Returns:
the bbox

setLatLonBoundingBox

public void setLatLonBoundingBox(Envelope latLonBoundingBox)
sets the LatLonBoundingBox element that is either stated explicitly or inherited from a parent Layer.

Parameters:
latLonBoundingBox -

getBoundingBoxes

public LayerBoundingBox[] getBoundingBoxes()
Layers may have zero or more <BoundingBox> elements that are either stated explicitly or inherited from a parent Layer. Each BoundingBox states the bounding rectangle of the map data in a particular spatial reference system; the attribute SRS indicates which SRS applies. If the data area is shaped irregularly then the BoundingBox gives the minimum enclosing rectangle. The attributes minx, miny, maxx, maxy indicate the edges of the bounding box in units of the specified SRS. Optional resx and resy attributes indicate the spatial resolution of the data in those same units.

A Layer may have multiple BoundingBox element, but each one shall state a different SRS. A Layer inherits any BoundingBox values defined by its parents. A BoundingBox inherited from the parent Layer for a particular SRS is replaced by any declaration for the same SRS in the child Layer. A BoundingBox in the child for a new SRS not already declared by the parent is added to the list of bounding boxes for the child Layer. A single Layer element shall not contain more than one BoundingBox for the same SRS.

Returns:
bounding boxes

addBoundingBox

public void addBoundingBox(Envelope boundingBox)
adds the <BoundingBox>

Parameters:
boundingBox -

setBoundingBox

public void setBoundingBox(LayerBoundingBox[] boundingBox)
sets the boundingBox

Parameters:
boundingBox -

getDimension

public Dimension[] getDimension()
Dimension declarations are inherited from parent Layers. Any new Dimension declarations in the child are added to the list inherited from the parent. A child shall not redefine a Dimension with the same name attribute as one that was inherited.

Returns:
the dimensions

addDimension

public void addDimension(Dimension dimension)
adds the dimension

Parameters:
dimension -

setDimension

public void setDimension(Dimension[] dimension)
sets the dimension

Parameters:
dimension -

getExtent

public Extent[] getExtent()
Extent declarations are inherited from parent Layers. Any Extent declarations in the child with the same name attribute as one inherited from the parent replaces the value declared by the parent. A Layer shall not declare an Extent unless a Dimension with the same name has been declared or inherited earlier in the Capabilities XML.

Returns:
the extents

addExtent

public void addExtent(Extent extent)
adds the extent declarations

Parameters:
extent -

setExtent

public void setExtent(Extent[] extent)
sets the extent

Parameters:
extent -

getAttribution

public Attribution getAttribution()
The optional <Attribution> element provides a way to identify the source of the map data used in a Layer or collection of Layers. Attribution encloses several optional elements: states the data provider's URL; <Title> is a human-readable string naming the data provider; <LogoURL> is the URL of a logo image. Client applications may choose to display one or more of these items. A <Format> element in LogoURL indicates the MIME type of the logo image, and the attributes width and height state the size of the image in pixels.

Returns:
the attribution

setAttribution

public void setAttribution(Attribution attribution)
sets the optional <Attribution> element

Parameters:
attribution -

getAuthorityURL

public AuthorityURL[] getAuthorityURL()
The authority attribute of the Identifier element corresponds to the name attribute of a separate <AuthorityURL> element. AuthorityURL encloses an <OnlineResource> element which states the URL of a document defining the meaning of the Identifier values.

Returns:
the authority url object

addAuthorityURL

public void addAuthorityURL(AuthorityURL authorityURL)
adds the authority attribute of the Identifier element

Parameters:
authorityURL -

setAuthorityURL

public void setAuthorityURL(AuthorityURL[] authorityURL)
sets the authority attribute of the Identifier element

Parameters:
authorityURL -

getIdentifier

public Identifier[] getIdentifier()
A Map Server may use zero or more <Identifier> elements to list ID numbers or labels defined by a particular Authority. The text content of the Identifier element is the ID value.

Returns:
the identifiers

addIdentifier

public void addIdentifier(Identifier identifier)
adds the <Identifier>

Parameters:
identifier -

setIdentifier

public void setIdentifier(Identifier[] identifier)
sets the <Identifier>

Parameters:
identifier -

getMetadataURL

public MetadataURL[] getMetadataURL()
A Map Server should use one or more <MetadataURL> elements to offer detailed, standardized metadata about the data underneath a particular layer. The type attribute indicates the standard to which the metadata complies. Two types are defined at present: the value 'TC211' refers to [ISO 19115]; the value 'FGDC' refers to [FGDC-STD-001-1988]. The MetadataURL element shall not be used to reference metadata in a non-standardized metadata format; see DataURL instead. The enclosed <Format> element indicates the file format MIME type of the metadata record.

Returns:
the metadata urls

addMetadataURL

public void addMetadataURL(MetadataURL metadataURL)
adds the metadataURL

Parameters:
metadataURL -

setMetadataURL

public void setMetadataURL(MetadataURL[] metadataURL)
sets the metadataURL

Parameters:
metadataURL -

getDataURL

public DataURL[] getDataURL()
A Map Server may use DataURL to offer more information about the data represented by a particular layer. While the semantics are not well-defined, as long as the results of an HTTP GET request against the DataURL are properly MIME-typed, Viewer Clients and Cascading Map Servers can make use of this. Use 6lt;MetadataURL> instead for a precisely defined reference to standardized metadata records.

Returns:
the data URLs

addDataURL

public void addDataURL(DataURL dataURL)
adds the dataURL

Parameters:
dataURL -

setDataURL

public void setDataURL(DataURL[] dataURL)
sets the dataURL

Parameters:
dataURL -

getFeatureListURL

public FeatureListURL[] getFeatureListURL()
A Map Server may use a <FeatureListURL> element to point to a list of the features represented in a Layer.

Returns:
the feature list urls

addFeatureListURL

public void addFeatureListURL(FeatureListURL featureListURL)
adds the <FeatureListURL>

Parameters:
featureListURL -

setFeatureListURL

public void setFeatureListURL(FeatureListURL[] featureListURL)
sets the <FeatureListURL>

Parameters:
featureListURL -

getStyles

public Style[] getStyles()
Returns:
a list of style that can be used for rendering the layer.

addStyles

public void addStyles(Style style)
adds a list of style that can be used form rendering the layer.

Parameters:
style -

setStyles

public void setStyles(Style[] styles)
sets a list of style that can be used form rendering the layer.

Parameters:
styles -

getStyle

public UserStyle getStyle(java.lang.String name)
returns the UserStyle (SLD) representation of the style identified by the submitted name.

Parameters:
name - of the requested style
Returns:
SLD - UserStyle

getStyleResource

public Style getStyleResource(java.lang.String name)
returns the Style identified by the submitted name.

Parameters:
name - of the requested style
Returns:
Style

getScaleHint

public ScaleHint getScaleHint()
Layers may include a <ScaleHint> element that suggests minimum and maximum scales for which it is appropriate to display this layer. Because WMS output is destined for output devices of arbitrary size and resolution, the usual definition of scale as the ratio of map size to real-world size is not appropriate here. The following definition of Scale Hint is recommended. Consider a hypothetical map with a given Bounding Box, width and height. The central pixel of that map (or the pixel just to the northwest of center) will have some size, which can be expressed as the ground distance in meters of the southwest to northeast diagonal of that pixel. The two values in ScaleHint are the minimum and maximum recommended values of that diagonal. It is recognized that this definition is not geodetically precise, but at the same time the hope is that by including it conventions will develop that can be later specified more clearly.

Returns:
the scale hint

setScaleHint

public void setScaleHint(ScaleHint scaleHint)
sets the

Parameters:
scaleHint -

getLayer

public Layer[] getLayer()
returns a list of layers the are enclosed by this layer.

Returns:
the layers

removeLayer

public Layer removeLayer(java.lang.String name)
removes a Layer identified by its name from the parent Layer. A reference to the removed layer will be returned. If no Layer matching the passed name can be found nothing happens and null will be returned.

Parameters:
name -
Returns:
removerd Layer

removeLayerByTitle

public Layer removeLayerByTitle(java.lang.String title)
removes a Layer identified by its title from the parent Layer. A reference to the removed layer will be returned. If no Layer matching the passed title can be found nothing happens and null will be returned.

Parameters:
title -
Returns:
removerd Layer

addLayer

public void addLayer(Layer layer)
adds a list of layers the are enclosed by this layer.

Parameters:
layer -

setLayer

public void setLayer(Layer[] layer)
sets a list of layers the are enclosed by this layer.

Parameters:
layer -

getDataSource

public AbstractDataSource[] getDataSource()
source where the WMS can find the data of a layer.

Returns:
the data sources

setDataSource

public void setDataSource(AbstractDataSource[] dataSource)
source where the WMS can find the data of a layer.

Parameters:
dataSource -

addDataSource

public void addDataSource(AbstractDataSource dataSource)
source where the WMS can find the data of a layer.

Parameters:
dataSource -

getParent

public Layer getParent()
Returns:
the parent layer of this layer. If the method returns null the current layer is the root layer. In addition with the getLayer method this enables a program to traverse the layer tree in both directions.

setParent

public void setParent(Layer parent)
sets the parent layer of this layer.

Parameters:
parent -

getCascaded

public int getCascaded()
Returns:
'0' if the layer is provided directly form the deegree WMS. other it returns the number of cascaded WMS servers the is passed through

getFixedHeight

public int getFixedHeight()
Returns:
'0' if the WMS can resize map to arbitrary height. nonzero: map has a fixed height that cannot be changed by the WMS.

getFixedWidth

public int getFixedWidth()
Returns:
'0' if the WMS can resize map to arbitrary width. nonzero: map has a fixed width that cannot be changed by the WMS.

hasNoSubsets

public boolean hasNoSubsets()
Returns:
false if the WMS can map a subset of the full bounding box.

isOpaque

public boolean isOpaque()
Returns:
false if map data represents vector features that probably do not completely fill space.

isQueryable

public boolean isQueryable()
Returns:
true if the layer is queryable. That means it can be targeted by a GetFeatureInfo request.

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org