Пример #1
0
        // 给定里程,计算经纬度朝向坐标
        public bool getGPSbyDKMileage(double m, out double x, out double y, out double z, out double dir, out double pitch)
        {
            double dis    = 0;
            bool   isFind = getLocalMileageByDKMileage(mDKCode, m, out dis);

            CSubLine.getGPSbyMileage(dis, meter, longitude, latitude, altitude, heading, out x, out y, out z, out dir, out pitch);
            return(isFind);
        }
Пример #2
0
        // 给定里程,计算经纬度朝向坐标
        private bool getGPSbyPathMileage(double m, out double x, out double y, out double z, out double dir, out double pitch)
        {
            return(CSubLine.getGPSbyMileage(m, mm, mx, my, mz, md, out x, out y, out z, out dir, out pitch));
            //bool flag = true;
            //int index;
            //x = y = z = 0; dir = 0;

            //if (m < 0.001)
            //{
            //    flag = false;
            //    index = 0;
            //    //x = mx[0];
            //    //y = my[0];
            //    //z = mz[0];
            //    //if (md != null)
            //    //    dir = md[0];
            //}
            //else if (m > mLength - 0.001)
            //{
            //    flag = false;
            //    index = mPointCount - 2;
            //    //x = mx[mPointCount - 1];
            //    //y = my[mPointCount - 1];
            //    //z = mz[mPointCount - 1];
            //    //if (md != null)
            //    //    dir = md[mPointCount - 1];
            //}
            //else
            //{
            //    flag = true;
            //    index = (int)(m / mStepM);


            //    if (index == mPointCount - 1)
            //    {
            //        index--;
            //        //x = mx[index];
            //        //y = my[index];
            //        //z = mz[index];
            //        //if (md != null)
            //        //    dir = md[index];
            //    }
            //}

            //// Important FIX,前面方法对于距离小于10米的最后一段计算错误
            //double t = (m - mm[index]) / (mm[index + 1] - mm[index]);
            //x = mx[index] * (1 - t) + mx[index + 1] * t;
            //y = my[index] * (1 - t) + my[index + 1] * t;
            //z = mz[index] * (1 - t) + mz[index + 1] * t;
            //if (md != null)
            //    dir = md[index] * (1 - t) + md[index + 1] * t;

            //return flag;
        }
Пример #3
0
        public bool getPierPosbyDKMileage(double m, out double x, out double y, out double z, out double dir, out double pitch)
        {
            double dis = 0;

            x = y = z = dir = pitch = 0;
            bool isFind = getLocalMileageByDKMileage(mDKCode, m, out dis);

            if (isFind)
            {
                if (mIsDouble)
                {
                    CSubLine.getGPSbyMileage(dis, meter, mOffsetX, mOffsetY, altitude, heading, out x, out y, out z, out dir, out pitch);
                }
                else
                {
                    CSubLine.getGPSbyMileage(dis, meter, longitude, latitude, altitude, heading, out x, out y, out z, out dir, out pitch);
                }
            }
            return(isFind);
        }