コード例 #1
0
ファイル: Route.cs プロジェクト: wey12138/Wave
        /// <summary>
        ///     Locate line features along the route and writes the result to a new line event table.
        /// </summary>
        /// <param name="locateLinesAlongRouteName">The name of the event table of the located features.</param>
        /// <param name="lines">The lines to locate.</param>
        /// <param name="clusterTolerance">
        ///     The cluster tolerance which is a numeric value
        ///     representing the maximum tolerated distance between the input lines and the target routes.
        /// </param>
        /// <param name="filter">An optional filter used to use a subset of the line data.</param>
        /// <param name="keepAllFields">
        ///     Allows you to include or disinclude the attributes of the point feature class.  If this is
        ///     set to False, the output event table will only contain the route event properties.
        /// </param>
        /// <param name="workspace">The workspace that will contain the event data table.</param>
        /// <returns>
        ///     Returns a <see cref="ITable" /> representing the event table of the results.
        /// </returns>
        public ITable Locate(string locateLinesAlongRouteName, IFeatureClass lines, double clusterTolerance, IQueryFilter filter, bool keepAllFields, IWorkspace workspace)
        {
            var properties = new RouteMeasureLinePropertiesClass();

            properties.EventRouteIDFieldName = this.Name.RouteIDFieldName;
            properties.ToMeasureFieldName    = "TMEAS";
            properties.FromMeasureFieldName  = "FMEAS";

            return(this.Locate(locateLinesAlongRouteName, lines, clusterTolerance, properties, filter, keepAllFields, workspace));
        }
コード例 #2
0
ファイル: Route.cs プロジェクト: wey12138/Wave
        /// <summary>
        ///     Locates the polygon features along the route and writes the result to a new line event table.
        /// </summary>
        /// <param name="locatePolygonsAlongRouteName">Name of the locate polygons along route.</param>
        /// <param name="polygons">The polygons to locate.</param>
        /// <param name="keepZeroLengthEvents">
        ///     if set to <c>true</c> allows you to keep or not keep the zero length line events in
        ///     the output event table.  The zero length line events result from a case where the geometric intersection of the
        ///     route (line) and the polygon is a point.
        /// </param>
        /// <param name="filter">An optional filter used to use a subset of the polygon data.</param>
        /// <param name="keepAllFields">
        ///     Allows you to include or disinclude the attributes of the point feature class.  If this is
        ///     set to False, the output event table will only contain the route event properties.
        /// </param>
        /// <param name="workspace">The workspace that will contain the event data table.</param>
        /// <returns>
        ///     Returns a <see cref="ITable" /> representing the event table of the results.
        /// </returns>
        public ITable Locate(string locatePolygonsAlongRouteName, IFeatureClass polygons, bool keepZeroLengthEvents, IQueryFilter filter, bool keepAllFields, IWorkspace workspace)
        {
            var properties = new RouteMeasureLinePropertiesClass();

            properties.EventRouteIDFieldName = this.Name.RouteIDFieldName;
            properties.ToMeasureFieldName    = "TMEASURE";
            properties.FromMeasureFieldName  = "FMEASURE";

            return(this.Locate(locatePolygonsAlongRouteName, polygons, keepZeroLengthEvents, properties, filter, keepAllFields, workspace));
        }
コード例 #3
0
        /// <summary>
        /// 动态分段,作者:刘宇
        /// </summary>
        /// <param name="_pRouteFC"></param>
        /// <param name="_pPKName"></param>
        /// <param name="_pEventTable"></param>
        /// <param name="_pFKName"></param>
        /// <param name="_pFrom"></param>
        /// <param name="_pTo"></param>
        /// <returns></returns>
        IFeatureClass EventTable2FeatureClass(IFeatureClass _pRouteFC, string _pPKName, ITable _pEventTable, string _pFKName, string _pFrom, string _pTo)
        {
            IDataset pDataset = (IDataset)_pRouteFC;

            IName pName = pDataset.FullName;

            IRouteLocatorName pRouteLocatorName = new RouteMeasureLocatorNameClass();

            pRouteLocatorName.RouteFeatureClassName = pName;

            pRouteLocatorName.RouteIDFieldName = _pPKName;

            pRouteLocatorName.RouteMeasureUnit = esriUnits.esriFeet;
            pName = (IName)pRouteLocatorName;

            IRouteEventProperties2 pRouteProp = new RouteMeasureLinePropertiesClass();

            pRouteProp.AddErrorField = true;
            pRouteProp.EventMeasureUnit = esriUnits.esriFeet;
            pRouteProp.EventRouteIDFieldName = _pFKName;

            IRouteMeasureLineProperties rMLineProp = (IRouteMeasureLineProperties)pRouteProp;

            rMLineProp.FromMeasureFieldName = _pFrom;
            rMLineProp.ToMeasureFieldName = _pTo;

            IDataset pDs = (IDataset)_pEventTable;
            IName pNTableName = pDs.FullName;
            IRouteEventSourceName pRouteEventSourceName = new RouteEventSourceNameClass();
            pRouteEventSourceName.EventTableName = pNTableName;
            pRouteEventSourceName.EventProperties = (IRouteEventProperties)pRouteProp;
            pRouteEventSourceName.RouteLocatorName = pRouteLocatorName;

            pName = (IName)pRouteEventSourceName;

            IFeatureClass pFeatureClass = (IFeatureClass)pName.Open();

            return pFeatureClass;
        }