Package org.geotools.imageio.netcdf

Examples of org.geotools.imageio.netcdf.NetCDFImageReaderSpi


     *
     * @throws IOException
     */
    @Test
    public void testReadCDL() throws IOException {
        NetCDFImageReaderSpi readerSpi = new NetCDFImageReaderSpi();
        File file = null;
        try {
            file = TestData.file(this, "2DLatLonCoverage.cdl");
        } catch (IOException e) {
            LOGGER.warning("Unable to find file 2DLatLonCoverage.cdl");
            return;
        }
        assertFalse(readerSpi.canDecodeInput(file));
    }
View Full Code Here


        // Creation of a NetCDFFormat object for checking if the GRIB format is accepted
        GRIBFormat format = new GRIBFormat();
        // Check if the format is accepted
        Assert.assertTrue(format.accepts(file));
        // Creation of a NetCDF reader SPI object for checking if it can decode the input file
        ImageReaderSpi spi = new NetCDFImageReaderSpi();
        // Check if the file can be decoded
        Assert.assertTrue(spi.canDecodeInput(file));

        // Check not a grib file
        final File fileTif = TestData.file(this, "sample.tif");
        Assert.assertFalse(format.accepts(fileTif));
    }
View Full Code Here

        List<String> possibleExt = Arrays.asList(new String[] { "grb", "grb2", "grib" });
        // Check if the extensions are contained
        Assert.assertTrue(extensions.containsAll(possibleExt));

        // Creation of a NetCDFReaderSPI objectfor checking if it supports the GRIB extension
        ImageReaderSpi spi = new NetCDFImageReaderSpi();
        // Selection of the suffixes, formatNames and mimetypes from the spi object
        List<String> suffixes = Arrays.asList(spi.getFileSuffixes());
        List<String> formatNames = Arrays.asList(spi.getFormatNames());
        List<String> MIMETypes = Arrays.asList(spi.getMIMETypes());
        // Creation of similar lists containing the values for the grib format
        List<String> gribSuffixes = Arrays.asList(new String[] { "grib", "grb", "grb2" });
        List<String> gribFormatNames = Arrays.asList(new String[] { "grib", "grib2", "GRIB",
                "GRIB2" });
        List<String> gribMIMETypes = Arrays.asList(new String[] { "application/octet-stream" });
View Full Code Here

        File file = TestData.file(this, "sampleGrib.grb2");
        // Check if the grib file is accepted by the NetCDF driver
        AbstractGridFormat format = new GRIBFormat();
        Assert.assertTrue(format.accepts(file));
        // Check if the netcdf reader spi object can read the input file
        ImageReaderSpi spi = new NetCDFImageReaderSpi();
        Assert.assertTrue(spi.canDecodeInput(file));
    }
View Full Code Here

TOP

Related Classes of org.geotools.imageio.netcdf.NetCDFImageReaderSpi

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.