public class NTV2SubGrid extends Object implements Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
private String |
created |
private float[] |
latAccuracy |
private double |
latInterval |
private int |
latRowCount |
private float[] |
latShift |
private float[] |
lonAccuracy |
private int |
lonColumnCount |
private double |
lonInterval |
private float[] |
lonShift |
private double |
maxLat |
private double |
maxLon |
private double |
minLat |
private double |
minLon |
private int |
nodeCount |
private String |
parentSubGridName |
private static long |
serialVersionUID |
private NTV2SubGrid[] |
subGrid |
private String |
subGridName |
private String |
updated |
Constructor and Description |
---|
NTV2SubGrid(InputStream in,
boolean bigEndian,
boolean loadAccuracy)
Construct a Sub Grid from an InputStream, loading the node data into
arrays in this object.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Make a deep clone of this Sub Grid
|
String |
getDetails()
Returns textual details about the sub grid.
|
double |
getMaxLat()
Get maximum latitude value
|
double |
getMaxLon()
Get maximum longitude value
|
double |
getMinLat()
Get minimum latitude value
|
double |
getMinLon()
Get minimum longitude value
|
int |
getNodeCount() |
String |
getParentSubGridName() |
NTV2SubGrid |
getSubGrid(int index) |
int |
getSubGridCount() |
NTV2SubGrid |
getSubGridForCoord(double lon,
double lat)
Tests if a specified coordinate is within this Sub Grid
or one of its Sub Grids.
|
String |
getSubGridName() |
private static double |
interpolate(float a,
float b,
float c,
float d,
double x,
double y)
Bi-Linear interpolation of four nearest node values as described in
'GDAit Software Architecture Manual' produced by the
Geomatics Department of the University of Melbourne
|
void |
interpolateGridShift(NTV2GridShift gs)
Interpolate shift and accuracy values for a coordinate in the 'from' datum
of the GridShiftFile.
|
private boolean |
isCoordWithin(double lon,
double lat)
Tests if a specified coordinate is within this Sub Grid.
|
private static void |
readBytes(InputStream in,
byte[] b) |
void |
setSubGridArray(NTV2SubGrid[] subGrid)
Set an array of Sub Grids of this sub grid
|
String |
toString() |
private static final long serialVersionUID
private final String subGridName
private final String parentSubGridName
private final double minLat
private final double maxLat
private final double minLon
private final double maxLon
private final double latInterval
private final double lonInterval
private final int nodeCount
private final int lonColumnCount
private final int latRowCount
private final float[] latShift
private final float[] lonShift
private float[] latAccuracy
private float[] lonAccuracy
private NTV2SubGrid[] subGrid
public NTV2SubGrid(InputStream in, boolean bigEndian, boolean loadAccuracy) throws IOException
in
- GridShiftFile InputStreambigEndian
- is the file bigEndian?loadAccuracy
- is the node Accuracy data to be loaded?IOException
- if any I/O error occursprivate static void readBytes(InputStream in, byte[] b) throws IOException
IOException
public NTV2SubGrid getSubGridForCoord(double lon, double lat)
lon
- Longitude in Positive West Secondslat
- Latitude in Secondsprivate boolean isCoordWithin(double lon, double lat)
lon
- Longitude in Positive West Secondslat
- Latitude in Secondsprivate static double interpolate(float a, float b, float c, float d, double x, double y)
a
- value at the A nodeb
- value at the B nodec
- value at the C noded
- value at the D nodex
- Longitude factory
- Latitude factorpublic void interpolateGridShift(NTV2GridShift gs)
This method is thread safe for both memory based and file based node data.
gs
- GridShift object containing the coordinate to shift and the shift valuespublic String getParentSubGridName()
public String getSubGridName()
public int getNodeCount()
public int getSubGridCount()
public NTV2SubGrid getSubGrid(int index)
public void setSubGridArray(NTV2SubGrid[] subGrid)
subGrid
- subgridspublic String getDetails()
public double getMaxLat()
public double getMaxLon()
public double getMinLat()
public double getMinLon()