Class NTV2SubGrid
java.lang.Object
org.openstreetmap.josm.data.projection.datum.NTV2SubGrid
- All Implemented Interfaces:
Serializable
Models the NTv2 Sub Grid within a Grid Shift File.
- Since:
- 2507
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate float[]private final doubleprivate final intprivate final float[]private float[]private final intprivate final doubleprivate final float[]private final doubleprivate final doubleprivate final doubleprivate final doubleprivate final intprivate final Stringprivate static final longprivate NTV2SubGrid[]private final Stringprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionNTV2SubGrid(InputStream in, boolean bigEndian, boolean loadAccuracy) Construct a Sub Grid from an InputStream, loading the node data into arrays in this object. -
Method Summary
Modifier and TypeMethodDescriptionReturns textual details about the sub grid.doubleGet maximum latitude valuedoubleGet maximum longitude valuedoubleGet minimum latitude valuedoubleGet minimum longitude valueintReturns the node count.Returns the parent sub grid name.intReturns the sub grid count.getSubGridForCoord(double lon, double lat) Tests if a specified coordinate is within this Sub Grid or one of its Sub Grids.Returns the sub grid name.private static doubleinterpolate(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 MelbournevoidInterpolate shift and accuracy values for a coordinate in the 'from' datum of the GridShiftFile.private booleanisCoordWithin(double lon, double lat) Tests if a specified coordinate is within this Sub Grid.private static voidreadBytes(InputStream in, byte[] b) voidsetSubGridArray(NTV2SubGrid... subGrid) Set an array of Sub Grids of this sub gridtoString()
-
Field Details
-
serialVersionUID
- See Also:
-
subGridName
-
parentSubGridName
-
created
-
updated
-
minLat
-
maxLat
-
minLon
-
maxLon
-
latInterval
-
lonInterval
-
nodeCount
-
lonColumnCount
-
latRowCount
-
latShift
-
lonShift
-
latAccuracy
-
lonAccuracy
-
subGrid
-
-
Constructor Details
-
NTV2SubGrid
Construct a Sub Grid from an InputStream, loading the node data into arrays in this object.- Parameters:
in- GridShiftFile InputStreambigEndian- is the file bigEndian?loadAccuracy- is the node Accuracy data to be loaded?- Throws:
IOException- if any I/O error occurs
-
-
Method Details
-
readBytes
- Throws:
IOException
-
getSubGridForCoord
Tests if a specified coordinate is within this Sub Grid or one of its Sub Grids. If the coordinate is outside this Sub Grid, null is returned. If the coordinate is within this Sub Grid, but not within any of its Sub Grids, this Sub Grid is returned. If the coordinate is within one of this Sub Grid's Sub Grids, the method is called recursively on the child Sub Grid.- Parameters:
lon- Longitude in Positive West Secondslat- Latitude in Seconds- Returns:
- the Sub Grid containing the Coordinate or null
-
isCoordWithin
Tests if a specified coordinate is within this Sub Grid. A coordinate on either outer edge (maximum Latitude or maximum Longitude) is deemed to be outside the grid.- Parameters:
lon- Longitude in Positive West Secondslat- Latitude in Seconds- Returns:
- true or false
-
interpolate
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- Parameters:
a- value at the A nodeb- value at the B nodec- value at the C noded- value at the D nodex- Longitude factory- Latitude factor- Returns:
- interpolated value
-
interpolateGridShift
Interpolate shift and accuracy values for a coordinate in the 'from' datum of the GridShiftFile. The algorithm is described in 'GDAit Software Architecture Manual' produced by the Geomatics Department of the University of MelbourneThis method is thread safe for both memory based and file based node data.
- Parameters:
gs- GridShift object containing the coordinate to shift and the shift values
-
getParentSubGridName
Returns the parent sub grid name.- Returns:
- the parent sub grid name
-
getSubGridName
Returns the sub grid name.- Returns:
- the sub grid name
-
getNodeCount
Returns the node count.- Returns:
- the node count
-
getSubGridCount
Returns the sub grid count.- Returns:
- the sub grid count
-
setSubGridArray
Set an array of Sub Grids of this sub grid- Parameters:
subGrid- subgrids
-
toString
-
getDetails
Returns textual details about the sub grid.- Returns:
- textual details about the sub grid
-
getMaxLat
Get maximum latitude value- Returns:
- maximum latitude
-
getMaxLon
Get maximum longitude value- Returns:
- maximum longitude
-
getMinLat
Get minimum latitude value- Returns:
- minimum latitude
-
getMinLon
Get minimum longitude value- Returns:
- minimum longitude
-