2

I'm nota GIS guy so I need some help. I need to reproject from one SRID to another. I'm trying to take global lat/longs (4326), reproject them to a local SRID (2336). This is basically the line of code I'm using. I keep getting back NaN. I've tried reversing the lat/long. Should I be using a different Z value? What am I doing wrong?

DotSpatial.Projections.Reproject.ReprojectPoints(
    new[] { 29.4660863, -81.25784159999999 },
    new[] { 0d },
    ProjectionInfo.FromEpsgCode(4326),
    ProjectionInfo.FromEpsgCode(2336),
    0,
    1);
  • 1
    You've got the wrong SRID. EPSG:2336 is in China. You probably want 2236, NAD83 / Florida East (ftUS). – mkennedy May 2 '18 at 15:31
  • It's always something stupid like that isn't it? Thank you so much @mkennedy – Doug May 2 '18 at 15:41
1

The input is in the form longitude, latitude.

Keep in mind that the reprojection is done "in place", meaning that the input coordinates are replaced by the output coordinates. Since you are constructing a new variable to hold the input, the output will not be available.

Private inputOutputXY(2) As Double
inputOutputXY(0) = -81.25784159999999
inputOutputXY(1) = 29.4660863
Dim z() As Double = {0D}

DotSpatial.Projections.Reproject.ReprojectPoints(inputOutputXY, z, inputProj, outputProj, 0, 1)

'read inputOutputXY to print the new coordinates
  • Ok, I've checked that I have long first, then lat. And I'm also checking the values of the variable passed into the method, and those are coming back as NaN. Here's a Screenshot – Doug May 2 '18 at 14:50
0

As mkennedy pointed out, I mistyped the SRID in the "projected to". Should be 2236, not 2336.

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – Dan C May 2 '18 at 17:07
  • @DanC - how does this not answer the question? I was getting the NaN error because I was trying to reproject to the wrong SRID. Once I corrected that it worked. It was a type on my part. – Doug May 3 '18 at 17:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.