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-24 16:55:55 -0800 (Fri, 24 Feb 2006) $'
8
 * '$Revision: 2919 $'
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
package edu.ucsb.nceas.metacat.spatial;
26

    
27
import org.apache.log4j.Logger;
28

    
29
/**
30
 * Class that reflects a Metacat Document in a spatially represented sense.
31
 */
32
public class MetacatSpatialDocument {
33

    
34
  private static Logger log = Logger.getLogger(MetacatSpatialDocument.class.getName());
35
  
36
  private String docid;
37

    
38
  private String title;
39

    
40
  private MetacatSpatialExtents extents;
41

    
42
  public MetacatSpatialDocument(String  docid) {
43
    setDocid(docid);
44
  }
45

    
46
  
47

    
48
  /**
49
   * function that registers the document with the Spatial system.  This is 
50
   * to be called when the document is inserted to the Metacat system.  At
51
   * registration time, this the Metacat Spatial Elements are requeruried, 
52
   * and the spatial database is repopulated
53
   */
54
  public void registerSpatialDocument() {
55
   log.info("Dataset " + docid + " is being registered with the metacat spatial system" ); 
56
  }
57

    
58
  public void setDocid(String _docid) {
59
    this.docid = _docid;
60
  }
61

    
62
  public void setExtents(MetacatSpatialExtents _extents) {
63
    this.extents = _extents;
64
  }
65

    
66

    
67
  /**
68
   * jitters a float value
69
   */
70
  public float jitter(float _val) {
71
    float _random = (float)Math.random();
72
    return _val+(_random/1000);
73
  }
74

    
75
  public String getMetacatURL() {
76
  
77
   return MetacatSpatialConstants.getServerContext()
78
   +"/"+MetacatSpatialConstants.getMetacatContext()+"/"; 
79
  
80
  }
81

    
82
  public String getTitle() { return this.title; }
83
  public void setTitle(String _title) {this.title = _title; }
84

    
85
  public float getXMin() { return extents.getXMin(); }
86
  public void setXMin(float x) { extents.setXMin(x); }
87
  
88
  public float getYMin() { return extents.getYMin(); }
89
  public void setYMin(float y) {extents.setYMin(y); }
90
  
91
  public float getXMax() { return extents.getXMax(); }
92
  public void setXMax(float x) {extents.setXMax(x); }
93
  
94
  public float getYMax() { return extents.getYMax(); }
95
  public void setYMax(float y) {extents.setYMax(y); }
96
  
97
  public String getDocid() { return this.docid; }
98
  
99
  public boolean getIsPoint() { return extents.getIsPoint(); }
100
  public void setIsPoint(boolean ispoint) { extents.setIsPoint(ispoint); }
101

    
102
}
(3-3/10)