I've loaded a GeoTiff successfully in with geotools (21-SNAPSHOT), but I'm having trouble accessing the referenced UTM zone.
The code to read in the file is here:
File tiffFile = new File(filePath);
GeoTiffFormat format = new GeoTiffFormat();
Hints hint = new Hints();
hint.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
tiffReader = format.getReader(tiffFile, hint);
GridCoverage2D grid = tiffReader.read(null);
I'm inspecting the GridCoverage2D
object in my debugger and have found the information in a few places.
The information I'm looking for here is the "UTM zone 16N"
. Perhaps the zone is given in numerical form somewhere else in the object?
This is inside GridCoverage2D->GridGeometry2D->CoordinateReferenceSystem2D
But for the life of me I cannot figure out how to access this information.
There's no reference to the underlying transformation conversionFromBase
in the top level object. None of the accessible methods get me anywhere closer.
Is there an encoded version somewhere in the CoordinateReferenceSystem
metadata?
EDIT
The output of the .toWKT()
method on my CoordinateReferenceSystem is below
PROJCS["unnamed",
GEOGCS["GCS Name = unknown",
DATUM["Datum = unknown",
SPHEROID["Ellipsoid = unretrievable - using WGS84", 6378137.0, 298.257223563]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Geodetic longitude", EAST],
AXIS["Geodetic latitude", NORTH]],
PROJECTION["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
PARAMETER["central_meridian", -87.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["scale_factor", 0.9996],
PARAMETER["false_easting", 500000.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["Easting", EAST],
AXIS["Northing", NORTH]]