Package org.geotools.coverage.grid

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


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

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


       
        GridCoverage2D coverage = reader.read(new GeneralParameterValue[]{useJai, dp, op, color, bv, ts});

        assertNotNull(coverage);
        reader.dispose();
        coverage.dispose(true);
    }
   
    /**
     * Test for reading geotiff files
     *
 
View Full Code Here

      reader=(AbstractGridCoverage2DReader) ((AbstractGridFormat) GridFormatFinder.findFormat(rgbURL)).getReader(rgbURL,new Hints(Hints.MAX_ALLOWED_TILES,Integer.valueOf(1000)));
      Assert.assertNotNull(reader);
      //read the coverage
      GridCoverage2D gc = (GridCoverage2D) reader.read(null);
      Assert.assertTrue(true);
      gc.dispose(true);
      reader.dispose();
    } catch (Exception e) {
      Assert.fail(e.getLocalizedMessage());
    }
  }
View Full Code Here

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

                reader.dispose();
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());

    }
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);

        // TODO FIX ME
View Full Code Here

            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

      final GridCoverageWriter writer = format.getWriter(newDir);
      writer.write(gc, (GeneralParameterValue[]) params.values().toArray(
          new GeneralParameterValue[1]));
   
      gc.dispose(false);
    }
  }

  public static final void main(String[] args) throws Exception {
    junit.textui.TestRunner.run((GT30ZipWriterTest.class));
View Full Code Here

                        novalueRangeList);
                return (ZonalStats) zsOp.getProperty(ZonalStatsDescriptor.ZONAL_STATS_PROPERTY);
            } finally {
                // dispose coverages
                if (cropped != null) {
                    cropped.dispose(true);
                }
            }

        }
    }
View Full Code Here

            assertEquals(1, files.length);
           
        } finally {
            if(coverage != null) {
                ImageUtilities.disposePlanarImageChain((PlanarImage) coverage.getRenderedImage());
                coverage.dispose(true);
            }
            reader.dispose();
        }
    }
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.