@Test @Ignore public void testDefaultParameterValueURLtoJAR() throws IOException, MismatchedDimensionException, NoSuchAuthorityCodeException { final URL testJarFile = TestData.getResource(this, TEST_JAR_FILE); assertNotNull(testJarFile); final String spec = "jar:"+testJarFile.toExternalForm()+"!/"+TEST_FILE; final URL testFile = new URL(spec); assertNotNull(testFile); final AbstractGridFormat format = new ImagePyramidFormat(); assertTrue(format.accepts(testFile)); final ImagePyramidReader reader = (ImagePyramidReader) format .getReader(testFile); assertNotNull(reader); final GridCoverage2D coverage = (GridCoverage2D) reader.read(null); assertNotNull("Null value returned instead of a coverage", coverage); assertTrue("coverage dimensions different from what we expected", coverage.getGridGeometry().getGridRange().getSpan(0) == 250 && coverage.getGridGeometry().getGridRange().getSpan( 1) == 250); if (TestData.isInteractiveTest()) coverage.show("testDefaultParameterValue"); else ((GridCoverage2D) coverage).getRenderedImage().getData(); }
@SuppressWarnings("unchecked") public GridCoverage2D read(GeneralParameterValue[] params) throws IOException { GeneralEnvelope requestedEnvelope = null; Rectangle dim = null; OverviewPolicy overviewPolicy=null; if (params != null) { if (params != null) { for (int i = 0; i < params.length; i++) { final ParameterValue param = (ParameterValue) params[i]; if (param == null){ continue; } final String name = param.getDescriptor().getName().getCode(); if (name.equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString())) { final GridGeometry2D gg = (GridGeometry2D) param.getValue(); requestedEnvelope = new GeneralEnvelope((Envelope)gg.getEnvelope2D()); dim = gg.getGridRange2D().getBounds(); continue; } if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName().toString())) { overviewPolicy = (OverviewPolicy) param.getValue(); continue; } } } } return loadTiles(requestedEnvelope, dim, params, overviewPolicy); }
ImagePyramidReader extends AbstractGridCoverage2DReader implements GridCoverageReader { @SuppressWarnings("unchecked") public GridCoverage2D read(GeneralParameterValue[] params) throws IOException { GeneralEnvelope requestedEnvelope = null; Rectangle dim = null; OverviewPolicy overviewPolicy=null; if (params != null) { if (params != null) { for (int i = 0; i < params.length; i++) { final ParameterValue param = (ParameterValue) params[i]; if (param == null){ continue; } final String name = param.getDescriptor().getName().getCode(); if (name.equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString())) { final GridGeometry2D gg = (GridGeometry2D) param.getValue(); requestedEnvelope = new GeneralEnvelope((Envelope)gg.getEnvelope2D()); dim = gg.getGridRange2D().getBounds(); continue; } if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName().toString())) { overviewPolicy = (OverviewPolicy) param.getValue(); continue; } } } } return loadTiles(requestedEnvelope, dim, params, overviewPolicy); } }
ImagePyramidReader extends AbstractGridCoverage2DReader implements GridCoverageReader { @SuppressWarnings("unchecked") public GridCoverage2D read(GeneralParameterValue[] params) throws IOException { GeneralEnvelope requestedEnvelope = null; Rectangle dim = null; OverviewPolicy overviewPolicy=null; if (params != null) { if (params != null) { for (int i = 0; i < params.length; i++) { final ParameterValue param = (ParameterValue) params[i]; if (param == null){ continue; } final String name = param.getDescriptor().getName().getCode(); if (name.equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString())) { final GridGeometry2D gg = (GridGeometry2D) param.getValue(); requestedEnvelope = new GeneralEnvelope((Envelope)gg.getEnvelope2D()); dim = gg.getGridRange2D().getBounds(); continue; } if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName().toString())) { overviewPolicy = (OverviewPolicy) param.getValue(); continue; } } } } return loadTiles(requestedEnvelope, dim, params, overviewPolicy); } ImagePyramidReader(Object source, Hints uHints);  ImagePyramidReader(Object source); }
ImagePyramidReader extends AbstractGridCoverage2DReader implements GridCoverageReader { @SuppressWarnings("unchecked") public GridCoverage2D read(GeneralParameterValue[] params) throws IOException { GeneralEnvelope requestedEnvelope = null; Rectangle dim = null; OverviewPolicy overviewPolicy=null; if (params != null) { if (params != null) { for (int i = 0; i < params.length; i++) { final ParameterValue param = (ParameterValue) params[i]; if (param == null){ continue; } final String name = param.getDescriptor().getName().getCode(); if (name.equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString())) { final GridGeometry2D gg = (GridGeometry2D) param.getValue(); requestedEnvelope = new GeneralEnvelope((Envelope)gg.getEnvelope2D()); dim = gg.getGridRange2D().getBounds(); continue; } if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName().toString())) { overviewPolicy = (OverviewPolicy) param.getValue(); continue; } } } } return loadTiles(requestedEnvelope, dim, params, overviewPolicy); } ImagePyramidReader(Object source, Hints uHints);  ImagePyramidReader(Object source); Format getFormat(); @SuppressWarnings("unchecked") GridCoverage2D read(GeneralParameterValue[] params); @Override synchronized void dispose(); @Override int getGridCoverageCount(); }
ImagePyramidReader extends AbstractGridCoverage2DReader implements GridCoverageReader { @SuppressWarnings("unchecked") public GridCoverage2D read(GeneralParameterValue[] params) throws IOException { GeneralEnvelope requestedEnvelope = null; Rectangle dim = null; OverviewPolicy overviewPolicy=null; if (params != null) { if (params != null) { for (int i = 0; i < params.length; i++) { final ParameterValue param = (ParameterValue) params[i]; if (param == null){ continue; } final String name = param.getDescriptor().getName().getCode(); if (name.equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString())) { final GridGeometry2D gg = (GridGeometry2D) param.getValue(); requestedEnvelope = new GeneralEnvelope((Envelope)gg.getEnvelope2D()); dim = gg.getGridRange2D().getBounds(); continue; } if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName().toString())) { overviewPolicy = (OverviewPolicy) param.getValue(); continue; } } } } return loadTiles(requestedEnvelope, dim, params, overviewPolicy); } ImagePyramidReader(Object source, Hints uHints);  ImagePyramidReader(Object source); Format getFormat(); @SuppressWarnings("unchecked") GridCoverage2D read(GeneralParameterValue[] params); @Override synchronized void dispose(); @Override int getGridCoverageCount();  }