Package org.geotools.coverageio.gdal

Examples of org.geotools.coverageio.gdal.BaseGDALGridFormat


        // get a reader
        final File file = TestData.file(this, fileName);
       
        final MrSIDFormatFactory factory = new MrSIDFormatFactory();
        final BaseGDALGridFormat format = (BaseGDALGridFormat) factory.createFormat();
       
        Assert.assertTrue(format.accepts(file));
        MrSIDReader reader = (MrSIDReader) format.getReader(file);
       
        final int numImages = reader.getGridCoverageCount();
        final boolean hasMoreGridCoverages = reader.hasMoreGridCoverages();
        Assert.assertEquals(1, numImages);
        Assert.assertEquals(false, hasMoreGridCoverages);
       
        final ServiceInfo serviceInfo = reader.getInfo();
        reader.getInfo("coverage");
        reader.dispose();

        boolean writersAvailable = true;
        boolean hasWriteParams = true;
        try{
            format.getWriter(new File("test"));
        }catch (UnsupportedOperationException uoe){
            writersAvailable = false;
        }
        Assert.assertFalse(writersAvailable);

        try{
            format.getDefaultImageIOWriteParameters();
        }catch (UnsupportedOperationException uoe){
            hasWriteParams = false;
        }
        Assert.assertFalse(hasWriteParams);

        // Testing sections of code involving URLs
        final URL url = new URL("file://"+file.getAbsolutePath());
        reader = (MrSIDReader) format.getReader(url);
        reader.getInfo();
        reader.dispose();
       
        FileImageInputStreamExtImpl fiis = new FileImageInputStreamExtImpl(file);
        reader = new MrSIDReader(fiis);
View Full Code Here

TOP

Related Classes of org.geotools.coverageio.gdal.BaseGDALGridFormat

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.