Beispiel #1
0
        /// <summary>
        ///     Locates point route location with the specified route identifier.
        /// </summary>
        /// <param name="routeId">The route identifier.</param>
        /// <param name="point">The point.</param>
        /// <param name="error">The error that occured during location.</param>
        /// <returns>
        ///     Returns a <see cref="IGeometry" /> representing the location.
        /// </returns>
        public IGeometry Locate(object routeId, IPoint point, out esriLocatingError error)
        {
            IRouteLocation routeLocation = new RouteMeasurePointLocationClass();

            routeLocation.RouteID = routeId;

            IRouteMeasurePointLocation location = (IRouteMeasurePointLocation)routeLocation;

            location.Measure = point.M;

            IGeometry result;

            this.Locator.Locate(routeLocation, out result, out error);

            return(result.IsEmpty ? null : result);
        }
Beispiel #2
0
        /// <summary>
        ///     Locates line route location with the specified route identifier.
        /// </summary>
        /// <param name="routeId">The route identifier.</param>
        /// <param name="polyline">The polyline.</param>
        /// <param name="error">The error that occured during location.</param>
        /// <returns>
        ///     Returns a <see cref="IGeometry" /> representing the location.
        /// </returns>
        public IGeometry Locate(object routeId, IPolyline polyline, out esriLocatingError error)
        {
            IRouteLocation routeLocation = new RouteMeasureLineLocationClass();

            routeLocation.RouteID = routeId;

            IMSegmentation segmentation = (IMSegmentation)polyline;

            IRouteMeasureLineLocation lineLocation = (IRouteMeasureLineLocation)routeLocation;

            lineLocation.FromMeasure = segmentation.MMin;
            lineLocation.ToMeasure   = segmentation.MMax;

            IGeometry result;

            this.Locator.Locate(routeLocation, out result, out error);

            return(result.IsEmpty ? null : result);
        }
Beispiel #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="RouteLocationResult" /> class.
 /// </summary>
 /// <param name="location">Describes a portion of a route or a single position along a route.</param>
 /// <param name="feature">The feature.</param>
 /// <param name="geometry">The geometry.</param>
 /// <param name="error">The error.</param>
 public RouteLocationResult(IRouteLocation location, IFeature feature, IGeometry geometry, esriLocatingError error)
 {
     this.Location = location;
     this.Feature  = feature;
     this.Geometry = geometry;
     this.Error    = error;
 }