使用Arcgis Engine开发时发现.Net help中有些小错误

        这几天在公司实习,用Arcgis Engine做项目查help时发现一些小问题,害我在找需要使用的接口和类时折腾了半天,把这些记下来方便大家。(本人所写模块有个功能是基于DEM的土方计算,使用的是C#)

1.

RasterSurface    在名字空间ESRI.ArcGIS.Analyst3D下,实现的接口如下

InterfacesDescription
IFunctionalSurface (Geometry)Provides access to information about the functional surface, generating heights given x,y locations. Also see IFunctionalSurface2.
IFunctionalSurface2 (Geometry)Provides access to members that allow changes to be made to the interpolation domain, in addition to the IFunctionalSurface members.
IRasterSurfaceProvides access to members that manipulate and analyze a raster surface.
ISurface (GeoDatabase)Provides access to members that control surfaces.

RasterSurface对应的实体类RasterSurfaceClass下关于ISurface.GetVolume等方法的说明
MethodGetSurfaceAreaReturns the TIN's area measured on its surface above or below an input z value.
MethodGetVolumeReturns the TIN's volume above or below an input z value.

        上面只说明返回TIN数据的表面积和体积,我就想是否需要把Raster转为TIN,由于项目相关的数据量很大,有40G,当时就考虑效率的问题,如果转换可能就可能会很慢,用户无法接受,于是在ArcMap下进行了相关的操作,实际使用时并不需要把Raster转换为TIN,我就想RasterSurface中应该有相关的功能,能直接得到Raster图层对应区域的表面积和一定高程相关的体积,我就去查实RasterSurface的对象模型图:RasterSurface实现的接口ISurface中

GetSurfaceArea (in referenceHeight: Double,in Type: esriPlaneReferenceType): Double
GetVolume (in reference: Double, in Type:esriPlaneReferenceType): Double

既然没有相应的说明,我就在代码中使用和计算TIN数据的表面积与体积的方法试验了一下,可以直接计算,而不需转换格式。

2.

         由于要通过一个Polygon的参数传入计算土方的区域,我就在RasterClass中查找是否能传入polygon相关的参数,于是我就查询了IFunctionalSurface(Geometry)和IFuncitonalSurface2(Geometry).

IFuncitonalSurface接口

 属性或方法描述
Read-only propertyDomainSurface相关的类
Read-only propertyZZ = f(x,y).

其中Z被标注为属性,实际是方法,通过x,y值得到Z值。

[C#]
public double get_Z (
    double X,
    double Y
);

熟悉C#语法的朋友应该知道,C#中属性的定义是

public porperty {

        get{

             .... 

        }

        set{

           ....

       }

}

属性并不需要传入参数。

 

3.

IFunctionSurface2接口

它继承至IFunctionSurface.

在RasterSurface的对象模型图中,IFuncitonalSurface.Domain 属性是只读,而IFunctionalSurface2.Domain是只写,而在help中IFunctionalSurface和IFunctionalSurface2的Domain属性是相同链接相同的声明。

实际设置Domain属性时,应该为IFunctionalSurface2.Domain_2(只写)  IFunctionalSurface2.Domain(只读)

 

(Engine的帮助文档还是有一些小错误的,在实际使用的时候和对象模型图对应起来,再在代码中尝试一下才是最重要的。)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值