Пример #1
0
        static void Main(string[] args)
        {
            string string_MP = "1010";
            double double_MP;

            //#1 Try to parse the string
            bool double_parse_worked = System.Double.TryParse(string_MP, out double_MP);

            if (double_parse_worked)
            {
                //#2 Create the locator on line 1
                Enbridge.LinearReferencing.ContLineLocatorSQL loc;

                //#3 run the locator
                loc = new Enbridge.LinearReferencing.ContLineLocatorSQL("{D4D4472B-FB1E-485B-A550-DCE76F63BC08}");

                double stn, meas, X, Y, Z;
                stn = loc.getStnFromMP(double_MP, out meas, out X, out Y, out Z);
                Console.WriteLine("{0} {1} {2} {3}", stn, meas, X, Y, Z);
            }

            UpdateDLLs.update();
            Console.WriteLine("finish");
            Console.ReadLine();
        }
Пример #2
0
        public bool addFeatureByMP(string routeId, string featureType, string description, double mp)
        {
            Enbridge.LinearReferencing.ContLineLocatorSQL loc = new Enbridge.LinearReferencing.ContLineLocatorSQL(routeId);
            double stn, meas, X, Y, Z;
            stn = loc.getStnFromMP(mp, out meas, out X, out Y, out Z);
            string stnSeriesId = loc.getLocation(X, Y);

            this.pendingFeaturesList.Add(new PointFeat(routeId, stnSeriesId, stn, mp, featureType, Y, X, description, Z));
            return true;
        }
Пример #3
0
        /// <summary>
        /// Add a point on line 1 given the mile post
        /// </summary>
        /// <param name="milePost">Mile Post</param>
        /// <returns>success status true or false</returns>
        public bool AddPointByMilePost(double milePost)
        {
            if (milePost < 774 || milePost > 1090)
            {
                Console.WriteLine("Mile Post out of range for line 1");
                return false;
            }

            //Create a locator object for Line 1
            Enbridge.LinearReferencing.ContLineLocatorSQL loc = new Enbridge.LinearReferencing.ContLineLocatorSQL("{D4D4472B-FB1E-485B-A550-DCE76F63BC08}");

            //declare variables to hold return value and out parameters from getStnFromMP
            double meas, X, Y, Z, stationing;
            //run the locator
            stationing = loc.getStnFromMP(milePost, out meas, out X, out Y, out Z);

            //reassign the pointGeometry to a new instance of PointGeometry, created
            //using the constructor with parameters
            this.pointGeometry = new PointGeometry(X, Y, Z, stationing);

            //Set the geometryValuesAssigned flag to true
            this.geometryValuesAssigned = true;

            //set *this* object property milePost to the passed in parameter milePost
            this.milePost = milePost;

            return true;
        }