Package org.geotools.gce.imagemosaic.properties

Examples of org.geotools.gce.imagemosaic.properties.PropertiesCollectorSPI.create()


            } else {
                config = collector.getValue();
            }

            // create the PropertiesCollector
            final PropertiesCollector pc = selectedSPI.create(config,
                    Arrays.asList(collector.getMapped()));
            if (pc != null) {
                pcs.add(pc);
            } else {
                if (LOGGER.isLoggable(Level.INFO)) {
View Full Code Here


                PropertiesCollectorSPI spi;
                final Iterator<PropertiesCollectorSPI> iterator = spis.iterator();
                while (iterator.hasNext()){
                    spi = iterator.next();
                    if (spi instanceof StringFileNameExtractorSPI){
                        final PropertiesCollector pc = spi.create(testUrl, Arrays.asList("string_attr"));
                        pc.collect(TestData.file(this,"time_geotiff/world.200402.3x5400x2700.tiff"));
                        return;
                    }
                }
               
View Full Code Here

    PropertiesCollectorSPI spi;
    final Iterator<PropertiesCollectorSPI> iterator = spis.iterator();
    while (iterator.hasNext()){
        spi = iterator.next();
        if (spi instanceof TimestampFileNameExtractorSPI){
            final PropertiesCollector pc = spi.create(testUrl, Arrays.asList("time_attr"));
                  pc.collect(TestData.file(this,"time_geotiff/world.200403.3x5400x2700.tiff"));
                  return;
        }
    }
    assertTrue(false);
View Full Code Here

    }

    @Test
    public void testParseIsoTimestamp() {
        PropertiesCollectorSPI spi = getTimestampSpi();
        PropertiesCollector collector = spi.create("regex=[0-9]{8}T[0-9]{6}", Arrays.asList("time"));
        File file = new File("polyphemus_20130301T000000.nc");
        collector.collect(file);
        collector.setProperties(feature);
        Date time = (Date) feature.getAttribute("time");
        assertNotNull(time);
View Full Code Here

    }

    @Test
    public void testUnableToParse() {
        PropertiesCollectorSPI spi = getTimestampSpi();
        PropertiesCollector collector = spi.create("regex=[0-9]{8}T[0-9]{6}", Arrays.asList("time"));

        // Note that the number of 0 after the T char isn't enough
        // will throw an illegalArgumentException while parsing
        File file = new File("polyphemus_20130301T00000.nc");
View Full Code Here

    }

    @Test
    public void testParseCustomTimestamp() {
        PropertiesCollectorSPI spi = getTimestampSpi();
        PropertiesCollector collector = spi.create("regex=[0-9]{14},format=yyyyMMddHHmmss", Arrays.asList("time"));
        File file = new File("polyphemus_20130301000000.nc");
        collector.collect(file);
        collector.setProperties(feature);
        Date time = (Date) feature.getAttribute("time");
        assertNotNull(time);
View Full Code Here

    @Test
    public void testParseFullPathTimestamp() {
        PropertiesCollectorSPI spi = getTimestampSpi();
        String regex = "(?:\\\\)(\\d{8})(?:\\\\)(?:file.)(T\\d{6})(?:.txt)";
        PropertiesCollector collector = spi.create("regex=" + regex + ",fullPath=true", Arrays.asList("time"));
        File file = new File("c:\\data\\20120602\\file.T120000.txt");
        collector.collect(file);
        collector.setProperties(feature);
        Date time = (Date) feature.getAttribute("time");
        assertNotNull(time);
View Full Code Here

    @Test
    public void testParseFullPathTimestampWithCustomFormat() {
        PropertiesCollectorSPI spi = getTimestampSpi();
        String regex = "(?:\\\\)(\\d{8})(?:\\\\)(?:file.)(t\\d{2}z)(?:.txt)";
        PropertiesCollector collector = spi.create("regex=" + regex + ",format=yyyyMMdd't'HH'z',fullPath=true", Arrays.asList("time"));
        File file = new File("c:\\data\\20120602\\file.t12z.txt");
        collector.collect(file);
        collector.setProperties(feature);
        Date time = (Date) feature.getAttribute("time");
        assertNotNull(time);
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.