/** * Checks if the provided Dataset was opened by a Driver supporting the same * formats which are supported by the specific ImageReaderSpi. * * There is a trivial example: Suppose we are implementing a plugin for HDF4 * format and suppose we are testing the <code>canDecodeInput</code> with * a NITF file as input. GDAL will successfully open the NITF file. However, * it will use the NITF driver instead of the HDF4 driver. Since NITF is not * supported by the HDF4ImageReaderSpi, this method will return return * <code>false</code>. * * @param dataset * The input dataset * * @return <code>true</code> if the format is supported. * <code>false</code> otherwise. */ protected boolean isDecodable(Dataset dataset) { if (dataset != null) { final Driver driver = dataset.GetDriver(); // retrieving the format of the provided input. // We use the "Description" of the driver which has opened the // input. final String sDriver = driver.getShortName(); // checking if this format is supported by the specific SPI */ return getSupportedFormats().contains(sDriver); } return false; }
/** * Checks if the provided Dataset was opened by a Driver supporting the same * formats which are supported by the specific ImageReaderSpi. * * There is a trivial example: Suppose we are implementing a plugin for HDF4 * format and suppose we are testing the <code>canDecodeInput</code> with * a NITF file as input. GDAL will successfully open the NITF file. However, * it will use the NITF driver instead of the HDF4 driver. Since NITF is not * supported by the HDF4ImageReaderSpi, this method will return return * <code>false</code>. * * @param dataset * The input dataset * * @return <code>true</code> if the format is supported. * <code>false</code> otherwise. */ protected boolean isDecodable(Dataset dataset) { if (dataset != null) { final Driver driver = dataset.GetDriver(); // retrieving the format of the provided input. // We use the "Description" of the driver which has opened the // input. final String sDriver = driver.getShortName(); // checking if this format is supported by the specific SPI */ return getSupportedFormats().contains(sDriver); } return false; }
Driver driver = null; try { driver = dataset.GetDriver(); if (driver != null) { setDriverDescription(driver.GetDescription());
Driver driver = null; try { driver = dataset.GetDriver(); if (driver != null) { setDriverDescription(driver.GetDescription());
private static MetadataElement buildMetadataElement(Dataset gdalProduct) { Driver hDriver = gdalProduct.GetDriver(); int imageWidth = gdalProduct.getRasterXSize(); int imageHeight = gdalProduct.getRasterYSize();