arcengine 什么对象需要releasecomobject
答案:2 悬赏:20 手机版
解决时间 2021-02-13 05:25
- 提问者网友:wodetian
- 2021-02-12 20:17
arcengine 什么对象需要releasecomobject
最佳答案
- 五星知识达人网友:迷人又混蛋
- 2021-02-12 20:33
可以不用ITopologicalOperator,直接用空间查询就可以实现
//spatial uery
ISpatialFilter pSpatialFilter = new SpatialFilterClass();
pSpatialFilter.Geometry = (IGeometry)pPolyline;//用于查询的polyline
SpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;//Intersect
IFeatureCursor pFeatureCursor = pFeatureClass.Search(pSpatialFilter, false);//uery
IFeature pFeature = pFeatureCursor.NextFeature();
while (pFeature != null)
{
IPolyline pueryPolyline = (IPolyline)pFeature.Shape ; //查询出来的polyline
pFeature = pFeatureCursor.NextFeature();
//release com resource
System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeatureCursor);}
//spatial uery
ISpatialFilter pSpatialFilter = new SpatialFilterClass();
pSpatialFilter.Geometry = (IGeometry)pPolyline;//用于查询的polyline
SpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;//Intersect
IFeatureCursor pFeatureCursor = pFeatureClass.Search(pSpatialFilter, false);//uery
IFeature pFeature = pFeatureCursor.NextFeature();
while (pFeature != null)
{
IPolyline pueryPolyline = (IPolyline)pFeature.Shape ; //查询出来的polyline
pFeature = pFeatureCursor.NextFeature();
//release com resource
System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeatureCursor);}
全部回答
- 1楼网友:时间的尘埃
- 2021-02-12 20:55
不明白啊 = =!
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯