ArcGIS for Desktop

  • ドキュメント
  • 価格
  • サポート

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS for Desktop

完全なプロ仕様の GIS

ArcGIS for Server

エンタープライズ GIS

ArcGIS for Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • 価格
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcGIS Help

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • その他...

クラス内での引数の変更

Spatial Analyst のライセンスで利用可能。

  • クラスの値またはプロパティの変更
  • Python リストで作成したクラスの変更
  • リスト内のリストで作成したクラス
  • リスト内の一連のクラスから作成したクラス

モデリングしていた現象に関する詳細を入手したり、代替シナリオをテストしたり、エラーや感度の解析を実行したり、単にエラーを修正したりするために、パラメーターに対する個々の引数を変更したい場合があります。一連の例を使って、各種の入力引数を変更する方法を説明します。

  • Spatial Analyst クラスの概要

クラスの値またはプロパティの変更

  • クラス オブジェクトの値の変更は、クラスを作り直すだけです。
    neighborhood = NbrCircle(5, "MAP")
    
    # The neighborhood object can be changed from a circle to a rectangle
    neighborhood = NbrRectangle(3, 3, "MAP")
    
  • 単一の引数は、オブジェクト内でその引数を格納しているプロパティにアクセスすることにより、直接変更できます。
    >>> neighborhood = NbrCircle(5, "MAP")
    >>> # The following statements change the radius to 7 and the units to CELL
    >>> neighborhood.radius = 7 
    >>> neighborhood.units = "CELL"
    
    >>> print(neighborhood)
    CIRCLE 7 CELL
    
  • オブジェクト内でプロパティとして格納されている数値引数は代数演算で変更できます。
    circle = NbrCircle(5, "CELL")
    
    # The following statement changes the radius to 5.5
    circle.radius = circle.radius * 1.1
    

    代入演算子を使用して値を変更することもできます。

    # The following statement changes the radius to 5.5
    circle.radius *= 1.1
    

Python リストで作成したクラスの変更

  • リストから作成したクラスの inFeatures リストにエレメントを追加することができます。
    >>> arguments = TopoStream(["features1", "features2"]) 
    
    >>> arguments.inFeatures.append("features3")
    >>> arguments.inFeatures += ["features4", "features5"]
    
    >>> print(arguments.inFeatures)
    ['features1', 'features2', 'features3', 'features4', 'features5']
    
  • 入力リストからエレメントを削除することもできます。
    >>> arguments = TopoStream(["features1", "features2", "features3", "features4", "features5"])
    >>> del arguments.inFeatures[2]
    
    >>> print(arguments.inFeatures)
    ['features1', 'features2', 'features4', 'features5']
    
  • リスト内の特定のエントリを変更できます。
    >>> arguments = TopoStream(["features1", "features2"]) 
    >>> arguments.inFeatures[1] = "lake2"
    
    >>> print(arguments.inFeatures)
    ['features1', 'lake2']
    

リスト内のリストで作成したクラス

  • リスト内のリストから作成したクラスのリマップ テーブルのエントリを変更することができます (内部リスト内のエントリの変更)。
    >>> remap = RemapValue([[1, 11], [2, 12], [3, 13]])
    
    >>> # Change the newValue 12 in the second reclassification to a 10
    >>> remap.remapTable[1][1] = 10
    
    >>> print(remap.remapTable)
    [[1, 11], [2, 10], [3, 13]]
    
  • リマップ テーブル内の個々のエントリは、代数演算で変更できます。
    remap = RemapRange([[1, 10, 5], [10, 20, 8], [20, 30, 10]])
    
    # The following statement increases the endValue 20 by 5 percent
    remap.remapTable[1][1] *= 1.05 
    
    # Another implementation of increasing an entry by 5 percent
    remap.remapTable[1][1] = remapTable.table[1][1] * 1.05
    
  • 次の例は、リマップ テーブル内の個々の行を変更する方法を示しています (内部リスト全体の変更)。
    >>> remap = RemapValue([[1, 11], [2, 12], [4, 13]])
    
    >>> # Change the second reclassification [2, 12] to [3,10]
    >>> remap.table[1] = [3, 10]
      
    >>> print(remap.remapTable)
    [[1, 11], [3, 10], [4, 13]]
    
  • 次の例は、エントリをリマップ テーブルに追加する方法を示しています (内部リストの追加)。
    >>> remap = RemapValue([[1, 11], [2, 12], [3, 13]])
    
    >>> # Add a forth reclassification, [4, 14] to the end
    >>> remap.remapTable.append([4, 14]) 
    
    >>> # Another approach for adding a row
    >>> remap.remapTable += [[5, 15]] 
    
    >>> print(remap.remapTable)
    [[1, 11], [2, 12], [3, 13], [4, 14], [5, 15]]
    
  • 次の例は、エントリをリマップ テーブルから削除する方法を示しています (内部リストの削除)。
    >>> remap = RemapValue([[1, 11], [2, 12], [3, 13], [4, 14], [5, 15]])
    
    >>> # Delete the entire second reclassification
    >>> del remap.remapTable[1]
    
    >>> print(remap.remapTable)
    [[1, 11], [3, 13], [4, 14], [5, 15]]
    

リスト内の一連のクラスから作成したクラス

  • リスト内の一連のクラスから作成したクラスのリスト内の特定のポイントを変更することができます。
    >>> points = [Point(0, 5), Point(15, 175)]
    
    >>> # Change the X value of the second input to 25
    >>> points[1].X = 25 
    
    >>> print(points)
    [<Point (0.0, 5.0, #, #)>, <Point (25.0, 175.0, #, #)>]
    

関連トピック

  • Spatial Analyst クラス使用の概要
  • クラスの作成
  • クラスの検索
このトピックへのフィードバック

ArcGIS for Desktop

  • ホーム
  • ドキュメント
  • 価格
  • サポート

ArcGIS プラットフォーム

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • スタッフ ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | プライバシー | リーガル