Beispiel #1
0
 /// <summary>
 /// 获取第二条线路的一部分,复线-中线。单线-线杆
 /// </summary>
 /// <param name="startm"></param>
 /// <param name="endm"></param>
 /// <param name="stepm"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="includeLastPoint"></param>
 /// <returns></returns>
 public int getSubLine2ByDKMileage(double startm, double endm, double stepm, out double[] x, out double[] y, bool includeLastPoint = false)
 {
     double[] z, d, m;
     getLocalMileageByDKMileage(this.mDKCode, startm, out startm);
     getLocalMileageByDKMileage(this.mDKCode, endm, out endm);
     return(CSubLine.getSubLineByMileage(startm, endm, stepm, meter, mOffsetX, mOffsetY, altitude, heading, out m, out x, out y, out z, out d, includeLastPoint));
 }
Beispiel #2
0
        /// <summary>
        /// 获取中线,根据 pathNode 0判断单线复线,
        /// </summary>
        /// <param name="ml"></param>
        /// <param name="xl"></param>
        /// <param name="yl"></param>
        /// <param name="zl"></param>
        /// <param name="dl"></param>
        /// <returns></returns>
        public bool getContactLine(out double[] x, out double[] y, out double[] z,
                                   out double[] x2, out double[] y2, out double[] z2)
        {
            double[] m, m2, dir, dir2;
            m  = x = y = z = dir = null;
            m2 = x2 = y2 = z2 = dir2 = null;

            List <PathNode> ls = mPathNodeList; //getSubPath(startDKCode, startMileage, endDKCode, endMileage);

            if (ls == null || ls.Count == 0)
            {
                return(false);
            }
            //int totalCount = 0;
            // 如果是单线,接触网为中线,如果是复线,接触网为左线
            CSubLine.getSubLineByMileage(0, mLength, 50, mm, mx, my, mz, md, out m, out x, out y, out z, out dir);
            if (ls[0].mRL.mIsDouble)
            {
                // 复线,求另一个接触网
                CSubLine.getOffsetLineByMileage(0, mLength, 50, mm, mx, my, mz, md, moff, mxoff, myoff, moff * 2, out m2, out x2, out y2, out z2, out dir2, true);
                return(true);
            }

            //CSubLine.getSubLineByMileage(0, mLength, mStepM, mm, mx, my, mz, md, out ml, out xl, out yl, out zl, out dl, true);
            return(false);
        }
Beispiel #3
0
        /// <summary>
        /// 如果复线,返回两条接触网线,如果单线,返回一条
        /// </summary>
        /// <param name="m"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="z"></param>
        /// <param name="dir"></param>
        /// <param name="m2"></param>
        /// <param name="x2"></param>
        /// <param name="y2"></param>
        /// <param name="z2"></param>
        /// <param name="dir2"></param>
        /// <returns></returns>
        public bool getContactLineByMileage(out double[] m, out double[] x, out double[] y, out double[] z, out double[] dir,
                                            out double[] m2, out double[] x2, out double[] y2, out double[] z2, out double[] dir2)
        {
            m  = x = y = z = dir = null;
            m2 = x2 = y2 = z2 = dir2 = null;
            CSubLine.getSubLineByMileage(0, Math.Abs(mEnd - mStart), 50, meter, longitude, latitude, altitude, heading, out m, out x, out y, out z, out dir);

            if (mIsDouble)
            {
                CSubLine.getOffsetLineByMileage(0, Math.Abs(mEnd - mStart), 50, meter, longitude, latitude, altitude, heading, mOffset, mOffsetX, mOffsetY, mOffset * 2,
                                                out m2, out x2, out y2, out z2, out dir2, false);
            }

            return(mIsDouble);
        }
Beispiel #4
0
        /// <summary>
        /// 重采样,根据起始里程,获取距离为dis的子路径
        /// </summary>
        /// <param name="fromdkcode"></param>
        /// <param name="frommileage"></param>
        /// <param name="dis"></param>
        /// <param name="stepm"></param>
        /// <param name="mils"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="z"></param>
        /// <param name="dir"></param>
        /// <returns></returns>
        public int getSubLineByDKCode(string fromdkcode, double frommileage, double dis, double stepm, out double[] mils, out double[] x, out double[] y, out double[] z, out double[] dir)
        {
            mils = x = y = z = dir = null;
            double m = getPathMileageByDKCode(fromdkcode, frommileage);

            return(CSubLine.getSubLineByMileage(m, m + dis, stepm, mm, mx, my, mz, md, out mils, out x, out y, out z, out dir));
            //double m1, m2;
            //if (dis > 0)
            //{
            //    m1 = m;
            //    m2 = m + dis;
            //}
            //else
            //{
            //    m1 = m + dis;
            //    m2 = m;
            //}
            //m1 = Math.Max(m1, 0);
            //m2 = Math.Min(m2, mLength);

            //dis = m2 - m1;
            ////double dir;
            //stepm = Math.Min(1,Math.Abs(stepm));

            //int count = (int)((dis - 0.05) / stepm) + 1;
            //// 保证count至少为2
            //if (dis < stepm * 2)
            //    count = 2;

            //mils = new double[count];
            //x = new double[count];
            //y = new double[count];
            //z = new double[count];
            //dir = new double[count];
            //double temp;

            //m = m1;
            //for (int i = 0; i < count - 1; i++)
            //{
            //    mils[i] = m;
            //    getGPSbyPathMileage(m, out x[i], out y[i], out z[i], out dir[i],out temp);
            //    m += stepm;
            //}
            //mils[count - 1] = m2;
            //getGPSbyPathMileage(m2, out x[count - 1], out y[count - 1], out z[count - 1], out dir[count - 1],out temp);

            //return count;
        }
Beispiel #5
0
        public int getMiddleLineByDKMileage(double startm, double endm, double stepm, out double[] mileage, out double[] x, out double[] y, out double[] z, out double[] dir, bool includeLastPoint = false)
        {
            getLocalMileageByDKMileage(this.mDKCode, startm, out startm);
            getLocalMileageByDKMileage(this.mDKCode, endm, out endm);

            if (mIsDouble)
            {
                return(CSubLine.getSubLineByMileage(startm, endm, stepm, meter, mOffsetX, mOffsetY, altitude, heading, out mileage, out x, out y, out z, out dir, includeLastPoint));
            }
            else
            {
                return(CSubLine.getSubLineByMileage(startm, endm, stepm, meter, longitude, latitude, altitude, heading, out mileage, out x, out y, out z, out dir, includeLastPoint));
            }
            //z = altitude;
            //dir = heading;
        }
Beispiel #6
0
        /// <summary>
        /// 获取中线,根据 pathNode 0判断单线复线,
        /// </summary>
        /// <param name="ml"></param>
        /// <param name="xl"></param>
        /// <param name="yl"></param>
        /// <param name="zl"></param>
        /// <param name="dl"></param>
        /// <returns></returns>
        public bool getMiddleLine(out double[] ml, out double[] xl, out double[] yl, out double[] zl, out double[] dl)
        {
            //bool isDoubleLine = false;
            xl = yl = zl = dl = ml = null;

            List <PathNode> ls = mPathNodeList; //getSubPath(startDKCode, startMileage, endDKCode, endMileage);

            if (ls == null || ls.Count == 0)
            {
                return(false);
            }
            //int totalCount = 0;
            if (ls[0].mRL.mIsDouble)
            {
                CSubLine.getSubLineByMileage(0, mLength, mStepM, mm, mxoff, myoff, mz, md, out ml, out xl, out yl, out zl, out dl, true);
                return(true);
            }

            CSubLine.getSubLineByMileage(0, mLength, mStepM, mm, mx, my, mz, md, out ml, out xl, out yl, out zl, out dl, true);
            return(false);
        }
Beispiel #7
0
 // 左线向右为正方向
 //
 // 获取线路的一部分,输入参数,起始终止里程与采样间隔, 输出参数,线路上的经纬高度坐标数组,最后一段大于等于stepm,避免出现过小的数值
 // stepm必须大于等于1米,includeLast 是否包含最后一个点
 //
 public int getSubLineByDKMileage(double startm, double endm, double stepm, out double[] mileage, out double[] x, out double[] y, out double[] z, out double[] dir, bool includeLastPoint = false)
 {
     getLocalMileageByDKMileage(this.mDKCode, startm, out startm);
     getLocalMileageByDKMileage(this.mDKCode, endm, out endm);
     return(CSubLine.getSubLineByMileage(startm, endm, stepm, meter, longitude, latitude, altitude, heading, out mileage, out x, out y, out z, out dir, includeLastPoint));
 }
Beispiel #8
0
 public void getSubLinebyPathMileage(double startm, double endm, double stepm, out double[] dm, out double[] dx, out double[] dy, out double[] dz, out double[] dd)
 {
     CSubLine.getSubLineByMileage(startm, endm, stepm, mm, mx, my, mz, md, out dm, out dx, out dy, out dz, out dd, true);
 }