0

Given GPS data that consists of:

  1. Latitude
  2. Longitude
  3. Bearing (degrees)
  4. Speed (meters per second)
  5. Accuracy (radius of the circle around the coordinate where true position can be found with 68% chance, the radius is in meters)
  6. Bearing accuracy (degrees)
  7. Speed accuracy (meters) (All accuracies are absolute)

I want to calculate the next possible coordinate where I supposedly be if I continue traveling in the same direction with the same speed.

In addition I want to know the accuracy of the calculated position.

Here is the code of the next coordinate calculation.

function calcNextPosRad(
  currentLatRad: number,
  currentLonRad: number,
  bearingRad: number,
  speed: number,
): { latRad: number; longRad: number } {
  // Constants for WGS84 ellipsoid
  const a = 6378137; // Semi-major axis
  const f = 1 / 298.257223563; // Flattening
  const b = a * (1 - f);

  // Calculate the reduced latitude
  const reducedLatRad = Math.atan((1 - f) * Math.tan(currentLatRad));

  const meterLatRad = Math.cos(bearingRad) / (b + reducedLatRad);
  const meterLonRad = Math.sin(bearingRad) / (a * Math.cos(reducedLatRad));

  return {
    latRad: currentLatRad + speed * meterLatRad,
    longRad: currentLonRad + speed * meterLonRad,
  };
}

This code seems to be accurate and the reason for that is that I have a set of coordinates taken with interval of 1 second.

On this picture start of each green arrow is the measured coordinate, and the end is the calculated next possible position, so it kinda shows where I truly could be. (reddish circles are the accuracy of the coordinate given by GPS). enter image description here

So the task I'm having troubles with is how do I calculate the accuracy of a calculated coordinate? There's accuracy of the original coordinate, accuracy of the bearing and speed, and it looks like all these accuracies should be taken into consideration during final accuracy calculations.

Here are some questions I have:

  1. The original latitude, longitude and bearing are in degrees, and I translate them into radians before feeding to the function. Do I need to propagate respective accuracies through these conversions?
  2. Since a coordinate consists of two values in degrees, but its accuracy is in meters (as given by GPS), do I need to convert the accuracy to propagate it? If so, what's the algorithm?
  3. Do I need to propagate the accuracy through every calculation? Including calculation of the reducedLatRad ?
2
  • 1
    Generally it's supposed to be one question per question, please read the site rules. You'll want to smooth your trend line (spline), something like an SBET, that will give you a better estimate of the actual bearing. Commented Jun 6, 2023 at 6:05
  • The question is kind of one (in the title) but it can be split into separate subquestions which share common context, so instead of creating 3 separate questions with repeated content I've split them. Does it make sense? As for the bearing smoothing - I'll work on it after I finally figure out how to estimate the predicted coordinate accuracy, as I can't proceed without it. Commented Jun 6, 2023 at 7:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.