001 // $HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/ogcwebservices/LonLatEnvelope.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 045 package org.deegree.ogcwebservices; 046 047 import java.io.Serializable; 048 049 import org.deegree.datatypes.time.TimePosition; 050 import org.deegree.framework.util.StringTools; 051 import org.deegree.model.spatialschema.Envelope; 052 import org.deegree.model.spatialschema.GeometryFactory; 053 import org.deegree.model.spatialschema.Point; 054 055 /** 056 * @version $Revision: 6259 $ 057 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a> 058 * @author last edited by: $Author: bezema $ 059 * 060 * @version 1.0. $Revision: 6259 $, $Date: 2007-03-20 10:15:15 +0100 (Di, 20 Mär 2007) $ 061 * 062 * @since 2.0 063 */ 064 065 public class LonLatEnvelope implements Cloneable, Serializable { 066 067 068 private static final long serialVersionUID = 6225897903182806919L; 069 070 private Point min = null; 071 private Point max = null; 072 private TimePosition[] timePositions = new TimePosition[0]; 073 074 private String srs = "WGS84(DD)"; 075 076 /** 077 * @param min 078 * @param max 079 */ 080 public LonLatEnvelope(Point min, Point max) { 081 this.min = min; 082 this.max = max; 083 } 084 /** 085 * @param min 086 * @param max 087 * @param srs 088 */ 089 public LonLatEnvelope(Point min, Point max, String srs) { 090 this.min = min; 091 this.max = max; 092 this.srs = srs; 093 } 094 /** 095 * @param min 096 * @param max 097 * @param timePositions 098 * @param srs 099 */ 100 public LonLatEnvelope(Point min, Point max, TimePosition[] timePositions, String srs) { 101 this.min = min; 102 this.max = max; 103 this.timePositions = timePositions; 104 this.srs = srs; 105 } 106 107 /** 108 * @param minx 109 * @param miny 110 * @param maxx 111 * @param maxy 112 */ 113 public LonLatEnvelope(double minx, double miny, double maxx, double maxy) { 114 this.min = GeometryFactory.createPoint(minx, miny, null); 115 this.max = GeometryFactory.createPoint(maxx, maxy, null); 116 } 117 118 119 /** 120 * @param envelope 121 */ 122 public LonLatEnvelope(Envelope envelope) { 123 this.min = GeometryFactory.createPoint(envelope.getMin().getX(), 124 envelope.getMin().getY(), null); 125 this.max = GeometryFactory.createPoint(envelope.getMax().getX(), 126 envelope.getMax().getY(), null); 127 } 128 129 /** 130 * @return Returns the max. 131 */ 132 public Point getMax() { 133 return max; 134 } 135 136 /** 137 * @param max The max to set. 138 */ 139 public void setMax(Point max) { 140 this.max = max; 141 } 142 143 /** 144 * @return Returns the min. 145 */ 146 public Point getMin() { 147 return min; 148 } 149 150 /** 151 * @param min The min to set. 152 */ 153 public void setMin(Point min) { 154 this.min = min; 155 } 156 157 /** 158 * @return Returns the srs. 159 */ 160 public String getSrs() { 161 return srs; 162 } 163 164 /** 165 * @param srs The srs to set. 166 */ 167 public void setSrs(String srs) { 168 this.srs = srs; 169 } 170 171 /** 172 * @return Returns the timePositions. 173 */ 174 public TimePosition[] getTimePositions() { 175 return timePositions; 176 } 177 178 /** 179 * @param timePositions The timePositions to set. 180 */ 181 public void setTimePositions(TimePosition[] timePositions) { 182 if (timePositions == null) { 183 timePositions = new TimePosition[0]; 184 } 185 this.timePositions = timePositions; 186 } 187 188 189 public Object clone() { 190 TimePosition[] timePositions_ = new TimePosition[timePositions.length]; 191 for (int i = 0; i < timePositions_.length; i++) { 192 timePositions_[i] = (TimePosition)timePositions[i].clone(); 193 } 194 195 return new LonLatEnvelope( min, max, timePositions_, new String( srs )); 196 } 197 198 199 public String toString() { 200 return StringTools.concat( 200, "min: ", min, " max: ", max ); 201 } 202 } 203 /* ******************************************************************** 204 Changes to this class. What the people have been up to: 205 $Log$ 206 Revision 1.7 2006/04/06 20:25:27 poth 207 *** empty log message *** 208 209 Revision 1.6 2006/04/04 20:39:42 poth 210 *** empty log message *** 211 212 Revision 1.5 2006/03/30 21:20:26 poth 213 *** empty log message *** 214 215 Revision 1.4 2006/03/03 13:37:42 poth 216 *** empty log message *** 217 218 Revision 1.3 2005/02/11 10:43:57 friebe 219 fit for java 1.5 220 221 Revision 1.2 2005/01/18 22:08:54 poth 222 no message 223 224 Revision 1.6 2004/08/16 06:23:33 ap 225 no message 226 227 Revision 1.5 2004/07/05 06:15:00 ap 228 no message 229 230 Revision 1.4 2004/06/28 06:27:05 ap 231 no message 232 233 Revision 1.3 2004/06/16 09:46:02 ap 234 no message 235 236 Revision 1.2 2004/05/25 07:19:13 ap 237 no message 238 239 Revision 1.1 2004/05/24 06:54:38 ap 240 no message 241 242 243 ********************************************************************** */