お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、アクセスを維持するために
非商用目的での利用資格を確認する必要があります。2025 年 9 月 26 日までに確認が完了していない場合、アクセスが保留されることがあります。
ee.FeatureCollection.remap
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
コレクション内の特定のプロパティの値を再マッピングします。2 つの並列リストを受け取り、一方のリストで見つかった値をもう一方のリストの値にマッピングします。最初のリストで指定されていない値を持つ要素は、出力コレクションから削除されます。
用途 | 戻り値 |
---|
FeatureCollection.remap(lookupIn, lookupOut, columnName) | FeatureCollection |
引数 | タイプ | 詳細 |
---|
これ: collection | FeatureCollection | 変更するコレクション。 |
lookupIn | リスト | 入力マッピング値。文字列と整数に制限されます。 |
lookupOut | リスト | 出力マッピング値。lookupIn と同じサイズにする必要があります。 |
columnName | 文字列 | 再マッピングするプロパティの名前。 |
例
コードエディタ(JavaScript)
// Classify features based on a string property.
// The 'nonsense' category gets dropped.
var fc = ee.FeatureCollection([
ee.Feature(ee.Geometry.Point([1, 2]), {isTree: 'Tree'}),
ee.Feature(ee.Geometry.Point([3, 4]), {isTree: 'NotTree'}),
ee.Feature(ee.Geometry.Point([5, 6]), {isTree: 'nonsense'}),
]);
var trees = fc.remap(['NotTree', 'Tree'], [0, 1], 'isTree');
print('remapped trees', trees);
Python の設定
Python API とインタラクティブな開発での geemap
の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# Classify features based on a string property.
# The 'nonsense' category gets dropped.
fc = ee.FeatureCollection([
ee.Feature(ee.Geometry.Point([1, 2]), {'isTree': 'Tree'}),
ee.Feature(ee.Geometry.Point([3, 4]), {'isTree': 'NotTree'}),
ee.Feature(ee.Geometry.Point([5, 6]), {'isTree': 'nonsense'}),
])
trees = fc.remap(['NotTree', 'Tree'], [0, 1], 'isTree')
print('Remapped trees:', trees.getInfo())
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-26 UTC。"],[],[]]