public class NADCONTransform extends AbstractMathTransform implements MathTransform2D, Serializable
Some of the NADCON grids, their areas of use, and source datums are shown in the following table.
Shift File Name | Area | Source Datum | Accuracy at 67% confidence (m) |
---|---|---|---|
CONUS | Conterminous U S (lower 48 states) | NAD27 | 0.15 |
ALASKA | Alaska, incl. Aleutian Islands | NAD27 | 0.5 |
HAWAII | Hawaiian Islands | Old Hawaiian (4135) | 0.2 |
STLRNC | St. Lawrence Is., AK | St. Lawrence Island (4136) | -- |
STPAUL | St. Paul Is., AK | St. Paul Island (4137) | -- |
STGEORGE | St. George Is., AK | St. George Island (4138) | -- |
PRVI | Puerto Rico and the Virgin Islands | Puerto Rico (4139) | 0.05 |
Grid shift files come in two formats: binary and text. The files from the NGS are binary and
have .las
(latitude shift) and .los
(longitude shift) extentions. Text grids may
be created with the NGS nadgrd program and have .laa
(latitude shift) and
.loa
(longitude shift) file extentions. Both types of files may be used here.
The grid names to use for transforming are parameters of this MathTransform
. This
parameter may be the full name and path to the grids or just the name of the grids if the default
location of the grids was set as a preference. This preference may be set with the main method of
this class.
Transformations here have been tested to be within 0.00001 seconds of values given by the NGS ndcon210 program for NADCON grids. American Samoa and HARN shifts have not yet been tested. References:
ndcon210.for
- NGS fortran source code for NADCON conversions. See the following
subroutines: TRANSF, TO83, FGRID, INTRP, COEFF and SURF
nadgrd.for
- NGS fortran source code to export/import binary and text grid formats
Modifier and Type | Class and Description |
---|---|
static class |
NADCONTransform.Provider
The provider for
NADCONTransform . |
SINGLE_LINE
Constructor and Description |
---|
NADCONTransform(URI latGridName,
URI longGridName)
Constructs a
NADCONTransform from the specified grid shift files. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Compares the specified object with this math transform for equality.
|
ParameterDescriptorGroup |
getParameterDescriptors()
Returns the parameter descriptors for this math transform.
|
ParameterValueGroup |
getParameterValues()
Returns the parameter values for this math transform.
|
int |
getSourceDimensions()
Gets the dimension of input points (always 2).
|
int |
getTargetDimensions()
Gets the dimension of output points (always 2).
|
int |
hashCode()
Returns a hash value for this transform.
|
MathTransform2D |
inverse()
Returns the inverse of this transform.
|
void |
inverseTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms nad83 values to nad27.
|
protected URL |
locateGrid(URI uri) |
static void |
main(String[] args)
Used to set the preference for the default grid shift file location.
|
void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms a list of coordinate point ordinal values.
|
createTransformedShape, derivative, derivative, ensureNonNull, formatWKT, getName, isIdentity, needCopy, normalizeAngle, rollLongitude, transform, transform, transform, transform, transform
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKT
createTransformedShape, derivative, transform
derivative, isIdentity, toWKT, transform, transform, transform, transform
public NADCONTransform(URI latGridName, URI longGridName) throws ParameterNotFoundException, FactoryException
NADCONTransform
from the specified grid shift files.latGridName
- path and name (or just name if GRID_LOCATION
is set) to the
latitude difference file. This will have a .las
or .laa
file extention.longGridName
- path and name (or just name if GRID_LOCATION
is set) to the
longitude difference file. This will have a .los
or .loa
file extention.ParameterNotFoundException
- if a math transform parameter cannot be found.FactoryException
- if there is a problem creating this math transform (ie file
extentions are unknown or there is an error reading the grid files)protected URL locateGrid(URI uri) throws FactoryException
FactoryException
public ParameterDescriptorGroup getParameterDescriptors()
getParameterDescriptors
in class AbstractMathTransform
null
.OperationMethod.getParameters()
public ParameterValueGroup getParameterValues()
getParameterValues
in class AbstractMathTransform
Operation.getParameterValues()
public int getSourceDimensions()
getSourceDimensions
in interface MathTransform
getSourceDimensions
in class AbstractMathTransform
public int getTargetDimensions()
getTargetDimensions
in interface MathTransform
getTargetDimensions
in class AbstractMathTransform
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws TransformException
x1,y1,z1 ...). All input and output values are in decimal degrees.
transform
in interface MathTransform
srcPts
- the array containing the source point coordinates.srcOff
- the offset to the first point to be transformed in the source array.dstPts
- the array into which the transformed point coordinates are returned. May be the
same than srcPts
.dstOff
- the offset to the location of the first transformed point that is stored in the
destination array.numPts
- the number of point objects to be transformed.TransformException
- if the input point is outside the area covered by this grid.public void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws TransformException
srcPts
- the array containing the source point coordinates.srcOff
- the offset to the first point to be transformed in the source array.dstPts
- the array into which the transformed point coordinates are returned. May be the
same than srcPts
.dstOff
- the offset to the location of the first transformed point that is stored in the
destination array.numPts
- the number of point objects to be transformed.TransformException
- if the input point is outside the area covered by this grid.public MathTransform2D inverse()
inverse
in interface MathTransform
inverse
in interface MathTransform2D
inverse
in class AbstractMathTransform
public int hashCode()
AbstractMathTransform
hashCode
in class AbstractMathTransform
public boolean equals(Object object)
AbstractMathTransform
object
is an instance of the same class than this
and use the same parameter descriptor. Subclasses should override this method in order to
compare internal fields.equals
in class AbstractMathTransform
object
- The object to compare with this transform.true
if the given object is a transform of the same class and if, given
identical source position, the transformed position would be the equals.public static void main(String[] args)
Example:
java org.geotools.referencing.operation.transform.NADCONTransform file:///home/rschulz/GIS/NADCON/data
args
- a single argument for the defualt location of grid shift filesCopyright © 1996–2019 Geotools. All rights reserved.