/// <summary>
        /// Check turnNode Format and input to _prop_Nearby
        /// </summary>
        /// <param name="input"></param>
        /// <returns>IF Wrong Format return null</returns>
        public _prop_Nearby CheckFormat(string input)
        {
            try
            {
                _prop_Nearby _par = new _prop_Nearby();

                string[] node = input.Split('|');

                for (int i = 0; i < node.Length; i++)
                {
                    string[] tmp_node = node[i].Split(',');
                    if (tmp_node.Length != 2)
                    {
                        return(null);
                    }

                    double tmp_lat  = Convert.ToDouble(tmp_node[0]);
                    double tmp_lon  = Convert.ToDouble(tmp_node[1]);
                    int    tmp_flag = Convert.ToInt32(tmp_node[2]);

                    _par.lat.Add(tmp_lat);
                    _par.lon.Add(tmp_lon);
                    _par.flag.Add(tmp_flag);
                }

                return(_par);
            }
            catch { return(null); }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public _prop_Nearby CreateAllPolygon(_prop_Nearby input)
        {
            double sumOfDis = 0;
            double disPoint = BUFFER * 1000;


            for (int i = 0; i < input.lat.Count - 1; i++)
            {
                if (input.flag[i] != 0)
                {
                    continue;
                }

                double tmp_dis = Distance(input.lat[i], input.lon[i], input.lat[i + 1], input.lon[i + 1]);
                sumOfDis += tmp_dis;

                double tmp_bearing = Bearing(input.lat[i], input.lon[i], input.lat[i + 1], input.lon[i + 1]);

                double tmp_BR = BearingRight(tmp_bearing);
                double tmp_BL = BearingLeft(tmp_bearing);

                double[] pointStartLeft  = AnotherPoint(input.lat[i], input.lon[i], tmp_BL, disPoint);
                double[] pointStartRight = AnotherPoint(input.lat[i], input.lon[i], tmp_BR, disPoint);

                double[] pointEndLeft  = AnotherPoint(input.lat[i + 1], input.lon[i + 1], tmp_BL, disPoint);
                double[] pointEndRight = AnotherPoint(input.lat[i + 1], input.lon[i + 1], tmp_BR, disPoint);
                if (i + 1 != input.lat.Count)
                {
                    pointEndLeft  = AnotherPoint(pointEndLeft[0], pointEndLeft[1], tmp_bearing, disPoint);
                    pointEndRight = AnotherPoint(pointEndRight[0], pointEndRight[1], tmp_bearing, disPoint);
                }

                string tmp = PolygonFormat(pointStartLeft, pointStartRight, pointEndLeft, pointEndRight);
                input.Polygon.Add(tmp);

                if (sumOfDis >= LIMIT_DIS)
                {
                    break;
                }
            }


            return(input);
        }
        public _prop_Nearby Format(_prop_Nearby input, string turnNode)
        {
            try
            {
                string[] tmpAll = turnNode.Split('|');

                for (int i = 0; i < tmpAll.Length; i++)
                {
                    string[] tmpnode = tmpAll[i].Split(',');

                    input.lat.Add(Convert.ToDouble(tmpnode[0]));
                    input.lon.Add(Convert.ToDouble(tmpnode[1]));

                    input.flag.Add(Convert.ToInt32(tmpnode[2]));
                }

                if (input.buffer < 0)
                {
                    return(null);
                }
                else if (input.buffer > BUFFER_MAX)
                {
                    BUFFER = BUFFER_MAX;
                }
                else if (input.buffer < BUFFER_MIN)
                {
                    BUFFER = BUFFER_MIN;
                }
                else
                {
                    BUFFER = input.buffer;
                }

                return(input);
            }
            catch
            { return(null); }
        }