How do you use the interpolate using surface distance function?

I’m getting some very strange results trying to use the interpolateUsingSurfaceDistance method. Basically, my thesis goes something like this:

If I set start and end to cartographic coordinates that share the same latitude, then any result I obtain from interpolateUsingSurfaceDistance should also share that latitude.

If I set start and end to cartographic coordinates that share the same longitude, then any result I obtain from interpolateUsingSurfaceDistance should also share that longitude.

If I set the distance to 0, then the result I obtain from interpolateUsingSurfaceDistance should basically be identical to the start point.

None of this seems to hold true for me using the Sandcastlle as a playground with this code.

Where am I going awry here? As an aside, nowhere in the documentation does it say what units should be used for the distance argument, but I assume it’s meters. None of my assertions above really depend on the answer to that. You can see in the console output that none of the results bear a resemblance to the original start latitude or longitude. Am I doing something dumb?

Ahhh latitude, longitude in Radians not degrees was my problem here.

@vicatcu

Welcome to the community :rocket: :grin:

Thank you very much for taking the time to write a detailed forum post. I am glad that you were able to resolve your issue!

-Sam

1 Like