Package org.geotools.coverage.grid.io

Examples of org.geotools.coverage.grid.io.AbstractGridFormat.accepts()


        //
        // no crs geotiff
        //
        final File input = TestData.file(GeoTiffReaderTest.class, "geo.tiff");
        final AbstractGridFormat format = new GeoTiffFormat();
        assertTrue(format.accepts(input));

        // getting a reader
        GeoTiffReader reader = new GeoTiffReader(input);

        // reading the coverage
View Full Code Here


       
        int i=0;
        for (String file : files){
            final File input = TestData.file(GeoTiffReaderTest.class, file);
            final AbstractGridFormat format = new GeoTiffFormat();
            assertTrue(format.accepts(input));
   
            // getting a reader
            GeoTiffReader reader = new GeoTiffReader(input);
   
            // reading the coverage
View Full Code Here

        //
        // no crs geotiff
        //
        final File noCrs = TestData.file(GeoTiffReaderTest.class, "no_crs.tif");
        final AbstractGridFormat format = new GeoTiffFormat();
        assertTrue(format.accepts(noCrs));
        GeoTiffReader reader = (GeoTiffReader) format.getReader(noCrs);
        CoordinateReferenceSystem crs=reader.getCrs();
        assertTrue(CRS.equalsIgnoreMetadata(crs, DefaultEngineeringCRS.GENERIC_2D));
        GridCoverage2D coverage=reader.read(null);
        assertTrue(CRS.equalsIgnoreMetadata(coverage.getCoordinateReferenceSystem(), DefaultEngineeringCRS.GENERIC_2D));
View Full Code Here

        //
        // use prj and wld
        //
        final File wldprjFile = TestData.file(GeoTiffReaderTest.class, "no_crs_no_envelope.tif");
        assertTrue(format.accepts(wldprjFile));

        // getting a reader
        reader = new GeoTiffReader(wldprjFile);

        // reading the coverage
View Full Code Here

        //
        // use prj and hint
        //
        final File wldFile = TestData.file(GeoTiffReaderTest.class, "no_crs_no_envelope2.tif");
        assertTrue(format.accepts(wldFile));

        // getting a reader
        reader = new GeoTiffReader(wldFile, hint);

        // reading the coverage
View Full Code Here

        //
        // no crs geotiff
        //
        final File sampleFile = TestData.file(GeoTiffReaderTest.class, "geo.tiff");
        final AbstractGridFormat format = new GeoTiffFormat();
        assertTrue(format.accepts(sampleFile));
        GeoTiffReader reader = (GeoTiffReader) format.getReader(sampleFile);
        ParameterValue<Boolean> useJai = AbstractGridFormat.USE_JAI_IMAGEREAD.createValue();
        useJai.setValue(false);
       
        ParameterValue<OverviewPolicy> op = AbstractGridFormat.OVERVIEW_POLICY.createValue();
View Full Code Here

                // testing file
                o = files[i];
            else
                // testing url
                o = files[i].toURI().toURL();
            if (format.accepts(o)) {
                buffer.append("ACCEPTED").append("\n");

                // getting a reader
                GeoTiffReader reader = new GeoTiffReader(o, new Hints(
                        Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE));
View Full Code Here

        //
        // world geotiff
        //
        final File testFile = TestData.file(GeoTiffReaderTest.class, "latlon.tiff");
        final AbstractGridFormat format = new GeoTiffFormat();
        assertTrue(format.accepts(testFile));
       
        // getting a reader
        GeoTiffReader reader = new GeoTiffReader(testFile);

        // reading the coverage
View Full Code Here

        //
        // no crs geotiff
        //
        final File noCrs = TestData.file(GeoTiffReaderTest.class, "no_crs.tif");
        final AbstractGridFormat format = new GeoTiffFormat();
        assertTrue(format.accepts(noCrs));

        // hint for CRS
        final CoordinateReferenceSystem crs = CRS.decode("EPSG:32632", true);
        final Hints hint = new Hints();
        hint.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, crs);
View Full Code Here

    URL statURL = TestData.url(this, (new StringBuffer(this.fileName)
        .append(".DEM").toString()));
    AbstractGridFormat format = (AbstractGridFormat) new GTopo30FormatFactory()
        .createFormat();

    if (format.accepts(statURL)) {

      /**
       *
       * STEP 1 Reading the coverage into memory in order to write it down
       * again
 
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.