001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/wms/capabilities/ScaleHint.java $
002    /*----------------------------------------------------------------------------
003     This file is part of deegree, http://deegree.org/
004     Copyright (C) 2001-2009 by:
005       Department of Geography, University of Bonn
006     and
007       lat/lon GmbH
008    
009     This library is free software; you can redistribute it and/or modify it under
010     the terms of the GNU Lesser General Public License as published by the Free
011     Software Foundation; either version 2.1 of the License, or (at your option)
012     any later version.
013     This library is distributed in the hope that it will be useful, but WITHOUT
014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016     details.
017     You should have received a copy of the GNU Lesser General Public License
018     along with this library; if not, write to the Free Software Foundation, Inc.,
019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020    
021     Contact information:
022    
023     lat/lon GmbH
024     Aennchenstr. 19, 53177 Bonn
025     Germany
026     http://lat-lon.de/
027    
028     Department of Geography, University of Bonn
029     Prof. Dr. Klaus Greve
030     Postfach 1147, 53001 Bonn
031     Germany
032     http://www.geographie.uni-bonn.de/deegree/
033    
034     e-mail: info@deegree.org
035    ----------------------------------------------------------------------------*/
036    package org.deegree.ogcwebservices.wms.capabilities;
037    
038    
039    
040    /**
041     * Layers may include a <ScaleHint> element that suggests minimum and maximum
042     * scales for which it is appropriate to display this layer. Because WMS output
043     * is destined for output devices of arbitrary size and resolution, the usual
044     * definition of scale as the ratio of map size to real-world size is not
045     * appropriate here. The following definition of Scale Hint is recommended.
046     * Consider a hypothetical map with a given Bounding Box, width and height.
047     * The central pixel of that map (or the pixel just to the northwest of center)
048     * will have some size, which can be expressed as the ground distance in meters
049     * of the southwest to northeast diagonal of that pixel. The two values in
050     * ScaleHint are the minimum and maximum recommended values of that diagonal. It
051     * is recognized that this definition is not geodetically precise, but at the
052     * same time the hope is that by including it conventions will develop that can
053     * be later specified more clearly.
054     * <p>----------------------------------------------------------------------</p>
055     *
056     * @author <a href="mailto:k.lupp@web.de">Andreas Poth</a>
057     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider</a>
058     * @version $Revision: 18195 $
059     */
060    public class ScaleHint {
061        private double max = Double.MAX_VALUE;
062        private double min = 0;
063    
064        /**
065        * constructor initializing the class with the <ScaleHint>
066         * @param min
067         * @param max
068        */
069        public ScaleHint( double min, double max ) {
070            setMin( min );
071            setMax( max );
072        }
073    
074        /**
075         * @return the minimum scale for which a layer is defined
076         */
077        public double getMin() {
078            return min;
079        }
080    
081        /**
082        * sets the minimum scale for which a layer is defined
083        * @param min
084        */
085        public void setMin( double min ) {
086            this.min = min;
087        }
088    
089        /**
090         * @return the maximum scale for which a layer is defined
091         */
092        public double getMax() {
093            return max;
094        }
095    
096        /**
097        * sets the maximum scale for which a layer is defined
098        * @param max
099        */
100        public void setMax( double max ) {
101            this.max = max;
102        }
103    
104        @Override
105        public String toString() {
106            String ret = null;
107            ret = "min = " + min + "\n";
108            ret += ( "max = " + max + "\n" );
109            return ret;
110        }
111    
112    }