Package org.geotools.coverage.grid.io

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


      FileUtils.copyFile(TestData.file(this, "watertemp.zip"), new File(workDir,"watertemp.zip"));
      TestData.unzipFile(this, "watertemp2/watertemp.zip");
     
      final URL timeElevURL = TestData.url(this, "watertemp2");
     
    final AbstractGridFormat format = TestUtils.getFormat(timeElevURL);
    assertNotNull(format);
    ImageMosaicReader reader = TestUtils.getReader(timeElevURL, format);
    assertNotNull(format);
   
    final String[] metadataNames = reader.getMetadataNames();
View Full Code Here


                  IOUtils.closeQuietly(out);
                }
              }
             
             
                final AbstractGridFormat format = TestUtils.getFormat(timeElevURL);
                assertNotNull(format);
                ImageMosaicReader reader = TestUtils.getReader(timeElevURL, format);
                assertNotNull(format);
               
                final String[] metadataNames = reader.getMetadataNames();
View Full Code Here

        }
 
  @Test
//    @Ignore 
  public void imposedBBox() throws Exception {
    final AbstractGridFormat format = TestUtils.getFormat(imposedEnvelopeURL);
    final ImageMosaicReader reader = TestUtils.getReader(imposedEnvelopeURL, format);
 
   
    //check envelope
    final GeneralEnvelope envelope = reader.getOriginalEnvelope();
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

  @Test
//  @Ignore
  public void time() throws Exception {
        
    final AbstractGridFormat format = TestUtils.getFormat(timeURL);
    ImageMosaicReader reader = TestUtils.getReader(timeURL, format);
     
    final String[] metadataNames = reader.getMetadataNames();
    assertNotNull(metadataNames);
    assertEquals(metadataNames.length, 12);
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

 
 
 
    @Test
    public void testTimeFormat() throws Exception {
        final AbstractGridFormat format = TestUtils.getFormat(timeFormatURL);
        ImageMosaicReader reader = TestUtils.getReader(timeFormatURL, format);
       
        final String[] metadataNames = reader.getMetadataNames();
        assertNotNull(metadataNames);
        assertEquals(metadataNames.length, 12);
View Full Code Here

    @Test
     //@Ignore
    @SuppressWarnings("rawtypes")
    public void timeAdditionalDim() throws Exception {
   
        final AbstractGridFormat format = TestUtils
                .getFormat(timeAdditionalDomainsURL);
        ImageMosaicReader reader = TestUtils.getReader(timeAdditionalDomainsURL,
                format);
   
        final String[] metadataNames = reader.getMetadataNames();
View Full Code Here

   */
  public void test() throws Exception {

    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
       *
       */
      // get a reader
      GridCoverage2DReader reader = format.getReader(statURL);
     
                        // layout checks
                        final ImageLayout layout = reader.getImageLayout();
                        assertNotNull(layout);
                        assertNotNull(layout.getColorModel(null));
                        assertNotNull(layout.getSampleModel(null));
                        assertEquals(0,layout.getMinX(null));
                        assertEquals(0,layout.getMinY(null));
                        assertTrue(layout.getWidth(null) > 0);
                        assertTrue(layout.getHeight(null) > 0);
                        assertEquals(0,layout.getTileGridXOffset(null));
                        assertEquals(0,layout.getTileGridYOffset(null));
                        assertTrue(layout.getTileHeight(null) > 0);
                        assertTrue(layout.getTileWidth(null) > 0);

      // get a grid coverage
      gc = ((GridCoverage2D) reader.read(null));
      assertTrue(CoverageUtilities.hasRenderingCategories(gc));
      if(TestData.isInteractiveTest())
        gc.show();

      // preparing to write it down
      File testDir = TestData.file(this, "");
      newDir = new File(testDir.getAbsolutePath() + "/newDir");
      newDir.mkdir();

      // writing it down
      GridCoverageWriter writer = format.getWriter(newDir);
      writer.write(gc, null);

      /**
       *
       * STEP 2 Reading back into memory the previos coverage.
       *
       */
      // preparing the URL
      statURL = TestData.getResource(this, "newDir/" + this.fileName
          + ".DEM");

      // read it again
      reader = format.getReader(statURL);
      gc = ((GridCoverage2D) reader.read(null));

      /**
       *
       * STEP 3 Visualizing the lcoverage we just read in order to see if
View Full Code Here

   */
  public void test() throws Exception {

    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
       *
       */
      // get a reader
      AbstractGridCoverage2DReader reader = (AbstractGridCoverage2DReader) format
          .getReader(statURL);

      // get a grid coverage
      final ParameterValueGroup params = reader.getFormat().getReadParameters();
      params.parameter(
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.