Class GeoKeysLoader
- Direct Known Subclasses:
GridGeometryBuilder
,NativeMetadata
GeoKeysLoader
receives as inputs the values of the following TIFF tags:
Tags.GeoKeyDirectory
— array of unsignedshort
values grouped into blocks of 4.Tags.GeoDoubleParams
— array of values referenced byGeoKeyDirectory
elements.Tags.GeoAsciiParams
— array of characters referenced byGeoKeyDirectory
elements.
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 int
Number ofshort
values in each GeoKey entry.References theGeoKeys
needed for building the Coordinate Reference System.(package private) CRSBuilder
Where to send warnings, ornull
for ignoring warnings silently.(package private) short
Version of the set of keys declared in theGeoKeyDirectory
header.(package private) short
Version of the set of keys declared in theGeoKeyDirectory
header.The numeric values referenced by thekeyDirectory
.(package private) static final char
The character used as a separator inString
multi-values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final boolean
Loads GeoKeys and write values in the given map.private void
missingValue
(short key) Reports a warning about missing value for the given key.(package private) final void
setAsciiParameters
(String[] values) Sets the value ofasciiParameters
fromTags.GeoAsciiParams
value.private void
Reports a warning with a message built from the given resource keys and arguments.
-
Field Details
-
ENTRY_LENGTH
private static final int ENTRY_LENGTHNumber ofshort
values in each GeoKey entry.- See Also:
-
SEPARATOR
static final char SEPARATORThe character used as a separator inString
multi-values.- See Also:
-
keyDirectory
References theGeoKeys
needed for building the Coordinate Reference System. Cannot be null when invokingload(Map)
.- See Also:
-
numericParameters
The numeric values referenced by thekeyDirectory
. Can benull
if none.- See Also:
-
asciiParameters
The characters referenced by thekeyDirectory
. Can benull
if none.- See Also:
-
majorRevision
short majorRevisionVersion of the set of keys declared in theGeoKeyDirectory
header. -
minorRevision
short minorRevisionVersion of the set of keys declared in theGeoKeyDirectory
header. -
logger
CRSBuilder loggerWhere to send warnings, ornull
for ignoring warnings silently. WhileCRSBuilder
is 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
,numericParameters
asciiParameters
andlogger
fields must be initialized by the caller.
-
-
Method Details
-
setAsciiParameters
Sets the value ofasciiParameters
fromTags.GeoAsciiParams
value. -
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.Keys
constants.args
- arguments for the log message.
-
missingValue
private void missingValue(short key) Reports a warning about missing value for the given key.
-