Package noaa.coastwatch.util.trans
Class GeographicProjection
- All Implemented Interfaces:
Cloneable,ProjectionConstants
The
GeographicProjection class performs
geographic map projection calculations.- Since:
- 3.3.0
- Author:
- Peter Hollemans
-
Field Summary
Fields inherited from class noaa.coastwatch.util.trans.GCTPCStyleProjection
ERROR, IN_BREAK, LAT, LON, OK, params, X, YFields inherited from class noaa.coastwatch.util.trans.GCTPStyleProjection
C3P, D2R, ec, ec2, EPSLN, falseEast, falseNorth, HALF_PI, PI, R2D, rMajor, TWO_PIFields inherited from class noaa.coastwatch.util.trans.MapProjection
datum, DESCRIPTION, forwardAffine, inverseAffine, spheroid, system, zoneFields inherited from class noaa.coastwatch.util.trans.EarthTransform
boundaryHandler, dimsFields inherited from interface noaa.coastwatch.util.trans.ProjectionConstants
ALASKA, ALBERS, AZMEQD, EQRECT, EQUIDC, GEO, GNOMON, GOOD, GVNSP, HAMMER, HOM, IMOLL, LAMAZ, LAMCC, MAX_PROJECTIONS, MERCAT, MILLER, MOLL, OBEQA, ORTHO, POLYC, PROJECTION_NAMES, PS, ROBIN, SNSOID, SOM, SPCS, STEREO, TM, USDEF, UTM, VGRINT, WAGIV, WAGVII -
Constructor Summary
ConstructorsConstructorDescriptionGeographicProjection(double rMajor, double rMinor, int[] dimensions, AffineTransform affine) Constructs a map projection from the specified projection and affine transform. -
Method Summary
Modifier and TypeMethodDescriptiongetSubset(int[] start, int[] stride, int[] length) Creates a subset version of this map projection.getSubset(DataLocation newOrigin, int[] newDims) Creates and returns a new subset transform.booleanThe geographic implementation of the boundary cut test.protected longprojfor(double lat, double lon, double[] x, double[] y) Performs the actual forward calculation as specified in the GCTP C code.protected longprojinv(double x, double y, double[] lon, double[] lat) Performs the actual inverse calculation as specified in the GCTP C code.protected voidsetAffine(EarthLocation centerLoc, double[] pixelDims) Sets the affines for this projection based on center and pixel dimensions.protected voidtransformImpl(DataLocation dataLoc, EarthLocation earthLoc) Implements the data to geographic transform.protected voidtransformImpl(EarthLocation earthLoc, DataLocation dataLoc) Implements the geographic to data transform.Methods inherited from class noaa.coastwatch.util.trans.GCTPCStyleProjection
cenlat, cenlon, cenlonmer, genrpt, genrpt_long, getParameters, mapTransformFor, mapTransformInv, offsetp, origin, p_error, p_error, p_error, paksz, phi1z, phi2z, phi3z, phi4z, ptitle, radius, radius2, setParameters, sprintf, stanparl, stparl1Methods inherited from class noaa.coastwatch.util.trans.GCTPStyleProjection
adjust_lon, asinz, calc_utm_zone, e0fn, e1fn, e2fn, e3fn, e4fn, mlfn, msfnz, pack_angle, pakcz, pakr2dm, phi1z, phi2z, phi3z, phi4z, qsfnz, setDatum, setFalse, sign, sphdz, tsfnz, unpack_angleMethods inherited from class noaa.coastwatch.util.trans.MapProjection
clone, describe, equals, getAffine, getDatum, getModified, getPixelDimensions, getPixelSize, getProjection, getSpheroid, getSpheroidName, getSystem, getSystemName, getZone, isOrientable, setPositiveLonMethods inherited from class noaa.coastwatch.util.trans.EarthTransform2D
get2DVersion, getBoundingBox, getWorldAxes, main, setPointTransform, transformToPointMethods inherited from class noaa.coastwatch.util.trans.EarthTransform
closest, distance, getBoundaryHandler, getDimensions, getResolution, getSpheroid, getSpheroid, isInvertible, transform, transform, transform, transformMethods inherited from class noaa.coastwatch.util.MetadataContainer
getMetadataMap
-
Constructor Details
-
GeographicProjection
public GeographicProjection(double rMajor, double rMinor, int[] dimensions, AffineTransform affine) throws NoninvertibleTransformException Constructs a map projection from the specified projection and affine transform. TheSpheroidConstantsandProjectionConstantsclass should be consulted for valid parameter constants.- Parameters:
rMajor- the semi-major axis in meters.rMinor- the semi-minor axis in meters.dimensions- the dimensions of the data grid as[rows, columns].affine- the affine transform for translating data[row, column]to map[x, y].- Throws:
NoninvertibleTransformException- if the map projection to data coordinate affine transform is not invertible.
-
-
Method Details
-
setAffine
protected void setAffine(EarthLocation centerLoc, double[] pixelDims) throws NoninvertibleTransformException Description copied from class:MapProjectionSets the affines for this projection based on center and pixel dimensions.- Overrides:
setAffinein classMapProjection- Parameters:
centerLoc- the earth location at the map center.pixelDims- the pixel dimensions in meters at the projection reference point as[height, width].- Throws:
NoninvertibleTransformException- if the map projection to data coordinate affine transform is not invertible.
-
getSubset
Description copied from class:EarthTransformCreates and returns a new subset transform. The new transform is arranged with the specified new origin and dimensions. For example, if the transform maps the data location (100,100) to earth location (40N, 120W), and a translated transform is created with (100,100) as the new origin, then the new transform will map (0,0) to (40N, 120W). Note that not all transforms support subsets.- Overrides:
getSubsetin classMapProjection- Parameters:
newOrigin- the new data location origin.newDims- the new data location dimensions.
-
getSubset
Description copied from class:MapProjectionCreates a subset version of this map projection.- Overrides:
getSubsetin classMapProjection- Parameters:
start- the 2D starting data coordinates.stride- the 2D data stride.length- the total number of values in each dimension.- Returns:
- the subset and/or subsampled transform.
-
transformImpl
Description copied from class:EarthTransformImplements the data to geographic transform.- Overrides:
transformImplin classMapProjection- See Also:
-
transformImpl
Description copied from class:EarthTransformImplements the geographic to data transform.- Overrides:
transformImplin classMapProjection- See Also:
-
projfor
protected long projfor(double lat, double lon, double[] x, double[] y) Description copied from class:GCTPCStyleProjectionPerforms the actual forward calculation as specified in the GCTP C code. This method is as close as possible to the native C function signature.- Specified by:
projforin classGCTPCStyleProjection- Parameters:
lat- the latitude to convert.lon- the longitude to convert.x- the map coordinate x value (modified).y- the map coordinate y value (modified).- Returns:
- OK on success, or not OK on failure.
-
projinv
protected long projinv(double x, double y, double[] lon, double[] lat) Description copied from class:GCTPCStyleProjectionPerforms the actual inverse calculation as specified in the GCTP C code. This method is as close as possible to the native C function signature.- Specified by:
projinvin classGCTPCStyleProjection- Parameters:
x- the map coordinate x value (modified).y- the map coordinate y value (modified).lon- the longitude to convert.lat- the latitude to convert.- Returns:
- OK on success, or not OK on failure.
-
isBoundaryCut
The geographic implementation of the boundary cut test.
-