/// <summary> /// PointToPolyLine - Takes a point collection and generates a polyline /// </summary> /// <param name="pntColl"></param> /// <returns>PolyLine</returns> public static ESRI.ArcGIS.Geometry.Polyline PointToPolyline(ESRI.ArcGIS.Geometry.IPointCollection pntColl) { ESRI.ArcGIS.Geometry.Polyline pline = new ESRI.ArcGIS.Geometry.Polyline(); if (pntColl.PointCount > 0) { ESRI.ArcGIS.Geometry.ISegmentCollection segColl = PointsToSegmentColl(pntColl); if (segColl.SegmentCount >= 0) { pline = segColl as ESRI.ArcGIS.Geometry.Polyline; } } return(pline); }
/// <summary> /// 验证拓扑 /// </summary> /// <param name="topology">拓扑对象</param> /// <param name="envelope">验证范围</param> private void ValidateTopology(ITopology topology, ESRI.ArcGIS.Geometry.IEnvelope envelope) { try { // Get the dirty area within the provided envelope. ESRI.ArcGIS.Geometry.IPolygon locationPolygon = new ESRI.ArcGIS.Geometry.PolygonClass(); ESRI.ArcGIS.Geometry.ISegmentCollection segmentCollection = (ESRI.ArcGIS.Geometry.ISegmentCollection)locationPolygon; segmentCollection.SetRectangle(envelope); ESRI.ArcGIS.Geometry.IPolygon polygon = topology.get_DirtyArea(locationPolygon); // If a dirty area exists, validate the topology.if (!polygon.IsEmpty) { // Define the area to validate and validate the topology. ESRI.ArcGIS.Geometry.IEnvelope areaToValidate = polygon.Envelope; ESRI.ArcGIS.Geometry.IEnvelope areaValidated = topology.ValidateTopology(areaToValidate); } } catch (Exception) { } }