Examples of GranuleCatalogVisitor


Examples of org.geotools.gce.imagemosaic.catalog.GranuleCatalogVisitor

     
    }
   
    // checking that we get a single feature and that feature is correct
    final Collection<GranuleDescriptor> features = new ArrayList<GranuleDescriptor>();
    rasterManager.getGranuleDescriptors(query, new GranuleCatalogVisitor() {
                   
                    @Override
                    public void visit(GranuleDescriptor granule, Object o) {
                        features.add(granule);
                       
                    }
                });
    assertEquals(features.size(), 1);
    GranuleDescriptor granule=features.iterator().next();
    SimpleFeature sf=granule.getOriginator();
    assertNotNull(sf);
    Object ingestion = sf.getAttribute("ingestion");
    assertTrue(ingestion instanceof Timestamp);
    final GregorianCalendar gc=  new GregorianCalendar(TimeZone.getTimeZone("GMT"));
    gc.setTimeInMillis(1225497600000l);
    assertEquals(0,(((Timestamp)ingestion).compareTo(gc.getTime())));   
    Object elevation = sf.getAttribute("elevation");
    assertTrue(elevation instanceof Integer);
    assertEquals(((Integer)elevation).intValue(), 0);
   
   
   
    // Reverting order (the previous timestamp shouldn't match anymore)
    final SortBy[] clauses=new SortBy[]{
                          new SortByImpl(FeatureUtilities.DEFAULT_FILTER_FACTORY.property("ingestion"),SortOrder.ASCENDING),
                          new SortByImpl(FeatureUtilities.DEFAULT_FILTER_FACTORY.property("elevation"),SortOrder.DESCENDING),
              };
              query.setSortBy(clauses);
             
           // checking that we get a single feature and that feature is correct
                  features.clear();
                  rasterManager.getGranuleDescriptors(query, new GranuleCatalogVisitor() {
                     
                      @Override
                      public void visit(GranuleDescriptor granule, Object o) {
                          features.add(granule);
                         
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.