2015-05-01 42 views
0

ArcGIS 10.1在.NET中使用ArcObjects。我很擅長遍歷要素類中的所有功能。不過,我花了好一整天的時間嘗試尋找一種按字段對功能進行分組的方法。在ArcGIS 10.1中獲取具有相同字段的行

我目前使用的:

Dim pFeatCursor As IFeatureCursor = pPolylineFeatLayer.Search(Nothing, False) 
Dim pPolylineFeature As IFeature = pFeatCursor.NextFeature 
While Not pPolylineFeature Is Nothing 
    'do something with the single feature 

    pPolylineFeature = pFeatCursor.NextFeature 
End While 

什麼即時試圖做的是:

'group features by fields "CODE3" and "AIDX" 

for every group 
    'dump that group of features to it's own featureclass 
next group 

我一直在尋找一些光標類和不能似乎找到任何做這種類型的查詢。這個python函數似乎可以做到這一點,但需要在.NET中執行此操作,並且此工具僅在ModelBuilder中可用。

arcpy.IterateFeatureSelection_mb(Input_Features, Group_By_Fields, "false") 

回答

0

你可以嘗試用 'GROUP BY' 或使用IQueryFilterDefinition.PostfixClause 'ORDER BY'

+0

試了一下。不適用於shapefile,只適用於geodbs。謝謝你的提示。 – sinDizzy

相關問題