001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/ogcwebservices/wms/capabilities/LayerBoundingBox.java $
002    /*----------------    FILE HEADER  ------------------------------------------
003    
004    This file is part of deegree.
005    Copyright (C) 2001-2008 by:
006    EXSE, Department of Geography, University of Bonn
007    http://www.giub.uni-bonn.de/deegree/
008    lat/lon GmbH
009    http://www.lat-lon.de
010    
011    This library is free software; you can redistribute it and/or
012    modify it under the terms of the GNU Lesser General Public
013    License as published by the Free Software Foundation; either
014    version 2.1 of the License, or (at your option) any later version.
015    
016    This library is distributed in the hope that it will be useful,
017    but WITHOUT ANY WARRANTY; without even the implied warranty of
018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
019    Lesser General Public License for more details.
020    
021    You should have received a copy of the GNU Lesser General Public
022    License along with this library; if not, write to the Free Software
023    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
024    
025    Contact:
026    
027    Andreas Poth
028    lat/lon GmbH
029    Aennchenstr. 19
030    53115 Bonn
031    Germany
032    E-Mail: poth@lat-lon.de
033    
034    Prof. Dr. Klaus Greve
035    Department of Geography
036    University of Bonn
037    Meckenheimer Allee 166
038    53115 Bonn
039    Germany
040    E-Mail: greve@giub.uni-bonn.de
041    
042                     
043     ---------------------------------------------------------------------------*/
044    package org.deegree.ogcwebservices.wms.capabilities;
045    
046    import org.deegree.model.spatialschema.EnvelopeImpl;
047    import org.deegree.model.spatialschema.Position;
048    
049    
050    /**
051     * Layers may have zero or more <BoundingBox> elements that are either stated
052     * explicitly or inherited from a parent Layer. Each BoundingBox states the
053     * bounding rectangle of the map data in a particular spatial reference system;
054     * the attribute SRS indicates which SRS applies. If the data area is shaped
055     * irregularly then the BoundingBox gives the minimum enclosing rectangle.The
056     * attributes minx, miny, maxx, maxy indicate the edges of the bounding box in
057     * units of the specified SRS. Optional resx and resy attributes indicate the
058     * spatial resolution of the data in those same units.
059     * <p></p>
060     * A Layer may have multiple BoundingBox element, but each one shall state a
061     * different SRS. A Layer inherits any BoundingBox values defined by its parents.
062     * A BoundingBox inherited from the parent Layer for a particular SRS is replaced
063     * by any declaration for the same SRS in the child Layer. A BoundingBox in the
064     * child for a new SRS not already declared by the parent is added to the list
065     * of bounding boxes for the child Layer. A single Layer element shall not
066     * contain more than one BoundingBox for the same SRS.
067     * <p>----------------------------------------------------------------------</p>
068     *
069     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
070     * @version 2002-03-01
071     */
072    public class LayerBoundingBox extends EnvelopeImpl {
073    
074        private static final long serialVersionUID = 4865010531322434459L;
075    
076        private String sRS = null;
077        
078        private double resx = 0;
079        
080        private double resy = 0;
081    
082      
083        /**
084        * constructor initializing the class with the <LayerBoundingBox>
085         * @param min 
086         * @param max 
087         * @param srs 
088         * @param resx 
089         * @param resy 
090        */
091        public LayerBoundingBox( Position min, Position max, String srs, double resx, double resy ) {
092            super( min, max );
093            setSRS( srs );
094            setResx( resx );
095            setResy( resy );
096        }
097    
098        /**
099         * @return spatial resolution of the layers data in x-direction. If the resolution
100         * isn't known <tt>-1</tt> will be returned.
101         */
102        public double getResx() {
103            return resx;
104        }
105    
106        /**
107        * sets spatial resolution of the layers data in x-direction
108        * @param resx
109        */
110        public void setResx( double resx ) {
111            this.resx = resx;
112        }
113    
114        /**
115         * @return spatial resolution of the layers data in x-direction. If the resolution
116         * isn't known <tt>-1</tt> will be returned.
117         */
118        public double getResy() {
119            return resy;
120        }
121    
122        /**
123        * sets spatial resolution of the layers data in x-direction
124        * @param resy
125        */
126        public void setResy( double resy ) {
127            this.resy = resy;
128        }
129    
130        /**
131         * @return the name the spatial reference system of the bounding box
132         */
133        public String getSRS() {
134            return sRS;
135        }
136    
137        /**
138         * sets the name of the spatial reference system of the bounding box
139         * @param srs
140         */
141        public void setSRS( String srs ) {
142            sRS = srs;
143        }
144    
145        @Override
146        public String toString() {
147            String ret = null;
148            ret = "resx = " + resx + "\n";
149            ret += ( "resy = " + resy + "\n" );
150            ret += ( "sRS = " + sRS + "\n" );
151            return ret;
152        }
153    
154    }