Package org.geotools.caching

Examples of org.geotools.caching.FeatureCollectingVisitor


     * Looks in the cache for any elements within the given envelope.
     * <p>Returns a in-memory feature collection.</p>
     */
    public SimpleFeatureCollection peek(Envelope e) {

        FeatureCollectingVisitor v = new FeatureCollectingVisitor(this.getSchema());
        lock.readLock().lock();

        try {
            this.tracker.intersectionQuery(CacheUtil.convert(e), v);
        } finally {
            lock.readLock().unlock();
        }

        return v.getCollection();
    }
View Full Code Here


    @Override
    public void testPut() throws CacheOversizedException {
        cache.put(dataset);

        FeatureCollectingVisitor v = new FeatureCollectingVisitor((SimpleFeatureType)dataset.getSchema());
        cache.tracker.intersectionQuery(CacheUtil.convert(unitsquare), v);

        //assertEquals(0, v.getCollection().size());
        List<Envelope> matches = cache.match(unitsquare);

        for (Iterator<Envelope> it = matches.iterator(); it.hasNext();) {
            cache.register(it.next());
        }

        cache.put(dataset);

        v = new FeatureCollectingVisitor((SimpleFeatureType)dataset.getSchema());
        cache.tracker.intersectionQuery(CacheUtil.convert(unitsquare), v);

        assertEquals(dataset.size(), v.getCollection().size());
    }
View Full Code Here

TOP

Related Classes of org.geotools.caching.FeatureCollectingVisitor

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.