Package org.geotools.coverage.grid.io

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


  private static GridFormatFactorySpi getFactoryForObject(URL id, File file) {
    for(GridFormatFactorySpi spi: GDALFormatProvider.factories.values())
    { 
      //we know that the factory is avaiable
      final AbstractGridFormat format = (AbstractGridFormat) spi.createFormat();
      if (file!=null&&format.accepts(file))
        return spi;
      if(id!=null&&format.accepts(id))
        return spi;
    }
    return null;
View Full Code Here


   
      //we know that the factory is avaiable
      final AbstractGridFormat format = (AbstractGridFormat) spi.createFormat();
      if (file!=null&&format.accepts(file))
        return spi;
      if(id!=null&&format.accepts(id))
        return spi;
    }
    return null;
  }
 
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

        //
        // 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

        //
        // 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

        String file = "latlon.tiff";
       
        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

           
            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

          //
          // PRJ override
          //
          final File noCrs = TestData.file(GeoTiffReaderTest.class, "override/sample.tif");
          final AbstractGridFormat format = new GeoTiffFormat();
          assertTrue(format.accepts(noCrs));
          GeoTiffReader reader = (GeoTiffReader) format.getReader(noCrs);
          CoordinateReferenceSystem crs=reader.getCoordinateReferenceSystem();
         
          final File prj= TestData.file(GeoTiffReaderTest.class, "override/sample.prj");
          final CoordinateReferenceSystem crs_=new PrjFileReader(new FileInputStream(prj).getChannel()).getCoordinateReferenceSystem();
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.getCoordinateReferenceSystem();
        assertTrue(CRS.equalsIgnoreMetadata(crs, DefaultEngineeringCRS.GENERIC_2D));
        GridCoverage2D coverage=reader.read(null);
        assertTrue(CRS.equalsIgnoreMetadata(coverage.getCoordinateReferenceSystem(), DefaultEngineeringCRS.GENERIC_2D));
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.