Dotspatial.Projections Gives NaN Results for WGS84 to Wyoming StatePlane Conversion

521 views Asked by At

I am having a basic problem using DotSpatial.Projections. I am simply trying to convert one point from Google's Geopgraphic CRS, used in Leaflet (EPSG Code: 3857), to US State Plane Wyoming East Central. I get back NaNs. Here is my simple code:

ProjectionInfo dest = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneWyomingEastCentralFIPS4902;
int googleEPSGCode = 3857;
ProjectionInfo src = ProjectionInfo.FromEpsgCode(googleEPSGCode);

double[] xy = { 43.265081, -106.17565155 };
double[] z = { 0 };
Reproject.ReprojectPoints(xy, z, src, dest, 0, 1);

The xy's are both NaN. Any ideas? I have also tried to use the Wyoming East Centreal EPSG code as well but it gives the same results.

1

There are 1 answers

0
Chris On

My bad. longitude needs to be entered as X and latitude as y in the xy[] array. I had them backwards. Now it throws the GridShift error because of NAD27, but that is another issue.