Class GeoKeysLoader

java.lang.Object
org.apache.sis.storage.geotiff.GeoKeysLoader
Direct Known Subclasses:
GridGeometryBuilder, NativeMetadata

class GeoKeysLoader extends Object
Loads GeoTIFF keys in a hash map, but without performing any interpretation. A GeoKeysLoader receives as inputs the values of the following TIFF tags: For example, consider the following values for the above-cited tags:
GeoKeyDirectory(34735) values
1 1 2 6
1024 0 1 2
1026 34737 0 12
2048 0 1 32767
2049 34737 14 12
2050 0 1 6
2051 34736 1 0

The first number in the GeoKeyDirectory table indicates that this is a version 1 GeoTIFF GeoKey directory. This version will only change if the key structure is changed. The other numbers on the first line said that the file uses revision 1.2 of the set of keys and that there is 6 key values.

The next line indicates that the first key (1024 = ModelType) has the value 2 (Geographic), explicitly placed in the entry list since the TIFF tag location is 0. The next line indicates that the key 1026 (Citation) is listed in the GeoAsciiParams(34737) array, starting at offset 0 (the first in array), and running for 12 bytes and so has the value "Custom File". The "|" character is converted to a null delimiter at the end in C/C++ libraries.

Going further down the list, the key 2051 (GeogLinearUnitSize) is located in GeoDoubleParams(34736) at offset 0 and has the value 1.5; the value of key 2049 (GeogCitation) is "My Geographic".

Since:
1.2
Version:
1.2
  • Field Details

    • ENTRY_LENGTH

      private static final int ENTRY_LENGTH
      Number of short values in each GeoKey entry.
      See Also:
    • SEPARATOR

      static final char SEPARATOR
      The character used as a separator in String multi-values.
      See Also:
    • keyDirectory

      public Vector keyDirectory
      References the GeoKeys needed for building the Coordinate Reference System. Cannot be null when invoking load(Map).
      See Also:
    • numericParameters

      public Vector numericParameters
      The numeric values referenced by the keyDirectory. Can be null if none.
      See Also:
    • asciiParameters

      public String asciiParameters
      The characters referenced by the keyDirectory. Can be null if none.
      See Also:
    • majorRevision

      short majorRevision
      Version of the set of keys declared in the GeoKeyDirectory header.
    • minorRevision

      short minorRevision
      Version of the set of keys declared in the GeoKeyDirectory header.
    • logger

      CRSBuilder logger
      Where to send warnings, or null for ignoring warnings silently. While CRSBuilder is a class doing complex work (CRS construction), only the logging-related methods will be invoked by GeoKeysLoader.
  • Constructor Details

  • Method Details

    • setAsciiParameters

      final void setAsciiParameters(String[] values)
      Sets the value of asciiParameters from Tags.GeoAsciiParams value.
    • load

      final boolean load(Map<Short,Object> geoKeys)
      Loads GeoKeys and write values in the given map.
      Parameters:
      geoKeys - where to write GeoKeys.
      Returns:
      whether the operation succeed.
    • warning

      private void warning(short key, Object... args)
      Reports a warning with a message built from the given resource keys and arguments.
      Parameters:
      key - one of the Resources.Keys constants.
      args - arguments for the log message.
    • missingValue

      private void missingValue(short key)
      Reports a warning about missing value for the given key.