Package org.geotools.caching.grid.spatialindex

Examples of org.geotools.caching.grid.spatialindex.GridSpatialIndex


    TestNode n;
    RegionNodeIdentifier id;
    GridSpatialIndex grid;

    protected void setUp() {
        grid = new GridSpatialIndex(new Region(new double[] { 0, 0 }, new double[] { 1, 1 }), 10,
                MemoryStorage.createInstance(), 200);
        n = new TestNode(grid, new Region(new double[] { 0, 0 }, new double[] { 1, 1 }));
        id = new RegionNodeIdentifier(n);
        store = createStorage();
    }
View Full Code Here


     * @param capacity       maximum number of features to cache
     * @param store         the cache storage
     */
    public GridFeatureCache(SimpleFeatureSource fs, ReferencedEnvelope env, int gridsize, int capacity, Storage store){
        super(fs);
        tracker = new GridSpatialIndex(CacheUtil.convert(env), gridsize, store, capacity);
        this.capacity = capacity;

        //lets compare the feature type in the store to the feature type of the current feature source
        //if they differ we need to  clear the cache as the features have changed.
        if (store.getFeatureTypes().size() == 0){
View Full Code Here

        return this.cache;
    }
   
   
    public void testRegister() {
        GridSpatialIndex index = (GridSpatialIndex)((GridFeatureCache)cache).getIndex();
        double tilesize = index.getRootNode().getTileSize();
        Region r = (Region)index.getRootNode().getShape();
       
        //matches all
        Envelope e = new Envelope(r.getLow(0), r.getHigh(0), r.getLow(1), r.getHigh(1));
        List<Envelope> matches = cache.match(e);
        assertEquals(1, matches.size());
View Full Code Here

TOP

Related Classes of org.geotools.caching.grid.spatialindex.GridSpatialIndex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.