If you want a stable method of computing geodesic distances, I recommend Richie Carmichael's wrapper for ESRI's Projection Engine.
Update: I just tried Richie's code with ArcGIS 10.0 on Vista64 and get an exception after calling LoadLibrary
. I'll look into that more later.
For now though, here is some code in response to questions in the comments of another answer.
The code compares IProximityOperator for points with and without spatial references. Then it shows how to use an azimuthal equidistant projection (with first point being the point of tangency) to find the great circle distance.
private void Test()
{
IPoint p1 = new PointClass();
p1.PutCoords(-98.0, 28.0);
IPoint p2 = new PointClass();
p2.PutCoords(-78.0, 28.0);
Debug.Print("Euclidian Distance {0}", EuclidianDistance(p1, p2));
Debug.Print("Distance with no spatialref {0}", GetDistance(p1, p2));
ISpatialReferenceFactory srf = new SpatialReferenceEnvironmentClass();
IGeographicCoordinateSystem gcs =
srf.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
p1.SpatialReference = gcs;
p2.SpatialReference = gcs;
Debug.Print("Distance with spatialref {0}", GetDistance(p1, p2));
Debug.Print("Great Circle Distance {0}", GreatCircleDist(p1, p2));
}
private double GetDistance(IPoint p1, IPoint p2)
{
return ((IProximityOperator)p1).ReturnDistance(p2);
}
private double EuclidianDistance(IPoint p1, IPoint p2)
{
return Math.Sqrt(Math.Pow((p2.X - p1.X),2.0) + Math.Pow((p2.Y - p1.Y), 2.0));
}
private double GreatCircleDist(IPoint p1, IPoint p2)
{
ISpatialReferenceFactory srf = new SpatialReferenceEnvironmentClass();
IProjectedCoordinateSystem pcs =
srf.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_WGS1984N_PoleAziEqui);
pcs.set_CentralMeridian(true, p1.X);
((IProjectedCoordinateSystem2)pcs).LatitudeOfOrigin = p1.Y;
p1.SpatialReference = pcs.GeographicCoordinateSystem;
p1.Project(pcs);
p2.SpatialReference = pcs.GeographicCoordinateSystem;
p2.Project(pcs);
return EuclidianDistance(p1, p2);
}
Here's the output:
Euclidian Distance 20
Distance with no spatialref 20
Distance with spatialref 20
Great Circle Distance 1965015.61318737
I think it would be interesting to test this against the projection engine dll (pe.dll). Will post results if I ever get Richie's code to work.
Update:
Once I changed Richies code to compile for x86, I got it to run. Interesting ... the great circle distance it give me is 1960273.80162999 - a significant difference from that returned from the azimuthal equidistant method above.
A good guide and illustration into the process of Aerial Photography and Calibrating them to be correctly orthorectified
http://www.nrcan.gc.ca/earth-sciences/products-services/satellite-photography-imagery/aerial-photos/about-aerial-photography/891
Fiducial marks: small registration marks exposed on the edges of a photograph. The distances between fiducial marks are precisely measured when a camera is calibrated, and this information is used by cartographers when compiling a topographic map.
Overlap: is the amount by which one photograph includes the area covered by another photograph, and is expressed as a percentage. The photo survey is designed to acquire 60 per cent forward overlap (between photos along the same flight line) and 30 per cent lateral overlap (between photos on adjacent flight lines).
(and remember aircraft pitch and roll even when weather conditions are perfect for flying for aerial imagery capture.)
Some new high tech planes take lidar at the exact same time as the digital photo - which can be used to correct some errors.
Best Answer
it depends on your tolerance to errors.
In most cases you can compute distances with enough precision when you work in a local projected coordinate system on a "small" regions (for instance, computing the shortest route for a car in a city). Accross China, you are no more in a local projected coordinate system, so the errors could be quite large.
Then, of cours, the geodetic distance (based on Vincenty's formula) is the "reference" distance for shortest path if you go straigth from A to B without obstacles, and it is not "that" slow to compute it with modern computers. But in Distance measurements across UTM zones: use geographic or planar approaches? , you can also see that a sinusoidal projection remains quite good approximation in most cases. And if you have a central point from which all distances are computed, then it would be accurate to use an azimuthal equidistant projection.
Finally, ask yourself what would be the largest source of errors to get the full picture of accuracy, e.g.
planes don't use the shortest distance but have several constraints to take into account, and the most important is the wind
most vehicles don't use the shortest distance but follow the road, rails etc.
if you climb a mountain, the real distance can sometimes be more effected by the slope than the distortions of the 2D projection