ThinkGeo.com    |     Documentation    |     Premium Support

Plotting flight route in Spherical Mercator Projection

Hi,


I am finding problem in plotting flight route in spherical Mercator projection as shown in the first image .A straight line is appearing between NULUK and NANDY points which should not be appeared .

The same route when plotted using Great Circle ,the output is correct(no joining line between NULUK and NANDY points) as shown in the second image.

Please suggest me some solution to make this route appear as in Great circle route.

Thanks,
Silpa

Hi Silpa,

Without seeing what you were doing, it’s pretty difficult to pin it down.
Attached is a sample which show how to display flight route. Please check it out.
serviceseditionsample_rotateicon_cs_091031.zip (178.0 KB)

Also you can get it from Product Center, As shown below:

If it does not help, Could you give a code sample, or a complete project that duplicates the problem on a consistent basis?

Thanks,
Emil

Hi Emil,

Here I am taking a DataTable(as in uploaded image) ,which contains coordinates(lat long) of From(F_LON,F_LAT) and To points(T_LON,T_LAT) and joining these points using LINESTRING as shown in the below code.

for (int i = 0; i < dt.Rows.Count; i++)
{
    RectangleShape worldExtent = proj.ConvertToExternalProjection(new RectangleShape(-180, 90, 180, -90));
    Vertex vfrom, vto;

    vfrom = proj.ConvertToExternalProjection(Convert.ToDouble(dt.Rows[i]["FromLon"].ToString()), Convert.ToDouble(dt.Rows[l]["FromLat"].ToString()));
    vto = proj.ConvertToExternalProjection(Convert.ToDouble(dt.Rows[i]["ToLon"].ToString()), Convert.ToDouble(dt.Rows[i]["ToLat"].ToString()));
    
    PointShape pfrom = new PointShape(vfrom.X, vfrom.Y);
    PointShape pto = new PointShape(vto.X, vto.Y);

    Feature from = new Feature(pfrom);
    Feature to = new Feature(pto);
  
    im.InternalFeatures.Add(from);
    im.InternalFeatures.Add(to);
    Feature fline = new Feature("LINESTRING(" + pfrom.X + " " + pfrom.Y + "," + pto.X + " " + pto.Y + ")");
}
im.InternalFeatures.Add(fline);

The result was like in first image of my previous post.

Thanks,
Silpa.

Hi Silpa,

I found a sample which matches your requirements from Product Center.
Please check it out,
PacificRim.zip (1.7 MB)

But there are some difference between your usage scenarios and the sample, such as the base map(data and projection). If possible could you please upload a simple project to show us that and we can work based on it.

Thanks,
Emil