Class GeoKeysLoader
- Direct Known Subclasses:
GridGeometryBuilder,NativeMetadata
GeoKeysLoader receives as inputs the values of the following TIFF tags:
Tags.GeoKeyDirectory— array of unsignedshortvalues grouped into blocks of 4.Tags.GeoDoubleParams— array of values referenced byGeoKeyDirectoryelements.Tags.GeoAsciiParams— array of characters referenced byGeoKeyDirectoryelements.
| 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 Summary
FieldsModifier and TypeFieldDescriptionThe characters referenced by thekeyDirectory.private static final intNumber ofshortvalues in each GeoKey entry.References theGeoKeysneeded for building the Coordinate Reference System.(package private) CRSBuilderWhere to send warnings, ornullfor ignoring warnings silently.(package private) shortVersion of the set of keys declared in theGeoKeyDirectoryheader.(package private) shortVersion of the set of keys declared in theGeoKeyDirectoryheader.The numeric values referenced by thekeyDirectory.(package private) static final charThe character used as a separator inStringmulti-values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final booleanLoads GeoKeys and write values in the given map.private voidmissingValue(short key) Reports a warning about missing value for the given key.(package private) final voidsetAsciiParameters(String[] values) Sets the value ofasciiParametersfromTags.GeoAsciiParamsvalue.private voidReports a warning with a message built from the given resource keys and arguments.
-
Field Details
-
ENTRY_LENGTH
private static final int ENTRY_LENGTHNumber ofshortvalues in each GeoKey entry.- See Also:
-
SEPARATOR
static final char SEPARATORThe character used as a separator inStringmulti-values.- See Also:
-
keyDirectory
References theGeoKeysneeded for building the Coordinate Reference System. Cannot be null when invokingload(Map).- See Also:
-
numericParameters
The numeric values referenced by thekeyDirectory. Can benullif none.- See Also:
-
asciiParameters
The characters referenced by thekeyDirectory. Can benullif none. -
majorRevision
short majorRevisionVersion of the set of keys declared in theGeoKeyDirectoryheader. -
minorRevision
short minorRevisionVersion of the set of keys declared in theGeoKeyDirectoryheader. -
logger
CRSBuilder loggerWhere to send warnings, ornullfor ignoring warnings silently. WhileCRSBuilderis a class doing complex work (CRS construction), only the logging-related methods will be invoked byGeoKeysLoader.
-
-
Constructor Details
-
GeoKeysLoader
GeoKeysLoader()Creates a new GeoTIFF keys loader. ThekeyDirectory,numericParametersasciiParametersandloggerfields must be initialized by the caller.
-
-
Method Details
-
setAsciiParameters
Sets the value ofasciiParametersfromTags.GeoAsciiParamsvalue. -
load
Loads GeoKeys and write values in the given map.- Parameters:
geoKeys- where to write GeoKeys.- Returns:
- whether the operation succeed.
-
warning
Reports a warning with a message built from the given resource keys and arguments.- Parameters:
key- one of theResources.Keysconstants.args- arguments for the log message.
-
missingValue
private void missingValue(short key) Reports a warning about missing value for the given key.
-