如何使用C#.new将lat long转换为印度网格引用 [英] How to convert lat long to indian grid reference using C# .new

查看:56
本文介绍了如何使用C#.new将lat long转换为印度网格引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我是shailendra vyas想要为印度1A区和0区转换lat long到印度网格参考(GR)。

示例:对于印度1A区

lat = 77.79669和

long = 31.53081

i知道gr将是

X = 3671296,Y = 08497759



另一个例子:对于印度1A区

lat = 78.60744和

long = 32.06581

和这个gr将是

X = 3741976,Y = 0916068



但我不知道公式和将使用的参数。

所以请帮助我。



谢谢。



我的尝试:



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);

推荐答案

转换长期到印度网格参考 - Google搜索 [ ^ ]


如果您不知道该怎么做,请从Google开始:将lat长到印度网格参考(GR)转换为Google搜索 [ ^ ](你肯定会注意到搜索字符串来自你自己的问题 - 所以你为什么不尝试呢?)



链接数量,所有解释如何做你想要的......



谷歌是你的朋友:好好经常拜访他。他可以比在这里发布问题更快地回答问题...

将来,请尝试自己做至少基础研究,不要浪费你的时间或我们的时间。
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.


这篇关于如何使用C#.new将lat long转换为印度网格引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆