ValueGrid
Description
- Derived from
-
SerializableBase abstract
The ValueGrid class represents an axis-aligned grid of evenly spaced points in a geographic coordinate system, to provide correction values (such as height offsets) for interpolation by specific IDatumTransform implementations.
Each grid point stores a tuple of one or more correction values. A grid cell may also have an undefined tuple. The geographic coordinates of each grid point may be inferred from the grid bounds, the row and column counts and the grid coordinates of the point. Here is an example for a 5x4 grid:
0 1 2 3 4 0 #---#---#---#---# \ | | | | | | # := regular tuple 1 #---#---#---#---# | o := undefined tuple | | | x | | | 2 o---#---#---#---# | 4 tuple rows | | | | | | y := latitude 3 o---o---#---#---# / \_______________/ 5 tuple columns x := longitude
The grid point (0|0) corresponds to LatLonRange.Start of Bounds and (4|3) corresponds to LatLonRange.End. The point x at (2.5|1.5) can be interpolated from the surrounding grid points (2|1), (3|1), (2|2) and (3|2). If one or more of the surrounding grid points have an undefined value, the interpolated value will also be undefined.
Public / Constructors
FromArray
Creates a new instance of ValueGrid.
For the grid point at (X|Y), the given values in array is indexed as follows:
values[offset + Y * rowStride + X * columnStride + index * tupleStride]
where index if the zero-based tuple value index. If the computed array index is outside the array bounds, the value Maths.NanD is used. If a value in the array is not a regular number (see Maths.IsNumber), it will also be replaced by Maths.NanD.
FromFile
Builds a ValueGrid from a text file that contains grid point data.
This method delegates to FromText, after reading textFile in with Path.ReadAllText.
- ValidatingException
-
If textFile in is malformed.
- IOException
-
If an I/O error has occurred.
FromText
Builds a ValueGrid from a text file that contains grid point data.
The given point list text is read line-by-line. Empty and whitespace-only lines are ignored. Each line of text must have the following format:
One or more characters that classify as whitespace | 1.1 2.2 3.3 4.4 ... | | | | \__ Additional tuple values (index >=2) | | | \__ Second tuple value (index 1) | | \__ First tuple value (index 0) | \__ Second geographic coordinate (default: longitude) \__ First geographic coordinate (default: latitude)
After consuming the point list, this method delegates to FromArray to build the value grid.
- ValidatingException
-
If pointList in is malformed or some points do not lie within the given tolerance opt.
Public / Methods
Coordinates
3 overloads
Computes the coordinates of a grid point.
- See also
Computes the coordinates of a grid point.
- See also
Computes the coordinates of a grid point.
- See also
Interpolate2
Interpolates the values at the given geographic coordinates.
This method behaves like Interpolate for each component of the returned vector.
Interpolate3
Interpolates the values at the given geographic coordinates.
This method behaves like Interpolate for each component of the returned vector.
Interpolate4
Interpolates the values at the given geographic coordinates.
This method behaves like Interpolate for each component of the returned vector.
Public / Attributes
Geographic
The geographic coordinate system of the grid.
The ValueGrid class works with latitude and longitude angles in degrees. So, CoordinateSystem.HorizontalUnit and CoordinateSystem.Flags need to be applied (for example, via ICoordinateTransform.GeographicToMap).