Package org.geotools.gce.imagemosaic

Examples of org.geotools.gce.imagemosaic.GranuleDescriptor


      // now build the index
      // TODO make it configurable as far the index is involved
      STRtree tree = new STRtree();
      long size=0;
      while (it.hasNext()) {
        final GranuleDescriptor granule = it.next();
        final ReferencedEnvelope env=ReferencedEnvelope.reference(granule.getGranuleBBOX());
        final Geometry g = (Geometry)FeatureUtilities.getPolygon(
            new Rectangle2D.Double(env.getMinX(),env.getMinY(),env.getWidth(),env.getHeight()),0);
        tree.insert(g.getEnvelopeInternal(), granule);
      }
     
View Full Code Here


    public void visitItem(Object o) {
        if(maxGranules>0&&granuleIndex>maxGranules){
            return; //Skip
        }
      if(o instanceof GranuleDescriptor){
        final GranuleDescriptor g = (GranuleDescriptor) o;
        final SimpleFeature originator = g.getOriginator();
        if(originator!=null&&filter.evaluate(originator)){
            adaptee.visit(g,null);
            granuleIndex++;
        }
        return;
View Full Code Here

        features.accepts(new AbstractFeatureVisitor() {
            public void visit(Feature feature) {
                if (feature instanceof SimpleFeature) {
                    // get the feature
                    final SimpleFeature sf = (SimpleFeature) feature;
                    GranuleDescriptor granule = null;

                    // caching by granule's location
//                    synchronized (descriptorsCache) {
                        String featureId = sf.getID();
                        if(descriptorsCache.containsKey(featureId)){
                            granule = descriptorsCache.get(featureId);
                        } else{
                            // create the granule descriptor
                            MultiLevelROI footprint = getGranuleFootprint(sf);
                            if(footprint == null || !footprint.isEmpty()) {
                                // caching only if the footprint is eithery absent or present and NON-empty
                                granule = new GranuleDescriptor(
                                                sf,
                                                adaptee.suggestedRasterSPI,
                                                adaptee.pathType,
                                                adaptee.locationAttribute,
                                                adaptee.parentLocation,
                                                footprint,
                                                adaptee.heterogeneous,
                                                adaptee.hints); // retain hints since this may contain a reader or anything
                                descriptorsCache.put(featureId, granule);
                            }
                        }
                       
                        if(granule != null) {
                            // check ROI inclusion
                            final Geometry footprint = granule.getFootprint();
                            if(intersectionGeometry==null||footprint==null||polygonOverlap(footprint, intersectionGeometry)){
                                visitor.visit(granule, null);
                            }else{
                                if(LOGGER.isLoggable(Level.FINE)){
                                    LOGGER.fine("Skipping granule "+granule+"\n since its ROI does not intersect the requested area");
View Full Code Here

                    if (feature instanceof SimpleFeature) {
                        // get the feature
                        final SimpleFeature sf = (SimpleFeature) feature;
                        MultiLevelROI footprint = getGranuleFootprint(sf);
                        if(footprint == null || !footprint.isEmpty()) {
                            final GranuleDescriptor granule = new GranuleDescriptor(sf,
                                    suggestedRasterSPI, pathType, locationAttribute, parentLocation,
                                    footprint,
                                    heterogeneous, q.getHints());
   
                            visitor.visit(granule, null);
View Full Code Here

TOP

Related Classes of org.geotools.gce.imagemosaic.GranuleDescriptor

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.