Project

General

Profile

« Previous | Next » 

Revision 3201

Added by Jing Tao over 17 years ago

Change the exception handle way accroding the change in SpatialDataset class.

View differences:

src/edu/ucsb/nceas/metacat/spatial/SpatialHarvester.java
132 132
   */
133 133
  public void deleteDocument( String docid ) {
134 134

  
135
     // Read the existing spatial dataset cache
136
     SpatialDataset sds = new SpatialDataset();
135
     
137 136

  
138 137
     try {
138
//    	 Read the existing spatial dataset cache
139
         SpatialDataset sds = new SpatialDataset();
139 140
         // Delete both the polygon(s) and point(s)
140 141
         sds.delete( "polygon" , docid ); 
141 142
         sds.delete( "point" , docid ); 
......
156 157
  public void harvestDocument( String docid ) {
157 158

  
158 159
     long before = System.currentTimeMillis();
159
     // Read the existing spatial dataset cache
160
     SpatialDataset sds = new SpatialDataset();
160
     
161
     try {
162
         //Read the existing spatial dataset cache
163
         SpatialDataset sds = new SpatialDataset();
161 164

  
162
     // insert OR update the spatial cache
163
     // SpatialDataset.insertOrUpdate takes care of the difference 
164
     SpatialDocument sdoc = new SpatialDocument( docid, dbconn );
165
         // insert OR update the spatial cache
166
         // SpatialDataset.insertOrUpdate takes care of the difference 
167
         SpatialDocument sdoc = new SpatialDocument( docid, dbconn );
165 168

  
166
     try {
167 169
         Feature polygonFeature = sdoc.getPolygonFeature();
168 170
         sds.insertOrUpdate("polygon", polygonFeature, docid );
169 171

  
......
180 182
   * Completely regenerates the spatial cache. 
181 183
   * This can take a long time, especially with lots of documents.
182 184
   */
183
  public void regenerate() {
185
  public void regenerate() throws IOException{
184 186
      
185 187
      // Create new Spatial Dataset
186 188
      SpatialDataset sds = new SpatialDataset();

Also available in: Unified diff