Package org.geotools.coverage.grid

Examples of org.geotools.coverage.grid.GridCoverage2D.dispose()


                ParameterValue<GeoToolsWriteParams> value = GeoTiffFormat.GEOTOOLS_WRITE_PARAMS.createValue();
                value.setValue(params);
               
                writer.write(coverage, new GeneralParameterValue[]{value});
                writer.dispose();
                coverage.dispose(true);
               
                // getting a reader
                reader = new GeoTiffReader(output);
                RenderedImage ri = reader.read(null).getRenderedImage();
                assertEquals(ri.getWidth(), i == 0 ? 120 : 12);
View Full Code Here


    // check that the envelope is correct
    final GeneralEnvelope expectedEnvelope = new GeneralEnvelope(croppedGR,PixelInCell.CELL_CENTER, croppedG2W, cropped.getCoordinateReferenceSystem2D());
    assertTrue("Expected envelope is different from the computed one",expectedEnvelope.equals(croppedEnvelope, XAffineTransform.getScale((AffineTransform) croppedG2W) / 2.0, false));

    //release things
    cropped.dispose(true);
    gc.dispose(true);
    try{
      if(reader!=null)
        reader.dispose();
    }catch (Throwable e) {
View Full Code Here

         
          final ParameterValue<Boolean> tfw = GeoTiffFormat.WRITE_TFW.createValue();
          tfw.setValue(true);
          writer.write(coverage,new GeneralParameterValue[]{tfw} );
          writer.dispose();
          coverage.dispose(true);
         
          final File finalTFW=new File(noCrsTFW.getParent(),noCrsTFW.getName().replace("tif", "tfw"));
          assertTrue(finalTFW.canRead());
          WorldFileReader worldFileReader = new WorldFileReader(finalTFW);
          assertEquals(656217.52088, worldFileReader.getXULC(), DELTA);
View Full Code Here

        writer.setMetadataValue(Integer.toString(BaselineTIFFTagSet.TAG_COPYRIGHT), copyrightInfo);
        writer.setMetadataValue(TagSet.BASELINE + ":" + Integer.toString(BaselineTIFFTagSet.TAG_SOFTWARE), software);
       
        writer.write(coverage,null);
        writer.dispose();
        coverage.dispose(true);
       
        // getting a reader
        reader = new GeoTiffReader(output);

        GeoTiffIIOMetadataDecoder metadata = reader.getMetadata();
View Full Code Here

                   
                }           
        });
        writer.write(coverage,new GeneralParameterValue[]{listener});
        writer.dispose();
        coverage.dispose(true);
       
    }
   
   
    @Test
View Full Code Here

       
       
       
        writer.write(coverage, new GeneralParameterValue[] { value });
        writer.dispose();
        coverage.dispose(true);

        // getting a reader
        reader = new GeoTiffReader(output,null);// this way I do not impose the lonlat ordering
        final GridCoverage2D gc= reader.read(null);
        final MathTransform g2w_ = gc.getGridGeometry().getGridToCRS();
View Full Code Here

          final CoordinateReferenceSystem crs_=new PrjFileReader(new FileInputStream(prj).getChannel()).getCoordinateReferenceSystem();
          assertTrue(CRS.equalsIgnoreMetadata(crs, crs_));
          GridCoverage2D coverage=reader.read(null);
          assertTrue(CRS.equalsIgnoreMetadata(coverage.getCoordinateReferenceSystem(), crs_));

          coverage.dispose(true);
      }
     
    /**
     * Testing proper CRS override with PRJ.
     *
 
View Full Code Here

            assertNotNull(coverage1);
            assertNotNull(coverage1.getCoordinateReferenceSystem());
            assertNotSame(coverage1.getCoordinateReferenceSystem(),crs_);
            reader.dispose();

            coverage1.dispose(true);
        }
    /**
     * Test for reading bad/strange geotiff files
     *
     * @throws IllegalArgumentException
View Full Code Here

                "EPSG:32632");
        reader.dispose();
       
        coverage1.dispose(true);
        coverage2.dispose(true);
        coverage3.dispose(true);
    }

    /**
     * Test for reading geotiff files
     *
 
View Full Code Here

            assertTrue("CRS comparison failed:" +o.toString(),CRS.findMathTransform(coverage.getCoordinateReferenceSystem(), destCoverage.getCoordinateReferenceSystem(), true).isIdentity());
            assertTrue("CRS comparison failed:" +o.toString(),CRS.equalsIgnoreMetadata(coverage.getCoordinateReferenceSystem(), destCoverage.getCoordinateReferenceSystem()));
            assertTrue("GridRange comparison failed:" +o.toString(),coverage.getGridGeometry().getGridRange().equals(destCoverage.getGridGeometry().getGridRange()));
            assertTrue("Envelope comparison failed:" +o.toString(),((GeneralEnvelope)coverage.getGridGeometry().getEnvelope()).equals(destCoverage.getGridGeometry().getEnvelope(),eps,false));
            coverage.dispose(true);
            destCoverage.dispose(true);
          }
   
        } else
          buffer.append("NOT ACCEPTED").append("\n");
        if (TestData.isInteractiveTest())
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.