Hi All,
I was trying out the IndexedShapefileDataStoreFactory . The thing noticed was the .grx file is not getting created.
I do rememeber it was getting created earlier .
Any thoughts. Attached is the sample code.
import java.io.IOException;
import java.util.HashMap;
import org.geotools.data.DataStore;
import org.geotools.data.DataStoreFinder;
import org.geotools.data.shapefile.indexed.IndexedShapefileDataStoreFactory;
public class TestIndexedShapeFile {
public TestIndexedShapeFile(){
System.out.println(IndexedShapefileDataStoreFactory.URLP.key);
System.out.println(IndexedShapefileDataStoreFactory.SPATIAL_INDEX_TYPE.key);
System.out.println(IndexedShapefileDataStoreFactory.CREATE_SPATIAL_INDEX.key);
System.out.println(IndexedShapefileDataStoreFactory.MEMORY_MAPPED.key);
HashMap params = new HashMap();
params.put("shapefile url","file://c:/temp/states.shp");
params.put("memory mapped buffer","true");
params.put("create spatial index","true");
params.put("index type","TREE_GRX");
try {
DataStore ds = DataStoreFinder.getDataStore(params);
System.out.println(ds.getFeatureSource("states").getBounds());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* @param args
*/
public static void main(String[] args) {
new TestIndexedShapeFile();
}
}
Thanks and Warm Regards,
Debasish Sahu
Technical Specialist (Software)
RMSI , INDIA.
Engineering and Spatial Group
Office : 91-120-2511102
Home : 0-9810604886
