使用Arcgis Engine開發時發現.Net help中有些小錯誤

來源:互聯網
上載者:User

        這幾天在公司實習,用Arcgis Engine做項目查help時發現一些小問題,害我在找需要使用的介面和類時折騰了半天,把這些記下來方便大家。(本人所寫模組有個功能是基於DEM的土方計算,使用的是C#)

1.

RasterSurface    在名字空間ESRI.ArcGIS.Analyst3D下,實現的介面如下

Interfaces Description
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.
IRasterSurface Provides access to members that manipulate and analyze a raster surface.
ISurface (GeoDatabase) Provides access to members that control surfaces.

RasterSurface對應的實體類RasterSurfaceClass下關於ISurface.GetVolume等方法的說明

GetSurfaceArea Returns the TIN's area measured on its surface above or below an input z value.
GetVolume Returns 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介面

  屬性或方法 描述
Domain Surface相關的類
Z Z = 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的協助文檔還是有一些小錯誤的,在實際使用的時候和物件模型圖表對應起來,再在代碼中嘗試一下才是最重要的。)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.