阅读:3663回复:7
求助 :在AE中如何实现Topology工具条中的Construct Feature命令?
<P> 那位知道在AE中如何实现在Topology工具条中的Construct Feature命令,我现在在做数据处理 有好多线组成的数据集,想通过Topology工具条中的Construct Feature一次性全部构成面,我知道在ArcMap可以做到这一点,但是真正AE中用那个接口可以做到呢?那位知道可否告知一二 ,先谢谢了</P>
<P> |
|
1楼#
发布于:2005-09-03 15:57
<P>在帮助里查找下</P>
<P>Topology</P> <P>TopologyGraph</P> <P>等几个接口</P> <P>你可以看看这个工具</P> <P><a href="http://www.ian-ko.com/ET_GeoWizards/gw_NoRestrictions.htm" target="_blank" >http://www.ian-ko.com/ET_GeoWizards/gw_NoRestrictions.htm</A></P> |
|
|
2楼#
发布于:2005-09-03 16:01
<PRE>Public Sub CreatePolygonFromPolylines()
On Error GoTo ErrorHandler Dim pUID As New UID pUID = "esriCore.Editor" Dim pEditor As IEditor Set pEditor = Application.FindExtensionByCLSID(pUID) Dim pEditLayers As IEditLayers Set pEditLayers = pEditor 'QI Dim pActiveView As IActiveView Set pActiveView = pEditor.Map 'Check that at least one feature is selected 'and ensure the target layer is a polygon layer If pEditor.SelectionCount = 0 Then Exit Sub If Not pEditLayers.CurrentLayer.FeatureClass.ShapeType = esriGeometryPolygon Then Exit Sub 'Start an edit operation pEditor.StartOperation 'Get the Editor's feature selection Dim pEnumFeature As IEnumFeature Set pEnumFeature = pEditor.EditSelection pEnumFeature.Reset Dim pFeature As IFeature Set pFeature = pEnumFeature.Next 'Union all the polylines together Dim pTempPolyline As ITopologicalOperator Set pTempPolyline = New Polyline Do While Not pFeature Is Nothing If pFeature.Shape.GeometryType = esriGeometryPolyline Then Set pTempPolyline = pTempPolyline.Union(pFeature.Shape) End If Set pFeature = pEnumFeature.Next Loop 'Create a new polygon and call Close to ensure a closed polygon Dim pPolygonPointColl As IPointCollection Set pPolygonPointColl = New Polygon pPolygonPointColl.AddPointCollection pTempPolyline Dim pPolygon As IPolygon Set pPolygon = pPolygonPointColl 'QI pPolygon.Close 'Create a new feature in the target layer Dim pNewFeature As IFeature Set pNewFeature = pEditLayers.CurrentLayer.FeatureClass.CreateFeature Set pNewFeature.Shape = pPolygon pNewFeature.Store 'Complete the edit operation pEditor.StopOperation "Create Polygon" 'Flag the area of the new feature for refreshing pActiveView.PartialRefresh esriViewGeography, Nothing, pPolygon.Envelope Exit Sub 'Exit to avoid error handler ErrorHandler: pEditor.AbortOperation End Sub</PRE> |
|
|
3楼#
发布于:2005-09-03 17:57
你这个好像只是生成一个多边形,ArcMAp里Topology工具条中的Construct Feature命令可以创建多个polygon<img src="images/post/smile/dvbbs/em02.gif" />
|
|
4楼#
发布于:2005-09-03 18:08
而且他那个工具将可以组成多边形的线组合成多边形,不能组合的仍然剩下,但是你这个好像是所有的线组成一个多边形哦<img src="images/post/smile/dvbbs/em08.gif" />
[此贴子已经被作者于2005-9-3 18:48:04编辑过]
|
|
5楼#
发布于:2005-09-03 18:53
<P>前一个图是用arcmap提供的工具,后面一个是用3楼提供的程序,用的是同一套数据</P>
|
|
6楼#
发布于:2005-09-10 18:10
<P>哪位知道阿?</P>
|
|
7楼#
发布于:2005-10-13 08:52
<P>等待高手出现……</P>
|
|