国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發(fā)設(shè)計 > 正文

arcengine erase 擦除

2019-11-10 21:27:16
字體:
供稿:網(wǎng)友

擦除后圖層保存在新圖層中

使用GP工具。

修改原有圖層數(shù)據(jù)實現(xiàn)擦除

參考:

點擊打開鏈接

代碼為:

public void EraSEOper(IFeatureClass ExSourceFC,IFeatureClass ExEraseFC)        {            IFeatureClass mFeatureClass = null;            IFeatureClass mSourceFeatureClass = null;            IFeatureCursor mFeatureCursor = mFeatureClass.Search(null, false);            IFeature mFeature = mFeatureCursor.NextFeature();            while (mFeature != null)            {                ISpatialFilter tSF = new SpatialFilterClass();                tSF.Geometry = mFeature.Shape;                tSF.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;                //求出與裁切框相交要素                IFeatureCursor tFeatureCursor = mSourceFeatureClass.Search(tSF, false);                IFeature tFeature = tFeatureCursor.NextFeature();                while (tFeature != null)                {                    IGeometry tGeo2 = tFeature.ShapeCopy;                    ITopologicalOperator tTope2 = tGeo2 as ITopologicalOperator;                    tTope2.Simplify();                    IGeometry tGeo = tFeature.ShapeCopy;                    ITopologicalOperator tTope = tGeo as ITopologicalOperator;                    tTope.Simplify();                    //用Envelope對要素進行裁切                    tTope.Intersect(mFeature.Shape, esriGeometryDimension.esriGeometry2Dimension);                    //tTope.Clip(this._Envelope);                    IGeometry tGeoClip = (IGeometry)tTope;                    //用裁切出來的要素,再與其源要素進行求差處理,即得到外圍要素                    IGeometry tGeoDe = tTope2.Difference(tGeoClip);                    //把外圍要素賦予源要素                    tFeature.Shape = tGeoDe;                    tFeature.Store();                    tFeature = tFeatureCursor.NextFeature();                    mFeature = mFeatureCursor.NextFeature();                }            }        }

需要完善的內(nèi)容

1.沒有判斷IFeatureClass對象是否為面對象,如果不為面對象則無法實現(xiàn)擦除。2.沒有考慮投影問題。3.還有待發(fā)現(xiàn)其他可能產(chǎn)生的問題。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 道孚县| 绥中县| 华池县| 瓦房店市| 双鸭山市| 商城县| 永寿县| 家居| 琼中| 贵南县| 峨边| 桐梓县| 思茅市| 长泰县| 毕节市| 泊头市| 宜良县| 南郑县| 兰西县| 东莞市| 江西省| 无为县| 定日县| 壶关县| 桐梓县| 卫辉市| 仲巴县| 汝州市| 哈巴河县| 德江县| 南漳县| 晴隆县| 铜川市| 河曲县| 托克托县| 城市| 延安市| 织金县| 岑溪市| 温泉县| 晴隆县|