Class NativeMetadata

java.lang.Object
org.apache.sis.storage.geotiff.GeoKeysLoader
org.apache.sis.storage.geotiff.NativeMetadata

final class NativeMetadata extends GeoKeysLoader
View over GeoTIFF tags and GeoTIFF keys in their "raw" form (without interpretation). Used only when showing native metadata.

This implementation is inefficient because it performs a lot of "seek" operations. This class does not make any effort for reading data in a more sequential way. The performance penalty should not matter because this class should not be used except for debugging purposes (the normal use is to interpret tags as they are read).

This class is thread-safe if the user does not try to write in the tree.

Since:
1.2
Version:
1.2
  • Field Details

    • CODE

      private static final TableColumn<Integer> CODE
      Column for the tag number or GeoKey number.
    • NAME

      static final TableColumn<CharSequence> NAME
      Column for the name associated to the tag. Value may be null if the name is unknown.
    • VALUE

      static final TableColumn<Object> VALUE
      Column for the value associated to the tag.
    • input

      private ChannelDataInput input
      The stream from which to read the data.
    • isClassic

      private boolean isClassic
      true if reading classic TIFF file, or false for BigTIFF.
    • geoNode

      private TreeTable.Node geoNode
      The node for GeoKeys, or null if none.
      See Also:
    • vocabulary

      private final Vocabulary vocabulary
      Resources for vocabulary.
  • Constructor Details

    • NativeMetadata

      NativeMetadata(Locale locale)
      Creates a reader for a tree table of native metadata.
  • Method Details

    • read

      final DefaultTreeTable read(Reader reader) throws IOException
      Reads the tree table content. This method assumes that the caller already verified that the file is a GeoTIFF file. Tags are keys are added in the order they are declared in the file.
      Throws:
      IOException
    • readInt

      private long readInt(boolean isShort) throws IOException
      Reads the short, int or long value (depending if the file is standard of big TIFF) at the current Reader.input position.
      Throws:
      IOException
    • toString

      private static Object toString(Object value, IntFunction<Enum<?>> valueOf, Enum<?> unknown)
      Replaces an integer code by its enumeration value if that value is different than unknown.
    • writeGeoKeys

      private void writeGeoKeys()
      Write child values in geoNode if non-null.