[fdo-trac] #524: SDF spatial index error on existing SDF file

FDO trac_fdo at osgeo.org
Tue May 12 22:16:14 EDT 2009


#524: SDF spatial index error on existing SDF file
--------------------------+-------------------------------------------------
 Reporter:  leodai        |         Owner:  leodai  
     Type:  defect        |        Status:  assigned
 Priority:  major         |     Milestone:  3.5.0   
Component:  SDF Provider  |       Version:  3.4.0   
 Severity:  3             |    Resolution:          
 Keywords:                |   External_id:  1173929 
--------------------------+-------------------------------------------------
Changes (by leodai):

  * status:  new => assigned

Comment:

 This problem is because the attached sdf file's RTREE Table is corrupted.
 Debug
 into the code, I found the RTREE table is opened successfully, but it
 return
 error code while reading the data later.
 The original code is like blow:
 If (db->open() != 0)
 {
         //create a new table
 }
 ...
 //get the data
 If (db->get() !=0)
       Return error;

 Apparently, the original rtree table have some problem. To fix this issue,
 we
 should actually do a rebuild r-tree, by reading all geometries and build
 the r-
 tree. And then the sdf file can be operate successfully.

 Take the rebuilding index table for a example, we first detect the case,
 and
 recreate an empty r-tree if the original r-tree corrupted. And marked it
 that
 this r-tree needs to be regened. Later we will rebuild the r-tree fully.

 Note: if the file is read-only, we will pop up the following error msg
 "Error Rebuilding the corrupted sptial index. File is possibly read-only"
 And use the the existing string "An error occurred during SDF database
 access."
 in update 1 due to resouce modify restriction

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/524#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list