First, sorry if this questions sound very simple. I am very new to GIS.
Given four values of north/south latitude, east/west longitude how to calculate the center point that is correct for all cases on earth?
----------(north latitude)---------------
| |
| |
(west longitude)| ? (calculate this point) |(east longitude)
| |
| |
----------(south latitude) --------------
The dateline is an issue if you just use the following formula (N+S)/2 and (E+W)/2 to calculate the center.
atan2(y,x)computes an angle whose tangent isy/x(notx/y, as is found in some implementations); (3) in some casesλmmust be reduced modulo 360 degrees to lie between -180 and 180 degrees; (4) the formula is correct for the sphere; for an ellipsoid the relative error is good, but the absolute error can be considerable: see http://gis.stackexchange.com/questions/25494/how-accurate-is-approximating-the-earth-as-sphere/25580#25580 for an analysis. – whuber Mar 22 '13 at 15:16