I am trying to use DotSpatial's ReprojectPoint code to transform between WGS84 and NAD83(2011). This done for some spatial validation (Comparing collected data to NGS Monument Data) project I am working on in my spare time.

When I use the ReprojectPoint method and create the output projection using the ProjectionInfo, the debugger always shows WGS84 for the output Projection when I would expect it show as NAD83.

Below is a small code snippet of where the error is taking place. All of the commented lines are failed attempts to set the outputProjection to NAD83 and each returns as a WGS84 projection.


Dim inputXY(2) As Double
inputXY(0) = inputLongitude
inputXY(1) = inputLatitude
Dim zValue() As Double = {0}

Dim proj4WGS84 As String = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
Dim proj4NAD83 As String = "+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs"

Dim wkidWGS84 As DotSpatial.Projections.ProjectionInfo = DotSpatial.Projections.ProjectionInfo.FromEsriString("GEOGCS[GCS_WGS_1984]")
Dim wkidNAD83 As DotSpatial.Projections.ProjectionInfo = DotSpatial.Projections.ProjectionInfo.FromEsriString("GEOGCS[GCS_North_American_1983,DATUM[D_North_American_1983,SPHEROID[GRS_1980,6378137,298.257222101]],PRIMEM[Greenwich,0],UNIT[Degree,0.017453292519943295]]")
'Dim wkidNAD83 As DotSpatial.Projections.ProjectionInfo = DotSpatial.Projections.ProjectionInfo.FromEsriString("GEOGCS[GCS_North_American_1983]")
'Dim wkidNAD83 As DotSpatial.Projections.ProjectionInfo = DotSpatial.Projections.ProjectionInfo.FromEpsgCode(4759)
'wkidNAD83 = DotSpatial.Projections.ProjectionInfo.FromProj4String(proj4NAD83)
'wkidNAD83 = DotSpatial.Projections.ProjectionInfo.FromEpsgCode("4269")

txtOutput.Text += "Input: " + inputXY(0).ToString + ", " + inputXY(1).ToString + vbCrLf
DotSpatial.Projections.Reproject.ReprojectPoints(inputXY, zValue, wkidWGS84, wkidNAD83, 0, 1)
txtOutput.Text += "Output: " + inputXY(0).ToString + ", " + inputXY(1).ToString + vbCrLf


You can see in the image below that the debugger is treating the wkidNAD83 variable as WGS84, regardless of what I have populated the ProjectionInfo with.

enter image description here

I understand that I am a novice programmer and GIS user, so please bear with me. What is causing this issue?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.