/** * Retrieves the {@link GeneralEnvelope} for this {@link AbstractGridCoverage2DReader}. * * @return the {@link GeneralEnvelope} for this {@link AbstractGridCoverage2DReader}. */ @Override public CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return crs; }
public GridEnvelope getOverviewGridEnvelope(String coverageName, int overviewIndex) throws IOException { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } // Default implementation for backwards compatibility return null; }
public DatasetLayout getDatasetLayout(String coverageName) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return dtLayout; }
public String getMetadataValue(final String coverageName, final String name) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return null; }
protected double[] getHighestRes(String coverageName) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return highestRes; }
/** * Return the ground control points for the specified, or null if there are none * * @return */ public GroundControlPoints getGroundControlPoints(String coverageName) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return null; }
public String[] getMetadataNames(final String coverageName) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return getMetadataNames(); }
@Override public ImageLayout getImageLayout(String coverageName) throws IOException { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return (ImageLayout) imageLayout.clone(); }
/** * Retrieves the {@link GeneralEnvelope} for this {@link AbstractGridCoverage2DReader}. * * @return the {@link GeneralEnvelope} for this {@link AbstractGridCoverage2DReader}. */ @Override public GeneralEnvelope getOriginalEnvelope(String coverageName) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return new GeneralEnvelope(originalEnvelope); }
@Override public double[][] getResolutionLevels(String coverageName) throws IOException { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } final double[][] returnValue = new double[numOverviews + 1][2]; double[] hres = getHighestRes(); if (hres == null) { return null; } else { System.arraycopy(hres, 0, returnValue[0], 0, 2); for (int i = 1; i < returnValue.length; i++) { System.arraycopy(overViewResolutions[i - 1], 0, returnValue[i], 0, 2); } return returnValue; } }
@Override public int getNumOverviews(String coverageName) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } if (dtLayout == null) { // Back to the default return numOverviews; } return dtLayout.getNumInternalOverviews() + (dtLayout.getNumExternalOverviews() > 0 ? dtLayout.getNumExternalOverviews() : 0); }
/** * Returns the actual resolution used to read the data given the specified target resolution and * the specified overview policy * * @param policy * @param resolutions * @return */ @Override public double[] getReadingResolutions( String coverageName, OverviewPolicy policy, double[] requestedResolution) throws IOException { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } // find the target resolution level double[] result; if (numOverviews > 0) { int imageIdx = pickOverviewLevel(coverageName, policy, requestedResolution); result = imageIdx > 0 ? overViewResolutions[imageIdx - 1] : highestRes; } else { result = getHighestRes(); } // return via cloning to protect internal state double[] clone = new double[result.length]; System.arraycopy(result, 0, clone, 0, result.length); return clone; }
if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported");
/** * Retrieves the {@link GeneralGridEnvelope} that represents the raster grid dimensions of the * highest resolution level in this dataset. * * @return the {@link GeneralGridEnvelope} that represents the raster grid dimensions of the * highest resolution level in this dataset. */ @Override public GridEnvelope getOriginalGridRange(String coverageName) { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } assert originalGridRange.getDimension() == 2; return new GridEnvelope2D( originalGridRange.getLow(0), originalGridRange.getLow(1), originalGridRange.getSpan(0), originalGridRange.getSpan(1)); }