Ejemplo n.º 1
0
        /// <summary>
        /// Method converts ESRI ArcGIS Polyline object to ESRI ArcLogistics Polyline object.
        /// </summary>
        /// <param name="polyline">Polyline to convert.</param>
        /// <returns>ESRI ArcLogistics Polyline object.</returns>
        private ESRI.ArcLogistics.Geometry.Polyline _ConvertToArcLogisticsPolyline(
            ESRISDSGeometry.Polyline polyline)
        {
            Debug.Assert(polyline != null);

            var groups = new List <int>();
            var points = new List <ESRI.ArcLogistics.Geometry.Point>();

            for (int i = 0; i < polyline.Paths.Count; i++)
            {
                // Fill current group by count of Points in it.
                groups.Add(polyline.Paths[i].Count);

                var collection = polyline.Paths[i];

                // Get all points.
                foreach (var point in collection)
                {
                    points.Add(_ConvertToArcLogisticsPoint(point));
                }
            }

            var newPolyline = new ESRI.ArcLogistics.Geometry.Polyline(
                groups.ToArray(), points.ToArray());

            return(newPolyline);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Method converts ESRI ArcGIS Polyline object to ESRI ArcLogistics Polyline object.
        /// </summary>
        /// <param name="polyline">Polyline to convert.</param>
        /// <returns>ESRI ArcLogistics Polyline object.</returns>
        private ESRI.ArcLogistics.Geometry.Polyline _ConvertToArcLogisticsPolyline(
            ESRISDSGeometry.Polyline polyline)
        {
            Debug.Assert(polyline != null);

            var groups = new List<int>();
            var points = new List<ESRI.ArcLogistics.Geometry.Point>();

            for (int i = 0; i < polyline.Paths.Count; i++)
            {
                // Fill current group by count of Points in it.
                groups.Add(polyline.Paths[i].Count);

                var collection = polyline.Paths[i];

                // Get all points.
                foreach (var point in collection)
                {
                    points.Add(_ConvertToArcLogisticsPoint(point));
                }
            }

            var newPolyline = new ESRI.ArcLogistics.Geometry.Polyline(
                groups.ToArray(), points.ToArray());

            return newPolyline;
        }