Click or drag to resize

GridReprojector Class

Class for reprojecting a source grid in one coordinate system to a target grid in another coordinate system.

Both source and target grids are regular in each their coordinate system. However, the source grid may not be a regular grid in the target coordinate system, so re-gridding and interpolation is necessary.

This class is intended for reuse, i.e. reprojection weights are stored and if executing the Convert(Single, Single, Single, Single) method more than once, the stored reprojection values are reused. This is for performance reasons, since the actual reprojection can be an expensive operation.

Inheritance Hierarchy
SystemObject
  DHI.ProjectionsGridReprojector

Namespace:  DHI.Projections
Assembly:  DHI.Projections (in DHI.Projections.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class GridReprojector

The GridReprojector type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyDoInterpolate
Bool specifying whether to interpolate (true) or take the closest value (false, default)
Public propertyReprojector
Reprojector for handling datum conversions. It must convert Geo2Geo.

If the two projections share the same datum, the reprojection step can be omitted. However, the Reprojector is clever enough to do nothing in that case, so we make it anyway.

If not provided explicitly, a default Reprojector is created when setting the target. You can use this to set datum shift parameters.

Any updates to the default reprojector must be done after the target has been set and before calling Initialize.

Public propertyTargetGridInfo
Information on target grid. Null if not set (before calling one of the SetTarget method).

If not specified fully the target grid-info, this is first populated fully after Initialize.

Top
Methods
  NameDescription
Public methodConvert
Convert source data to target data
Public methodConvertBitmapData
NOTE: Experimental!

Convert source data to target data, assuming source and target are 32 bit bitmap data.

When defining source and target grid, remember they must include the proper "scan width" (single row of pixels), which may be larger than the width of the bitmap image.

Currently only supports top-down bitmaps.

Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitialize
Initialize; calculate target grid info (if necessary), set up internal structures for fast processing of reprojections and interpolations.
Public methodInitialize(Boolean)
Initialize; calculate target grid info (if necessary), set up internal structures for fast processing of reprojections and interpolations.

If only one conversion is required, set the oneTimeConvert to true, to skip setting up of internal structures. Currently only applicable if using the ConvertBitmapData(Byte, Byte) method.

Public methodSetTarget(GridReprojectorGridInfo)
Fully specify the target gridinfo
Public methodSetTarget(String, Double)
Define target projection string, and orientation (towards projection north).

All other properties of the target GridInfo is calculated (during Initialize) from the bounding box of source grid in the target local grid coordinate system, such that the target contains the entire area defined by the source GridInfo.

Public methodSetTarget(String, Double, Int32, Int32)
Define target projection string, orientation (towards projection north), and number of grid points in the x and y direction in the target.

All other properties of the target GridInfo is calculated (during Initialize) from the bounding box of source grid in the target local grid coordinate system such that the target contains the entire area defined by the source GridInfo.

Compared to SetTarget(String, Double), this version will change the resolution of the target grid in the x and y direction.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also