Rough polyline to calculate sinuosity

Hi @karussell,
I’m trying to smooth the path by using a spline.
My idea is the following:

  1. get the set of coordinates of the polyline from Directions API
  2. set a spline to get more points by using interpolation
  3. convert the new set of points into a polyline

I know how to get a spline by a given array of points on a 2D space, but I don’t understand how to get a spline from a path formed by a set of geo coordinates like the one I get from Directions API.
You said that this is similar to what navigators do to get smooth paths.
Do you have some suggestions?