Answers:
我尚未使用ArcGIS 10,但是在9.3.1中,您可以在行图层上启动编辑会话,突出显示要划分的要素,然后在编辑器工具栏上的下拉菜单中选择划分选项。您可以在此处指定将所选要素除以的距离。然后,您可以使用ET GeoWizard中的“导出节点”工具(免费工具)为每个分割的线段获取一个点层。
您可以使用空间连接将点数据信息放回线层。在ArcMap TOC中右键单击线层,然后选择“连接和关联”>“连接”。在第一个下拉列表中,选择“基于空间位置从另一层加入数据”选项。
我不知道UI上的工具可以执行此操作,但是可以通过IMSegmentation3界面以编程方式完成此操作。
protected override void OnClick()
{
try
{
var fSel = ArcMap.Document.FocusMap.get_Layer(1) as IFeatureSelection;
if (fSel.SelectionSet.Count == 0)
{
MessageBox.Show("choose a line feature first");
return;
}
var gc = ArcMap.Document.FocusMap as IGraphicsContainer;
IFeature feat = ((IFeatureLayer)fSel).FeatureClass.GetFeature(fSel.SelectionSet.IDs.Next());
var pnts = GetPoints((IPolyline)feat.ShapeCopy, 2.0);
foreach (IPoint pnt in pnts)
{
var elem = new MarkerElementClass() as IElement;
elem.Geometry = pnt;
((IMarkerElement)elem).Symbol = new SimpleMarkerSymbolClass();
gc.AddElement(elem, 0);
}
((IActiveView)ArcMap.Document.FocusMap).PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
/// <summary>
/// Get points at evenly spaced measures along a polyline
/// </summary>
/// <param name="polyline"></param>
/// <param name="count"></param>
/// <returns></returns>
private List<IPoint> GetPoints(IPolyline polyline, double mspacing)
{
var outList = new List<IPoint>();
var mseg = polyline as IMSegmentation3;
if (mseg.MMonotonic == esriMMonotonicEnum.esriMNotMonotonic)
throw new Exception("polyline not monotonic");
for (double m = mseg.MMin; m <= mseg.MMax; m += mspacing)
{
var geomcoll = mseg.GetPointsAtM(m, 0.0);
if (geomcoll != null && geomcoll.GeometryCount > 0)
{
var pnt = geomcoll.get_Geometry(0) as IPoint;
outList.Add(pnt);
}
}
return outList;
}