Reprojection Help

Jun 2, 2015 at 5:20 AM
Edited Jun 2, 2015 at 5:20 AM
Hello

I am trying to move a reprojection function that works today in Blue Marble GeoCalc into DotSpatial, but am having issues getting the correct projection outputs.

For example, when I use the following sample data as inputs:
X = 34249.40992
Y = 5934666.09792

I get the following from the conversion:
GeoCalc:
X = -113.483291571217
Y = 53.5437529921101

DotSpatial
X = -113.483408165233
Y = 53.5384205905225

I am a real noob at this, so please excuse if I have made some rookie mistake :) I have included the code from the old GeoCalc and the new DotSpatial conversions. Any assistance would be great, thanks in advance.

Existing GeoCalc code:
        Dim outputX As Double
        Dim outputY As Double
        Dim inputX As Double
        Dim inputY As Double

        Dim inuptProj As New GlobalMapperInterface.GM_Projection_t
        Dim outputProj As New GlobalMapperInterface.GM_Projection_t

        inuptProj.mProjSys = ProjectionTypes.PROJSYS.GM_PRJ_TM
        inuptProj.mUnit = ProjectionTypes.UNIT.GM_PRJ_UNIT_METERS
        inuptProj.mDatum = ProjectionTypes.DATUM.GM_DATUM_WGS_84

        inuptProj.mNumAttrs = 2
        inuptProj.mAttrVal1.mAttr = ProjectionTypes.PROJATTR.CENTRAL_MERIDIAN_SCALE_FACTOR
        inuptProj.mAttrVal1.mValue = 0.9999

        inuptProj.mAttrVal2.mAttr = ProjectionTypes.PROJATTR.CENTRAL_MERIDIAN
        inuptProj.mAttrVal2.mValue = -114.0

        outputProj.mProjSys = ProjectionTypes.PROJSYS.GM_PRJ_GEO
        outputProj.mUnit = ProjectionTypes.UNIT.GM_PRJ_UNIT_ARC_DEGREES
        outputProj.mDatum = ProjectionTypes.DATUM.GM_DATUM_WGS_84

        result = GlobalMapperInterface.GM_ProjectPoint(inputX _
                                                    , inputY _
                                                    , outputX _
                                                    , outputY _
                                                    , inuptProj _
                                                    , outputProj)
New DotSpatial code:
double[] xy = new double[2];
            xy[0] = inputX;
            xy[1] = inputY;
            double[] z = new double[1];
            z[0] = 1;
            ProjectionInfo pStart = KnownCoordinateSystems.Projected.TransverseMercator.WGS1984lo33;
            pStart.ScaleFactor = 0.9999;
            pStart.CentralMeridian = -114.0;
            
            ProjectionInfo pEnd = KnownCoordinateSystems.Geographic.World.WGS1984;
            Reproject.ReprojectPoints(xy, z, pStart, pEnd, 0, 1);