Package org.geotools.coverage.grid.io

Examples of org.geotools.coverage.grid.io.AbstractGridFormat


    public void testWriteLatLon() throws Exception {

        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


            String files[] = new String[]{"geo.tiff", "no_crs_no_envelope.tif"};
           
            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

        File file = TestData.file(this, "O3-NO2.nc");
        FileUtils.copyFileToDirectory(file, mosaic);
        file = new File(mosaic, "O3-NO2.nc");
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
        assertNotNull(format);
        try {
            String[] names = reader.getGridCoverageNames();
            names = new String[] { names[1] };
View Full Code Here

        FileUtils.copyFileToDirectory(file, mosaic);
        file = new File(mosaic, "O3-NO2.nc");
       
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
        assertNotNull(format);
        try {
            String[] names = reader.getGridCoverageNames();
            names = new String[] { names[1] };
View Full Code Here

        FileUtils.copyFileToDirectory(file, mosaic);
        file = new File(mosaic, "O3-NO2-noZ.nc");
       
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
        assertNotNull(format);
        try {
            String[] names = reader.getGridCoverageNames();
            for (String coverageName : names) {
View Full Code Here

       
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));     
        hints.put(Utils.AUXILIARY_FILES_PATH, new File(mosaic,"O3NO2-noZ.xml").getAbsolutePath()); // impose def

        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
        assertNotNull(format);
        try {
            String[] names = reader.getGridCoverageNames();
            for (String coverageName : names) {
View Full Code Here

       
      final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
      hints.add(new Hints(Utils.EXCLUDE_MOSAIC, true));

      // Get format
      final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
      final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
     
      assertNotNull(format);
      try {
          String[] names = reader.getGridCoverageNames();
          names = new String[] { names[1] };
View Full Code Here

        FileUtils.copyFileToDirectory(file, mosaic);
        file = new File(mosaic, "DUMMY.GOME2.NO2.PGL.nc");
       
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
        assertNotNull(format);
        try {
            String[] names = reader.getGridCoverageNames();
            names = new String[] { names[0] };
View Full Code Here

    public void IASI() throws Exception {
       
        final URL testURL = TestData.url(this, "IASI_C_EUMP_20121120062959_31590_eps_o_l2.nc");
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(testURL,hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(testURL, hints);
        assertNotNull(format);
        assertNotNull(reader);
        try {
            String[] names = reader.getGridCoverageNames();
            assertNotNull(names);
View Full Code Here

            boolean delete = true;
            if (checkForReferences) {
                delete = !checkForReferences(coverageName);
               
            }
            AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(rasterPath, excludeMosaicHints);
            if (format != null) {
                GridCoverage2DReader coverageReader = null;
                try {
                    coverageReader = (GridCoverage2DReader) format.getReader(rasterPath, hints);
                    if (coverageReader instanceof StructuredGridCoverage2DReader) {
                        StructuredGridCoverage2DReader reader = (StructuredGridCoverage2DReader) coverageReader;
                        if (delete) {
                            reader.delete(deleteData);
                        } else {
View Full Code Here

TOP

Related Classes of org.geotools.coverage.grid.io.AbstractGridFormat

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.