I am trying to add index to relation in db, but don't know is it right?
ListParameterization spatparams = new ListParameterization();
spatparams.addParameter(INDEX_ID, RStarTreeFactory.class);
spatparams.addParameter(AbstractPageFileFactory.Parameterizer.PAGE_SIZE_ID, 300);
spatparams.addParameter(AbstractRStarTreeFactory.Parameterizer.INSERTION_STRATEGY_ID, ApproximativeLeastOverlapInsertionStrategy.class);
spatparams.addParameter(ApproximativeLeastOverlapInsertionStrategy.Parameterizer.INSERTION_CANDIDATES_ID, 1);
// Adapter to load data from an existing array.
DatabaseConnection dbc = new ArrayAdapterDatabaseConnection(data);
// Create a database (which may contain multiple relations!)
Collection<IndexFactory<?, ?>> indexFactories = new ArrayList<>();
ObjectListParameter<IndexFactory<?, ?>> indexFactoryP = new ObjectListParameter<>(INDEX_ID, IndexFactory.class, true);
indexFactories.addAll(indexFactoryP.instantiateClasses(spatparams));
Database db = new StaticArrayDatabase(dbc, indexFactories);
db.initialize();
To instantiate a class via the parameterization API, you don't need to create a new parameter.
RStarTreeFactory<DoubleVector> f =
ClassGenericsUtil.parameterizeOrAbort(RStarTreeFactory.class, params);
For the R-star tree, I suggest to use SortTileRecursive bulk loading.