Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *  Copyright: 2000 Regents of the University of California and the
4
 *             National Center for Ecological Analysis and Synthesis
5
 *
6
 * Author: John Harris 
7
 * '$Date: 2006-02-16 13:41:30 -0800 (Thu, 16 Feb 2006) $'
8
 * '$Revision: 2909 $'
9
 *
10
 * This program is free software; you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation; either version 2 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program; if not, write to the Free Software
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
 */
24

    
25

    
26
package edu.ucsb.nceas.metacat.spatial;
27

    
28
import org.apache.log4j.Logger;
29

    
30
/**
31
 * Class that reflects a query against Metacat to gatther spatial data  -- this
32
 * could be a text query that returns a spatial dataset or a spatial query that
33
 * returns a spatially-referenced dataset.
34
 */
35
public class MetacatSpatialExtents {
36
  
37
  /** true if the document is represented by a single point and 
38
   *  false if is represented by a bouding box
39
   */
40
  private boolean isPoint = true;
41

    
42
  /** the coordinates of the bounding box, or of the point **/
43
  private float xmin, ymin, xmax, ymax; 
44

    
45
  /** the docid of the extents **/
46
  private String docid;
47
 
48
  private static Logger log = Logger.getLogger(MetacatSpatialExtents.class.getName());
49

    
50
  public MetacatSpatialExtents() {}
51
  
52
  public MetacatSpatialExtents(String _docid ) {
53
    setDocid(_docid);
54
  }
55

    
56
  public void setIsPoint(boolean valid) {
57
    this.isPoint = valid;
58
  }
59

    
60
  public boolean getIsPoint() {
61
    return this.isPoint;
62
  }
63

    
64
  public void setDocid(String _docid) {
65
    this.docid = _docid;
66
  }
67

    
68
  public String getDocid() {
69
    return docid;
70
  }
71

    
72
  public void setXMin(float _xmin) {
73
    this.xmin = _xmin;
74
  }
75

    
76
  public float getXMin() { return xmin; }
77
  
78
  public void setYMin(float _ymin) {
79
    this.ymin = _ymin;
80
  }
81
  
82
  public float getYMin() { return ymin; }
83
  
84
  public void setXMax(float _xmax) {
85
    this.xmax = _xmax;
86
  }
87
  
88
  public float getXMax() { return xmax; }
89
  
90
  public void setYMax(float _ymax) {
91
    this.ymax = _ymax;
92
  }
93
  
94
  public float getYMax() { return ymax; }
95

    
96
  public String toString() {
97
   return ("\n\n***************************************************************"
98
          +"\n docid: " +  docid + " \n is point: " + isPoint
99
          +"\n x min: " +  getXMin() + " \n x max: " + getXMax() 
100
          +"\n y min: " +  getYMin() + " \n y max: " + getYMax()
101
          +"\n***************************************************************\n"); 
102
  
103
  }
104

    
105

    
106
}
(4-4/10)