public static void validateImageType ( FileDirectory directory ) { if ( directory == null ) { throw new GeoPackageException ( "The image is null" ) ; } int samplesPerPixel = directory . getSamplesPerPixel ( ) ; Integer bitsPerSample = null ; if ( directory . getBitsPerSample ( ) != null && ! directory . getBitsPerSample ( ) . isEmpty ( ) ) { bitsPerSample = directory . getBitsPerSample ( ) . get ( 0 ) ; } Integer sampleFormat = null ; if ( directory . getSampleFormat ( ) != null && ! directory . getSampleFormat ( ) . isEmpty ( ) ) { sampleFormat = directory . getSampleFormat ( ) . get ( 0 ) ; } if ( samplesPerPixel != SAMPLES_PER_PIXEL || bitsPerSample == null || bitsPerSample != BITS_PER_SAMPLE || sampleFormat == null || sampleFormat != TiffConstants . SAMPLE_FORMAT_FLOAT ) { throw new GeoPackageException ( "The coverage data tile is expected to be a single sample 32 bit float. Samples Per Pixel: " + samplesPerPixel + ", Bits Per Sample: " + bitsPerSample + ", Sample Format: " + sampleFormat ) ; } }
Validate that the image type