2
$\begingroup$

i have a list of GEO x,y,x coordinates and using Justin Mooney's R Script to convert to latitude, longitude, altitude(km). I'm looking for some test case numbers to verify Justin's xyz2lla function and to verify my R Script. Does anyone have some good x,y, z, set of numbers to test this algorithm?

$\endgroup$
2
$\begingroup$

There are multiple reference ellipsoids for the Earth. Given a latitude, longitude, and altitude, the corresponding ECEF cartesian coordinates will differ with different ellipsoids. The reverse is also true. There is no clear cut answer to this question because you didn't specify which reference ellipsoid Justin Mooney's script uses.

That said, the conversion from geodetic latitude, longitude, and altitude to cartesian is rather straightforward. The only possible issue would be how one handles garbage altitude values such as -12000 kilometers. Otherwise, it's three equations with no recursion.

So use this fact: Make up your own test cases. Generate some cartesian coordinates using these simple equations, making sure to use the same reference ellipsoid. Then check how well the inverse function recovers the known latitude, longitude, and altitude values. With the exception of the poles (where longitude is indeterminate), and with the exception of nonsense altitudes that drill to the other side of the Earth, the answer is unique.

Since the poles are singularities, it would be a good idea to have test cases at or near the poles. Since nonsense altitudes are problematic, it might be a good idea to have some test cases that involve large negative altitudes. The code should recover a sensible set of values that differ from the nonsense altitude (and the latitude and longitude should also be markedly different). Finally, hit his code with the center of the Earth, x=y=z=0.

| improve this answer | |
$\endgroup$

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.