Package noaa.coastwatch.util.trans
Class StatePlaneProjection
- All Implemented Interfaces:
Cloneable
,ProjectionConstants
The
StatePlaneProjection
class performs
State Plane 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, Y
Fields inherited from class noaa.coastwatch.util.trans.GCTPStyleProjection
C3P, D2R, ec, ec2, EPSLN, falseEast, falseNorth, HALF_PI, PI, R2D, rMajor, TWO_PI
Fields inherited from class noaa.coastwatch.util.trans.MapProjection
datum, DESCRIPTION, forwardAffine, inverseAffine, spheroid, system, zone
Fields inherited from class noaa.coastwatch.util.trans.EarthTransform
boundaryHandler, dims
Fields 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
ConstructorDescriptionStatePlaneProjection
(int[] dimensions, AffineTransform affine, long zone, long sphere, String fn27, String fn83) Constructs a map projection from the specified projection and affine transform. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Tests this class.void
mapTransformFor
(double[] lonLat, double[] xy) Performs a forward map transformation from (latitude, longitude) coordinates to map (x, y).void
mapTransformInv
(double[] xy, double[] lonLat) Performs an inverse map transformation from map (x, y) coordinates to (latitude, longitude).protected long
projfor
(double lat, double lon, double[] x, double[] y) Performs the actual forward calculation as specified in the GCTP C code.protected long
projinv
(double x, double y, double[] lon, double[] lat) Performs the actual inverse calculation as specified in the GCTP C code.Methods inherited from class noaa.coastwatch.util.trans.GCTPCStyleProjection
cenlat, cenlon, cenlonmer, genrpt, genrpt_long, getParameters, offsetp, origin, p_error, p_error, p_error, paksz, phi1z, phi2z, phi3z, phi4z, ptitle, radius, radius2, setParameters, sprintf, stanparl, stparl1
Methods 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_angle
Methods inherited from class noaa.coastwatch.util.trans.MapProjection
clone, describe, equals, getAffine, getDatum, getModified, getPixelDimensions, getPixelSize, getProjection, getSpheroid, getSpheroidName, getSubset, getSubset, getSystem, getSystemName, getZone, isOrientable, setAffine, setPositiveLon, transformImpl, transformImpl
Methods inherited from class noaa.coastwatch.util.trans.EarthTransform2D
get2DVersion, getBoundingBox, getWorldAxes, setPointTransform, transformToPoint
Methods inherited from class noaa.coastwatch.util.trans.EarthTransform
distance, getBoundaryHandler, getDimensions, getResolution, getSpheroid, getSpheroid, isInvertible, transform, transform, transform, transform
Methods inherited from class noaa.coastwatch.util.MetadataContainer
getMetadataMap
-
Constructor Details
-
StatePlaneProjection
public StatePlaneProjection(int[] dimensions, AffineTransform affine, long zone, long sphere, String fn27, String fn83) throws NoninvertibleTransformException Constructs a map projection from the specified projection and affine transform. TheSpheroidConstants
andProjectionConstants
class should be consulted for valid parameter constants.- Parameters:
dimensions
- the dimensions of the data grid as[rows, columns]
.affine
- the affine transform for translating data[row, column]
to map[x, y]
.zone
- the zone number.sphere
- the spheroid number.fn27
- the name of file containing the NAD27 parameters.fn83
- the name of file containing the NAD83 parameters.- Throws:
NoninvertibleTransformException
- if the map projection to data coordinate affine transform is not invertible.IllegalArgumentException
- if the paramaters have an inconsistency.
-
-
Method Details
-
projfor
protected long projfor(double lat, double lon, double[] x, double[] y) Description copied from class:GCTPCStyleProjection
Performs 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:
projfor
in 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.
-
mapTransformFor
public void mapTransformFor(double[] lonLat, double[] xy) Description copied from class:MapProjection
Performs a forward map transformation from (latitude, longitude) coordinates to map (x, y).- Overrides:
mapTransformFor
in classGCTPCStyleProjection
- Parameters:
lonLat
- the longitude and latitude in radians.xy
- the x and y in meters or Double.NaN if the transform could not be computed (modified).
-
projinv
protected long projinv(double x, double y, double[] lon, double[] lat) Description copied from class:GCTPCStyleProjection
Performs 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:
projinv
in 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.
-
mapTransformInv
public void mapTransformInv(double[] xy, double[] lonLat) Description copied from class:MapProjection
Performs an inverse map transformation from map (x, y) coordinates to (latitude, longitude).- Overrides:
mapTransformInv
in classGCTPCStyleProjection
- Parameters:
xy
- the x and y in meters.lonLat
- the longitude and latitude in radians or Double.NaN if the transform could not be computed (modified).
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-