Click here to Skip to main content
14,426,402 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello
I am shailendra vyas wants to convert lat long to indian grid reference (GR) for India Zone 1A and Zone 0.
Example: For India Zone 1A
lat = 77.79669 and
long = 31.53081
i know the gr will be
X=3671296 , Y=08497759

same another example:For India Zone 1A
lat = 78.60744 and
long = 32.06581
and for this gr will be
X=3741976 , Y=0916068

but i don't know the formula and what parameter will used.
so please help me.

Thank you.

What I have tried:

double Lts = Convert.ToDouble(Lts11);
            double Los = Convert.ToDouble(Los11);
            double inverse_flattening = 300.8017255;
            double num5 = 6377276.345;
            double scale_factor = 1.0;
            double central_meridian = 68.0;
            double latt_of_origin = 32.50;
            double num10 = 2743285.8;//False Easting
            double num11 = 914395.5;//False northing
            double flattening = 1 / inverse_flattening;
            double num8 = 0.40648718;//1st st. parallel
            double num9 = 0.50073496;//2nd st. parallel
            double num7 = central_meridian * Math.PI / 180.0;
            double a2 = latt_of_origin * Math.PI / 180.0;
            double num6 = Math.Sqrt((2.0 * flattening) - (flattening * flattening));
           
            double a1 = Lts * Math.PI / 180.0;
            double num4 = Los * Math.PI / 180.0;
            double a3 = Math.Cos(num8) / Math.Sqrt(1.0 - num6 * num6 * Math.Sin(num8) * Math.Sin(num8));
            double a4 = Math.Cos(num9) / Math.Sqrt(1.0 - num6 * num6 * Math.Sin(num9) * Math.Sin(num9));
            double num12 = Math.Tan(Math.PI / 4.0 - num8 / 2.0) / Math.Pow((1.0 - num6 * Math.Sin(num8)) / (1.0 + num6 * Math.Sin(num8)), num6 / 2.0);
            double a5 = Math.Tan(Math.PI / 4.0 - num9 / 2.0) / Math.Pow((1.0 - num6 * Math.Sin(num9)) / (1.0 + num6 * Math.Sin(num9)), num6 / 2.0);
            double x1 = Math.Tan(Math.PI / 4.0 - a1 / 2.0) / Math.Pow((1.0 - num6 * Math.Sin(a1)) / (1.0 + num6 * Math.Sin(a1)), num6 / 2.0);
            double x2 = Math.Tan(Math.PI / 4.0 - a2 / 2.0) / Math.Pow((1.0 - num6 * Math.Sin(a2)) / (1.0 + num6 * Math.Sin(a2)), num6 / 2.0);
            double y = (Math.Log(a3) - Math.Log(a4)) / (Math.Log(num12) - Math.Log(a5));
            double num13 = a3 / (y * Math.Pow(num12, y));
            double num14 = num5 * num13 * Math.Pow(x1, y);
            double num15 = num5 * num13 * Math.Pow(x2, y);
            double num16 = y * (num4 - num7);
            Int64 temp_gr_x = Convert.ToInt64(num10 + (num14 * Math.Sin(num16)));
            Int64 temp_gr_y = Convert.ToInt64(num11 + num15 - (num14 * Math.Cos(num16)));
            temp_gr_x = Convert.ToInt64(temp_gr_x * scale_factor);
            temp_gr_y = Convert.ToInt64(temp_gr_y * scale_factor);
Posted
Updated 12-Dec-18 23:16pm
Rate this:
Please Sign up or sign in to vote.

Solution 2

If you don't know how to do something, start with Google: convert lat long to indian grid reference (GR) for India Zone 1A and Zone 0 - Google Search[^] (You will no doubt notice that the search string was taken from your own question - so why didn't you try it?)

Loads of links, all explaining how to do exactly what you want...

Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here ...
In future, please try to do at least basic research yourself, and not waste your time or ours.
   
Comments
Member 10652631 13-Dec-18 6:32am
   
Thanks for reply
After searching many sites i have post this query because
i am not getting
double num8 = 0.40648718;//1st st. parallel
double num9 = 0.50073496;//2nd st. parallel
this 2 variable's exact value on any site.
and when i changed this two values in my code then they reflect much changes in final answer and right answer not getting.
so if you find exact value then please provide me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100