float fillFactor = (float) minNodeEntries / (float) maxNodeEntries;
// create a memory-based storage manager
storageManager = new MemoryStorageManager();
PropertySet propertySet = new PropertySet();
propertySet.setProperty("FillFactor", new Double(fillFactor));
propertySet.setProperty("IndexCapacity", new Integer(maxNodeEntries));
propertySet.setProperty("LeafCapacity", new Integer(maxNodeEntries));
propertySet.setProperty("Dimension", new Integer(2));
String strTreeVariant = props.getProperty("TreeVariant");
Integer intTreeVariant = null;
if (strTreeVariant.equalsIgnoreCase("Linear")) {
intTreeVariant = new Integer(sil.spatialindex.SpatialIndex.RtreeVariantLinear);
} else if (strTreeVariant.equalsIgnoreCase("Quadratic")) {
intTreeVariant = new Integer(sil.spatialindex.SpatialIndex.RtreeVariantQuadratic);
} else {
// default
if (!strTreeVariant.equalsIgnoreCase("Rstar")) {
log.error("Property key TreeVariant: invalid value " + strTreeVariant + ", defaulting to Rstar");
}
intTreeVariant = new Integer(sil.spatialindex.SpatialIndex.RtreeVariantRstar);
}
propertySet.setProperty("TreeVariant", intTreeVariant);
tree = new RTree(propertySet, storageManager);
}