public class GCTP extends java.lang.Object implements SpheroidConstants, ProjectionConstants
MapProjectionFactory
to create
and work with map projections. The GCTP parameter related methods
in this class are still useful for creating arrays of valid
parameters to pass to the map projection factory creation methods.Modifier and Type | Class and Description |
---|---|
static class |
GCTP.Requirements
The GCTP requirements class helps determine the various
parameters required for each projection.
|
Modifier and Type | Field and Description |
---|---|
static int |
BOTH
Print errors to both file and terminal.
|
static int |
DEGREE
Decimal degrees units code.
|
static int |
FEET
US Feet units code.
|
static int |
FILE
Print errors to a file.
|
static int |
INT_FEET
International Feet units code.
|
static int |
METER
Meters units code.
|
static int |
NEITHER
Do not print error messages.
|
static int |
RADIAN
Radians units code.
|
static int |
SECOND
Arc Seconds units code.
|
static int |
STPLN_TABLE
State Plane table units code.
|
static int |
TERM
Print errors to the terminal.
|
AIRY, AUS_NAT, BESSEL, CLARKE1866, CLARKE1880, EVEREST, GRS1980, HOUGH, INT1909, INT1967, KRASS, MAX_SPHEROIDS, MERCURY1960, MOD_AIRY, MOD_EVEREST, MOD_MER1968, SE_ASIA, SPHERE, SPHEROID_INV_FLAT, SPHEROID_NAMES, SPHEROID_SEMI_MAJOR, SPHEROID_SEMI_MINOR, STD_RADIUS, WGS66, WGS72, WGS84
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
Modifier and Type | Method and Description |
---|---|
static double[] |
forward(double[] pos,
int output_system)
Deprecated.
The native methods of GCTP are no longer supported. Use
the
MapProjectionFactory to create
and work with map projections. |
static double[] |
gctp(double[] input_coord,
int input_system,
int input_zone,
double[] input_parameters,
int input_units,
int input_spheroid,
int error_message_flag,
java.lang.String error_file,
int jpr,
java.lang.String pfile,
int output_system,
int output_zone,
double[] output_parameters,
int output_unit,
int output_spheroid,
java.lang.String NAD1927_zonefile,
java.lang.String NAD1983_zonefile)
Deprecated.
The native methods of GCTP are no longer supported. Use
the
MapProjectionFactory to create
and work with map projections. |
static GCTP.Requirements[] |
getRequirements(int system)
Gets the requirements for the specified projection.
|
static void |
init_forward(int output_system,
int output_zone,
double[] output_parameters,
int output_spheroid,
java.lang.String NAD1927_zonefile,
java.lang.String NAD1983_zonefile)
Deprecated.
The native methods of GCTP are no longer supported. Use
the
MapProjectionFactory to create
and work with map projections. |
static void |
init_inverse(int input_system,
int input_zone,
double[] input_parameters,
int input_spheroid,
java.lang.String NAD1927_zonefile,
java.lang.String NAD1983_zonefile)
Deprecated.
The native methods of GCTP are no longer supported. Use
the
MapProjectionFactory to create
and work with map projections. |
static double[] |
inverse(double[] pos,
int input_system)
Deprecated.
The native methods of GCTP are no longer supported. Use
the
MapProjectionFactory to create
and work with map projections. |
static boolean |
isSupportedSpheroid(int spheroid,
int system)
Determines if the projection system supports the specified
spheroid earth model.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
static double |
pack_angle(double angle)
Packs an angle in degrees to DDDMMMSSS.SS format.
|
static boolean |
supportsSpheroid(int system)
Determines if the projection system supports a generic
spheroid earth model, or only a perfect sphere.
|
static double |
unpack_angle(double angle)
Unpacks an angle in DDDMMMSSS.SS format to degrees.
|
public static final int RADIAN
public static final int FEET
public static final int METER
public static final int SECOND
public static final int DEGREE
public static final int INT_FEET
public static final int STPLN_TABLE
public static final int TERM
public static final int FILE
public static final int BOTH
public static final int NEITHER
public static boolean isSupportedSpheroid(int spheroid, int system)
supportsSpheroid(int)
because it gives more specific
information about spheroids supported. This routine should be
used prior to creating a map projection with the
MapProjectionFactory
methods,
to make sure that no error with be thrown if an incompatible
projection system and spheroid model are attempted.spheroid
- the spheroid to check for support.system
- the projection system to check for support.public static boolean supportsSpheroid(int system)
system
- the projection system code.public static GCTP.Requirements[] getRequirements(int system)
system
- the projection system code.@Deprecated public static double[] gctp(double[] input_coord, int input_system, int input_zone, double[] input_parameters, int input_units, int input_spheroid, int error_message_flag, java.lang.String error_file, int jpr, java.lang.String pfile, int output_system, int output_zone, double[] output_parameters, int output_unit, int output_spheroid, java.lang.String NAD1927_zonefile, java.lang.String NAD1983_zonefile)
MapProjectionFactory
to create
and work with map projections.input_coord
- the data coordinate to transform. Input
coordinate values are either [x, y]
in a projection
coordinate system or [lon, lat]
for geographic
coordinates.input_system
- the projection type of the input coordinates.
The projection type must be a valid GCTP projection code
constant.input_zone
- the zone of the input coordinates if the input
system is State Plane or UTM.input_parameters
- an array of 15 parameters for the input
projection system.input_units
- the input coordinate units. The input units
must be a valid GCTP units code constant.input_spheroid
- the input coordinate spheroid. The input
spheroid must be a valid GCTP spheroid code constant.error_message_flag
- a flag to determine the destination of
error messages. The value must be TERM
,
FILE
, BOTH
, or NEITHER
.
See the GCTP constants for details.error_file
- the file name for error messages.jpr
- a flag to determine the destination of projection
parameter messages. The value must be TERM
,
FILE
, BOTH
, or NEITHER
.
See the GCTP constants for details.pfile
- the file name for projection parameter messages.output_system
- the projection type of the output
coordinates. The projection type must be a valid GCTP projection
code constant.output_zone
- the zone of the output coordinates if the
output system is State Plane or UTM.output_parameters
- an array of 15 parameters for the output
projection system.output_unit
- the output coordinate units. The output units
must be a valid GCTP units code constant.output_spheroid
- the output coordinate spheroid. The output
spheroid must be a valid GCTP spheroid code constant.NAD1927_zonefile
- the file containing NAD 1927 State Plane
zone parameters.NAD1983_zonefile
- the file containing NAD 1983 State Plane
zone parameters.[x, y]
in a projection coordinate system or
[lon, lat]
for geographic coordinates.@Deprecated public static void init_forward(int output_system, int output_zone, double[] output_parameters, int output_spheroid, java.lang.String NAD1927_zonefile, java.lang.String NAD1983_zonefile)
MapProjectionFactory
to create
and work with map projections.forward
will use the specified
projection parameters.
Refer to the gctp(double[], int, int, double[], int, int, int, java.lang.String, int, java.lang.String, int, int, double[], int, int, java.lang.String, java.lang.String)
routine output parameters for details.
@Deprecated public static void init_inverse(int input_system, int input_zone, double[] input_parameters, int input_spheroid, java.lang.String NAD1927_zonefile, java.lang.String NAD1983_zonefile)
MapProjectionFactory
to create
and work with map projections.inverse
will use the specified
projection parameters.
Refer to the gctp(double[], int, int, double[], int, int, int, java.lang.String, int, java.lang.String, int, int, double[], int, int, java.lang.String, java.lang.String)
routine input parameters for details.
@Deprecated public static double[] forward(double[] pos, int output_system) throws java.lang.Exception
MapProjectionFactory
to create
and work with map projections.pos
- the coordinates to transform as [lon,
lat]
in radians.output_system
- the projection type of the output
coordinates. The projection type must be a valid GCTP projection
code constant.[x, y]
.java.lang.Exception
- if the forward transform failed. Usually, this
is because some geographic coordinates have no valid map
coordinates.inverse(double[], int)
@Deprecated public static double[] inverse(double[] pos, int input_system) throws java.lang.Exception
MapProjectionFactory
to create
and work with map projections.pos
- the coordinates to transform in [x, y]
.input_system
- the projection type of the input
coordinates. The projection type must be a valid GCTP projection
code constant.[lon, lat]
in radians.java.lang.Exception
- if the inverse transform failed.forward(double[], int)
public static double pack_angle(double angle)
angle
- the angle in degrees.public static double unpack_angle(double angle)
angle
- the packed angle in DDDMMMSSS.SS format.public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception