お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.Image.where
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
値の条件付き置換を行います。
「input」の各バンドの各ピクセルについて、「test」の対応するピクセルがゼロ以外の場合は、対応するピクセルを出力します。それ以外の場合は、入力ピクセルを出力します。
特定のピクセルでテストまたは値のいずれかがマスクされている場合、入力値が使用されます。入力がマスクされている場合は、何も行われません。
出力バンドの名前は入力バンドと同じです。各バンドの出力タイプは、入力タイプと値タイプの大きい方になります。出力画像は、入力画像のメタデータとフットプリントを保持します。
用途 | 戻り値 |
---|
Image.where(test, value) | 画像 |
引数 | タイプ | 詳細 |
---|
これ: input | 画像 | 入力画像。 |
test | 画像 | テスト画像。この画像のピクセルによって、どの入力ピクセルが返されるかが決まります。単一のバンドの場合、入力画像のすべてのバンドに使用されます。これは配列画像ではない可能性があります。 |
value | 画像 | test がゼロでない場合に使用する出力値。単一のバンドの場合、入力画像のすべてのバンドに使用されます。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eReplaces input image pixel values with values from a secondary image based on a test image's pixel values.\u003c/p\u003e\n"],["\u003cp\u003eIf the test image pixel is non-zero, the corresponding pixel from the value image is used; otherwise, the original input pixel is retained.\u003c/p\u003e\n"],["\u003cp\u003eInput image metadata and footprint are preserved in the output image.\u003c/p\u003e\n"],["\u003cp\u003eOutput image band types are determined by the larger type between the input and value images.\u003c/p\u003e\n"],["\u003cp\u003eMasked pixels in either test or value images result in the original input pixel being used in the output.\u003c/p\u003e\n"]]],[],null,["# ee.Image.where\n\nPerforms conditional replacement of values.\n\n\u003cbr /\u003e\n\nFor each pixel in each band of 'input', if the corresponding pixel in 'test' is nonzero, output the corresponding pixel in value, otherwise output the input pixel.\n\nIf at a given pixel, either test or value is masked, the input value is used. If the input is masked, nothing is done.\n\nThe output bands have the same names as the input bands. The output type of each band is the larger of the input and value types. The output image retains the metadata and footprint of the input image.\n\n| Usage | Returns |\n|----------------------------|---------|\n| Image.where`(test, value)` | Image |\n\n| Argument | Type | Details |\n|---------------|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `input` | Image | The input image. |\n| `test` | Image | The test image. The pixels of this image determines which of the input pixels is returned. If this is a single band, it is used for all bands in the input image. This may not be an array image. |\n| `value` | Image | The output value to use where test is not zero. If this is a single band, it is used for all bands in the input image. |"]]