九色国产,午夜在线视频,新黄色网址,九九色综合,天天做夜夜做久久做狠狠,天天躁夜夜躁狠狠躁2021a,久久不卡一区二区三区

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
地理坐標(biāo)點(diǎn)距離近似計(jì)算

R=6378137;   (WGS84橢球)

P1_lat=30.4761442132609;
P1_lon=114.335983525027;
P2_lat=30.4792925569965;
P2_lon=114.343405206746;

p1_lat=P1_lat*pi/180;
p2_lat=P2_lat*pi/180;
p1_lon=P1_lon*pi/180;
p2_lon=P2_lon*pi/180;

dlat=p2_lat-p1_lat;
dlon=p2_lon-p1_lon;
a=sin(dlat/2)*sin(dlat/2)+cos(p1_lat)*cos(p2_lat)*sin(dlon/2)*sin(dlon/2);
c=2*asin(min(1,sqrt(a)));
d=R*c;
jcstone 2012年4月12
 
 
 
精度不夠,R的取值是問題
本方法中R為本地卯酉圈半徑N和子午圈半徑M的均值R=sqrt(M*N) 橢球?yàn)閃GS84橢球
精度不及轉(zhuǎn)為空間直角坐標(biāo)系坐標(biāo)距離計(jì)算
 
   
         #region 計(jì)算地理幾何坐標(biāo)點(diǎn)的距離
        /// <summary>
        /// 近似計(jì)算兩大地點(diǎn)的距離
        /// </summary>
        /// <param name="StartLocation"></param>
        /// <param name="EndLocation"></param>
        /// <returns></returns>
         public double MeasureDistance(Location StartLocation, Location EndLocation)
         {
             //double R =6371000;
             double R = new EarthEllipsoid(EarthSphereType.WGS1984).Sphere_LocalRadius(StartLocation);
             return MeasureDistance(StartLocation, EndLocation, R);
         }

        /// <summary>
         /// 近似計(jì)算兩大地點(diǎn)的距離
        /// </summary>
        /// <param name="StartLocation">起點(diǎn)</param>
        /// <param name="EndLocation">止點(diǎn)</param>
        /// <param name="R">本地地球曲率半徑</param>
        /// <returns>距離(米)</returns>
         public double MeasureDistance(Location StartLocation, Location EndLocation,double R)
         {          
             DegreeConvert Degreeconvert = new DegreeConvert();
             double startlat = Degreeconvert.ToRadianByDeg(StartLocation.Latitude);
             double endlat = Degreeconvert.ToRadianByDeg(EndLocation.Latitude);
             double dLat = Degreeconvert.ToRadianByDeg(EndLocation.Latitude - StartLocation.Latitude);
             double dLon = Degreeconvert.ToRadianByDeg(EndLocation.Longitude - StartLocation.Longitude);
             double a = Math.Sin(dLat / 2) * Math.Sin(dLat / 2) +
                 Math.Cos(startlat) * Math.Cos(endlat) *
                 Math.Sin(dLon / 2) * Math.Sin(dLon / 2);
             double c = 2 * Math.Asin(Math.Min(1, Math.Sqrt(a)));
             double d = R * c;
             return d;
         }

      
        /// <summary>
        /// 計(jì)算大地線(地理坐標(biāo)點(diǎn)集合)的距離
        /// </summary>
        /// <param name="locations"></param>
        /// <returns></returns>
         public double MeasureDistance(LocationCollection locations)
         {
             if (locations.Count < 2) return 0;
             Location center = GetCenterLocation(locations[0], locations[locations.Count - 1]);
             //本地地球平均曲率半徑
             double R = new EarthEllipsoid(EarthSphereType.WGS1984).Sphere_LocalRadius(center);
             //double R =6371000;
             double length = 0;
             for (int i = 0; i < locations.Count - 1; i++)
             {
                 length = length + MeasureDistance(locations[i], locations[i + 1],R);
             }
             return length;
           
         }
         #endregion
 
 
 
[0] = {30.4762317584019,114.337461116389,0}
[1] = {30.4772951042471,114.34328687437,0} 
 
采用上述算法近似計(jì)算 = 571.89291808016424
空間直角坐標(biāo)系 571.68532983587249
SQL2008 計(jì)算結(jié)果571.685330473182
 
 DECLARE @g geography;
DECLARE @h geography;
SET @g = geography::STGeomFromText('POINT(114.337461116389 30.4762317584019)', 4326);
SET @h = geography::STGeomFromText('POINT(114.34328687437 30.4772951042471)', 4326);
SELECT @g.STDistance(@h);
 
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
根據(jù)2個(gè)經(jīng)緯度點(diǎn),計(jì)算這2個(gè)經(jīng)緯度點(diǎn)之間的距離
根據(jù)兩點(diǎn)經(jīng)緯度計(jì)算距離
java gps distance
java 根據(jù)兩個(gè)位置的經(jīng)緯度,來計(jì)算兩地的距離 經(jīng)緯度處理
JAVA計(jì)算兩個(gè)經(jīng)緯度之間的距離
Web墨卡托坐標(biāo)與WGS84經(jīng)緯度互轉(zhuǎn) java代碼
更多類似文章 >>
生活服務(wù)
熱點(diǎn)新聞
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服