InterpolatingConverter Class |
The assumption is that the original conversion is fairly expensive, and accuracy is not as important as performance.
The conversion is pre-calculated on a grid inside the user specified area. The original expensive conversion will only be performed initially to create the pre-calculated grid values.
The accuracy of the bilinear interpolation depends on the grid spacing and the original conversion. The more non-linear the original conversion is, the smaller a grid spacing is required to get the same accuracy. Typical values of grid spacing dx to get app. 1 m accuracy:
Namespace: DHI.Projections
The InterpolatingConverter type exposes the following members.
Name | Description | |
---|---|---|
InterpolatingConverter |
Create new object
|
Name | Description | |
---|---|---|
CalculateErrorEstimate |
Calculate an estimate of the largest error
for the provided dx and dy. The error estimate
is calculated in the center of the domain, which
may not be representative for the entire domain,
so the error estimate is usually lower than the
actual largest error.
| |
CalculateGridSizeFromErrorEstimate |
Calculate and return a grid size estimate based on a max error.
This only returns an indication, the actual error will usually
be larger than the max error, for the returned grid size.
Grid size cannot be larger than extent of area in x and y direction. | |
Convert |
Convert the (x,y) coordinate
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Initialize |
Initialize buffer grid
| |
SetupArea |
Setup the region that the buffer should cover. You must also call
SetupGridSize(Int32, Int32) or SetupGridSpacing(Double, Double).
| |
SetupGrid |
Setup manually region and buffer grid size
| |
SetupGridSize |
Set up the size of the pre-calculated grid.
Call first SetupArea(Double, Double, Double, Double) before calling this | |
SetupGridSpacing |
Set up the grid spacing of the pre-calculated grid
Call first SetupArea(Double, Double, Double, Double) before calling this | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
// Setup converter to use reprojector Reprojector reprojector = new Reprojector(sourceProjection, targetProjection); GridBufferConverter.Conversion conversion = delegate(ref double x, ref double y) { reprojector.Convert(ref x, ref y); }; GridBufferConverter converter = new GridBufferConverter(conversion); // Define the area to work on and the size of the pre-calculated grid converter.SetupArea(x0, y0, x1, y1); converter.SetupGridSize(xCount, yCount); converter.Initialize(); // Converter is now ready for use converter.Convert(ref x, ref y);