YouTube | Facebook | X(Twitter) | RSS

フィーチャクラス作成時に Z 値の格納を許可

2016/9/1 (木)

// Shapeフィールドの場所を特定します。
for (int j = 0; j < fields.FieldCount; j++)
{
    if (fields.get_Field(j).Type == ESRI.ArcGIS.Geodatabase.esriFieldType.esriFitry)
    {
        strShapeField = fields.get_Field(j).Name;
 
        //ジオメトリタイプ・Z値を許可
        IFieldEdit pGeometryField = (IFieldEdit)fields.get_Field(j);
        IGeometryDefEdit pGeometryDefEdit = (IGeometryDefEdit)pGeometryField.GeometryDef;
        pGeometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPoint;
        pGeometryDefEdit.HasZ_2 = true;
 
        //空間参照の定義
        ISpatialReference pSpatialReference = null;
        //pSpatialReference 空間参照を別フィーチャクラス等から取得
        pGeometryDefEdit.SpatialReference_2 = pSpatialReference;
 
        //Zドメインを設定
        ISpatialReferenceResolution pSpatialReferenceResolution = (ISpatialReferon)pGeometryDefEdit.SpatialReference;
        pSpatialReferenceResolution.SetDefaultZResolution();
    }
}

関連記事

  • この記事を書いた人

羽田 康祐

伊達と酔狂のGISエンジニア。GIS上級技術者、Esri認定インストラクター、CompTIA CTT+ Classroom Trainer、潜水士、PADIダイブマスター、四アマ。WordPress は 2.1 からのユーザーで歴だけは長い。 代表著書『地図リテラシー入門―地図の正しい読み方・描き方がわかる』 GIS を使った自己紹介はこちら。ESRIジャパン(株)所属、元青山学院大学非常勤講師を兼務。日本地図学会第31期常任委員。発言は個人の見解です。

-プログラミング, ArcGIS
-,

WINGFIELD since1981をもっと見る

今すぐ購読し、続きを読んで、すべてのアーカイブにアクセスしましょう。

続きを読む