Hejhej, using the classes ShapeFileIndexer and FidIndexer I've been able to create feature and tree indices for an instance of IndexedShapefileDataStore so that corresponding method isIndexed returns true.
I was also able to extract the generated rtree using the according constructor and the tree file (GRX-extension). However when searching the index with a given envelope it returns a list of Data-elements and I have no clue at all what to do with them. Here's the code hitherto: // IndexedShapefileDataStore idx already created... RTree r = new RTree(new FileSystemPageStore(treeIndexFile)); FeatureSource ftSource = idx.getFeatureSource(idx.getTypeNames()[0]); FeatureIterator ftIterator = ftSource.getFeatures().features(); Feature ft = ftIterator.next(); // List<Data> neighbors = new ArrayList<Data>(); List neighbors = r.search(ft.getBounds()); // returns a list of Data elements // what to do know? My objective is to use the rtree-index to speeden up the search for neighbors in a polygon layer... However I can't make any sense of the information (basically integer or long numbers) contained by the retrieved data elements... Can anybody give me hint? Thank you very much in advance. Regards, Markus -- View this message in context: http://www.nabble.com/How-to-use-an-rtree-index--tf4304911.html#a12253781 Sent from the geotools-gt2-users mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users