001:
002: /*
003: * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
004: * for visualizing and manipulating spatial features with geometry and attributes.
005: *
006: * Copyright (C) 2003 Vivid Solutions
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or (at your option) any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
021: *
022: * For more information, contact:
023: *
024: * Vivid Solutions
025: * Suite #1A
026: * 2328 Government Street
027: * Victoria BC V8T 5G5
028: * Canada
029: *
030: * (250)385-6040
031: * www.vividsolutions.com
032: */
033:
034: package com.vividsolutions.wms;
035:
036: /**
037: * Represents a bounding box in a specific projection.
038: * A BoundingBox is immutable, so you must create a new BoundingBox object,
039: * rather than modify the the values of an existing BoundingBox.
040: * @author chodgson@refractions.net
041: */
042: public class BoundingBox {
043:
044: private String srs;
045: private double minx;
046: private double miny;
047: private double maxx;
048: private double maxy;
049:
050: /**
051: * Creates a new BoundingBox with the given SRS, minima and maxima.
052: * @param srs a WMS-style SRS string such as "EPSG:1234", or the
053: * special string "LatLon" for a latitude/longitude box
054: * @param minx the minimum x-value of the bounding box
055: * @param miny the minimum y-value of the bounding box
056: * @param maxx the maximum x-value of the bounding box
057: * @param maxy the maximum y-value of the bounding box
058: */
059: public BoundingBox(String srs, double minx, double miny,
060: double maxx, double maxy) {
061: this .srs = srs;
062: this .minx = minx;
063: this .miny = miny;
064: this .maxx = maxx;
065: this .maxy = maxy;
066: }
067:
068: /**
069: * Gets the SRS string.
070: * @return the BoundingBox's SRS WMS-style string
071: */
072: public String getSRS() {
073: return srs;
074: }
075:
076: /**
077: * Gets the BoundingBox's minimum x value.
078: * @return the BoundingBox's minimum x value
079: */
080: public double getMinX() {
081: return minx;
082: }
083:
084: /**
085: * Gets the BoundingBox's minimum y value.
086: * @return the BoundingBox's minimum y value
087: */
088: public double getMinY() {
089: return miny;
090: }
091:
092: /**
093: * Gets the BoundingBox's maximum x value.
094: * @return the BoundingBox's maximum x value
095: */
096: public double getMaxX() {
097: return maxx;
098: }
099:
100: /**
101: * Gets the BoundingBox's maximum y value.
102: * @return the BoundingBox's maximum y value
103: */
104: public double getMaxY() {
105: return maxy;
106: }
107:
108: }
|