# Ticket #3426 (new feature)

## Accurate treatment of geodesics

Reported by: | karney | Owned by: | |
---|---|---|---|

Priority: | minor | Milestone: | 2.13 Release |

Component: | Util | Version: | 2.10 |

Keywords: | Geodesics | Cc: | |

State: |

### Description

OpenLayers 2.10 provides distVincenty and destinationVincenty which compute geodesics using Vincenty's method. However this method suffers from two problems:

* the distance calculation fails to converge from some pairs of points;

* where it converges the error is rather large (about 0.5mm).

OpenLayers also provides a function getGeodesicArea which is inaptly named because

* it treats only a sphere and not the ellipsoid;

* the edges of the polygon are not geodesics (or great circles) but rather straight lines on a cylindrical equal-area projection;

* the polygon cannot enclose a pole.

The attached patch adds distGeodesic, destinationGeodesic, and getTrueGeodesicArea which correct the problems noted about. These use the Javascript port of the geodesic functionality in GeographicLib. For a sample of the capabilities, see

GeographicLib also provides facilities which may be useful to OpenLayers in the future (for instance it can simplify finding the intersection of geodesics).

GeographicLib using the MIT/X11 license so you are free to incorporate it into OpenLayers.

## Attachments

## Change History

**Note:**See TracTickets for help on using tickets.