Use GeographicLib functions for ST_Azimuth, ST_Distance, ST_Project, ST_Length, ST_Perimeter and ST_Area
|Reported by:||Mike Taves||Owned by:||pramsey|
I've been testing the direct and inverse functions in geodesic.h, and they look pretty good! This stand-alone C library which is detachable from GeographicLib was recently published by Karney (2013) with an MIT/X11 License. The peer-reviewed algorithms are "accurate, robust, and fast solutions to the direct and inverse geodesic problems".
The attached patch is only a start, with a
USE_GEODESIC def at the top of
lwspheroid.c to toggle the library's use, or the existing library use. Yet to come are more regression tests, speed testing (I'd like help here), and any related discussion on if this is a good idea. Also, there are polygon area functions that I'll look at further only if things are looking good.
The library is actually really easy to use. All angular units are in degrees, and linear units are in metres.
geod_inverse: takes two points, and returns the forward and reverse azimuths (these are different!), and the distance between the two points. Used in
geod_direct: takes a point, a forward azimuth, and distance, and returns the second point and the reverse azimuth. Used in
Although I haven't written the extra regression tests yet, the library solves #2913 for inverse solutions to near-antipodal points.
The patch passes all of the existing regression tickets.
Patch source at GitHub pull request:
Change History (28)
comment:19 by , 9 years ago
|Summary:||Use GeographicLib functions for ST_Azimuth, ST_Distance and ST_Project → Use GeographicLib functions for ST_Azimuth, ST_Distance, ST_Project, ST_Length, ST_Perimeter and ST_Area|