Calculate ellipse semi-axises from center point on Earth given distance

435 Views Asked by At

How would one calculate the vertices of an ellipse on the surface of the Earth given a center coordinate and a distance (in KM)? Since the distance between two points in the Y (Latitude) direction get closer as one approaches the poles, when generating a "buffer" around a point, the buffer becomes an ellipse and not a perfect circle. As such I need to calculate the semi-major and semi-minor axis values to determine the vertices.

Not sure of the formulas for such a task

1

There are 1 best solutions below

0
On

Calculating buffers on the Earth's surface is not as easy as it may seem. An accurate solution would involve equations like Vincenty's formulae.

That said, if you are willing to accept some inaccuracies, much simpler and less time-consuming formulae exist. For example, assuming your distances are fairly short, and not too close to a pole, you could simply use $\frac{s}{r{\text{ cos }}\phi}$ ($\phi =$ latitude, $s =$ buffer distance and $r =$ 6371 km) as a semi major-axis, and $s/r$ as a semi minor-axis, multiply these 2 results by $180/\pi$ and the resulting "ellipse" (analog to Tissot's indicatrix) on the lat-lon square grid (called plate carree equirectangular projection) would give you an approximation of the actual buffer, which could then be used to generate lat/lon coordinates for other vertices. It works fairly well for shorts distances (ex. a 5 km buffer typically gives an max error around 20 meters), however, for a distance of, say, 1000 km, the max error can be as large as several tens of km, and more if the buffer is close to the poles. The haversine and spherical trigonometry method is another way to solve the problem, with errors no larger than 0.5% for any length.

So the method to choose depends on your specific project / application. However, if you do need good accuracy, you might not want to program long formulae like Vincenty's. Some GIS programs like QGIS, ArcGIS already have those built-in algorithms that can generate geodesic buffers. Other solutions are available online, for example, with python here from which you could build with.