This project has moved. For the latest updates, please go here.

Great Circle

Topics: SharpMap v0.9 / v1.x, SharpMap v2.0, WinForms Controls
Apr 4, 2011 at 10:50 AM


I'm programming a GIS application in C# and I would like to draw an orthodromic curve (great circle) between two points on the map.

Does anybody know how to do that?

Thanks for your help.


Apr 4, 2011 at 10:57 AM
Edited Apr 4, 2011 at 10:58 AM

shouba, IMHO all you have to do is place intermediate points on your line, e.g. instead of

LINESTRING(-180 45 180 45)

you should use

LINESTRING(-180 45, -170 45, ... , 0 45, ..., 170 45, 180 45)

Now, depending on your CoordinateTransformation, your line should be rendered -more- correctly.

Hth FObermaier

Apr 4, 2011 at 11:15 AM

Hi FObermaier.

Thanks for your quick answer. But how can I calculate these intermediate points?


Apr 4, 2011 at 11:21 AM


I just find something that might help on

Intermediate points on a great circle

In previous sections we have found intermediate points on a great circle given either the crossing latitude or longitude. Here we find points (lat,lon) a given fraction of the distance (d) between them. Suppose the starting point is (lat1,lon1) and the final point (lat2,lon2) and we want the point a fraction f along the great circle route. f=0 is point 1. f=1 is point 2. The two points cannot be antipodal ( i.e. lat1+lat2=0 and abs(lon1-lon2)=pi) because then the route is undefined. The intermediate latitude and longitude is then given by:

        x = A*cos(lat1)*cos(lon1) +  B*cos(lat2)*cos(lon2)
        y = A*cos(lat1)*sin(lon1) +  B*cos(lat2)*sin(lon2)
        z = A*sin(lat1)           +  B*sin(lat2)
I'll try and tell if it works.
Apr 5, 2011 at 9:37 AM


Ok, it works. You have just to convert lat1,lat2,lon1,long2 in radian before the calculation and in the end to convert lat,lon to degree.