001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/ogcwebservices/wms/capabilities/ScaleHint.java $
002    /*----------------    FILE HEADER  ------------------------------------------
003    
004    This file is part of deegree.
005    Copyright (C) 2001-2006 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    
047    
048    /**
049     * Layers may include a <ScaleHint> element that suggests minimum and maximum
050     * scales for which it is appropriate to display this layer. Because WMS output
051     * is destined for output devices of arbitrary size and resolution, the usual
052     * definition of scale as the ratio of map size to real-world size is not
053     * appropriate here. The following definition of Scale Hint is recommended.
054     * Consider a hypothetical map with a given Bounding Box, width and height.
055     * The central pixel of that map (or the pixel just to the northwest of center)
056     * will have some size, which can be expressed as the ground distance in meters
057     * of the southwest to northeast diagonal of that pixel. The two values in
058     * ScaleHint are the minimum and maximum recommended values of that diagonal. It
059     * is recognized that this definition is not geodetically precise, but at the
060     * same time the hope is that by including it conventions will develop that can
061     * be later specified more clearly.
062     * <p>----------------------------------------------------------------------</p>
063     *
064     * @author <a href="mailto:k.lupp@web.de">Andreas Poth</a>
065     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider</a>
066     * @version $Revision: 6259 $
067     */
068    public class ScaleHint {
069        private double max = Double.MAX_VALUE;
070        private double min = 0;
071    
072        /**
073        * constructor initializing the class with the <ScaleHint>
074         * @param min 
075         * @param max 
076        */
077        public ScaleHint( double min, double max ) {
078            setMin( min );
079            setMax( max );
080        }
081    
082        /**
083         * @return the minimum scale for which a layer is defined
084         */
085        public double getMin() {
086            return min;
087        }
088    
089        /**
090        * sets the minimum scale for which a layer is defined
091        * @param min
092        */
093        public void setMin( double min ) {
094            this.min = min;
095        }
096    
097        /**
098         * @return the maximum scale for which a layer is defined
099         */
100        public double getMax() {
101            return max;
102        }
103    
104        /**
105        * sets the maximum scale for which a layer is defined
106        * @param max
107        */
108        public void setMax( double max ) {
109            this.max = max;
110        }
111    
112        @Override
113        public String toString() {
114            String ret = null;
115            ret = "min = " + min + "\n";
116            ret += ( "max = " + max + "\n" );
117            return ret;
118        }
119       
120    }
121    /* ********************************************************************
122    Changes to this class. What the people have been up to:
123    $Log$
124    Revision 1.9  2006/09/08 08:42:02  schmitz
125    Updated the WMS to be 1.1.1 conformant once again.
126    Cleaned up the WMS code.
127    Added cite WMS test data.
128    
129    Revision 1.8  2006/07/12 14:46:18  poth
130    comment footer added
131    
132    ********************************************************************** */