Reprojector Class |
The TypeOfConversion defines type of coordinates used in conversion.
The reprojection conversion from source map projection to target map projection coordinates works as follows:
The datum shift works in a two step process:
It is possible to specify datum shift parameters for as well the source as the target map projection.
If datum shift parameters directly from source to target is known, this must be set as the source datum shift parameters.
If datum shift parameters directly from target to source is known, this must be set as the target datum shift parameters.
If datum shift parameters is known from both source and target to a common datum, both set of parameters must be specified. Then a reprojection will first convert from source datum to common datum, and then from common datum to target datum by an inverse datum shift operation.
Namespace: DHI.Projections
The Reprojector type exposes the following members.
Name | Description | |
---|---|---|
Reprojector(String, String) |
Create a new reprojector object, converting from source to target as specified in the
arguments.
| |
Reprojector(String, String, Boolean) |
Create a new reprojector object, converting from source to target as specified in the
arguments.
|
Name | Description | |
---|---|---|
DoDatumConversions |
Flag informing whether datum conversions are enabled or disabled.
Datum conversions are by default enabled, and disabled only if the datums (ellipsoids) of the source and target are the same, AND no datum shifts has been specified. Datum conversions can be explicitly bypassed by calling BypassDatumConversions. The flag can be reset to its default value by calling ResetDoDatumConversions.Call to any of the SetDatumShiftParameters or the SetNoDatumShift(ReprojectorSide) methods will also revert this flag to its default value. | |
ProjectionStringSource |
Target Map Projection
| |
ProjectionStringTarget |
Source Map Projection
| |
TypeOfConversion |
Type of conversion. Default is Proj2Proj.
|
Name | Description | |
---|---|---|
BypassDatumConversions |
Explicitly bypass datum conversions, setting the DoDatumConversions to false.
| |
Convert(Double, Double) |
Converts a point (x, y) from the source map projection to the target map projection.
| |
Convert(Double, Double, Double) |
Converts a point (x, y, h) from the source map projection to the target map projection.
| |
DatumShift |
Converts a point in Euclidean coordinates (x, y, z) relative to the source datum center to
Euclidean coordinates relative to the target datum center.
This is done in a two step process. First the coordinates are converted from the source datum center to an arbitrary geocentric Euclidean space, and from there it's converted to the target datum center. | |
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.) | |
InvConvert(Double, Double) |
Inverse conversion, converts a point (x, y) from the target map projection to the source map projection.
| |
InvConvert(Double, Double, Double) |
Inverse conversion, converts a point (x, y, h) from the target map projection to the source map projection.
| |
InvDatumShift |
Inverse conversion, converts a point in Euclidean coordinates (x, y, z) relative to the
target datum center to Euclidean coordinates relative to the source datum center.
This is done in a two step process. First the coordinates are converted from the target datum center to an arbitrary geocentric Euclidean space, and from there it's converted to the source datum center. | |
InvertOrder |
Invert the order of the conversion, by swapping the source and the target map
projection, including any datum shift parameters.
Also the TypeOfConversion will be inverted, i.e. a type of Proj2Geo will be changed to Geo2Proj and vice versa. | |
ResetDoDatumConversions |
Reset the DoDatumConversions flag to its default value.
| |
SetDatumShiftParameters(ReprojectorSide, Double, Double, Double) |
Sets the 3-parameter datum shift parameters of either the source or the target map projection.
This call will reset the BypassDatumConversions flag | |
SetDatumShiftParameters(ReprojectorSide, Double, Double, Double, Double, Double, Double, Double) |
Sets the 7-parameter datum shift parameters of either the source or the target map projection.
| |
SetNoDatumShift |
Disable datum shift calculations for either the source or the target.
This call will reset the BypassDatumConversions flag | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
// Projection strings are truncated due to their lenghts. string utm20NNad1927 = @"PROJCS[""NAD_1927_UTM_Zone_20N"", ... string utm20NWgs84 = @"PROJCS[""WGS_1984_UTM_Zone_20N"", ... // Create reprojector. Reprojector reprojector = new Reprojector(utm20NNad1927, utm20NWgs84); // Conversion from projection-to-projection coordinates, no height x = 35000; y = 6000000; reprojector.Convert(ref x, ref y); // Converting from projection-to-geographical coordiantes, including height reprojector.TypeOfConversion = Reprojector.ConversionType.Proj2Geo; x = 35000; y = 6000000; h = 100; reprojector.Convert(ref x, ref y, ref h);