根据要素选择集,创建新图层

转自原文 根据要素选择集,创建新图层

 

                    IFeatureLayer featureLayer = new FeatureLayerClass();
                    featureLayer.FeatureClass = featureClass;

                    IFeatureSelection featureSelection = featureLayer as IFeatureSelection;
                    IQueryFilter queryFilter1 = new QueryFilterClass();
                    queryFilter1.WhereClause = "XZQDM like '" + xz_xzqdm + "%'";
                    featureSelection.SelectFeatures(queryFilter1, esriSelectionResultEnum.esriSelectionResultNew, false);

                    ISelectionSet selectionSet = featureSelection.SelectionSet;
                    IFeatureLayer newFeatureLayer = null;
                    if (selectionSet.Count > 0)
                    {
                        IFeatureLayerDefinition featureLayerDefinition = featureLayer as IFeatureLayerDefinition;
                        newFeatureLayer = featureLayerDefinition.CreateSelectionLayer(featureClass.AliasName, true, null, null);
                    }

 
 
posted @ 2017-04-01 13:47  wenglabs  阅读(1341)  评论(0编辑  收藏  举报