Earth Engine は、共有コンピューティング リソースを保護し、すべてのユーザーに信頼性の高いパフォーマンスを提供するために、
非商用割り当て階層 を導入しています。すべての非商用プロジェクトは、
2026 年 4 月 27 日 までに割り当て階層を選択する必要があります。選択しない場合は、デフォルトでコミュニティ階層が使用されます。階層の割り当ては、
2026 年 4 月 27 日 に(階層の選択日に関係なく)すべてのプロジェクトで有効になります。
詳細
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
フィードバックを送信
ee.Geometry.difference
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
「左」のジオメトリから「右」のジオメトリを減算した結果を返します。
用途 戻り値 Geometry. difference (right, maxError , proj )ジオメトリ
引数 タイプ 詳細 これ: left ジオメトリ オペレーションの左オペランドとして使用されるジオメトリ。 rightジオメトリ 演算の右オペランドとして使用されるジオメトリ。 maxErrorErrorMargin、デフォルト: null 必要な再投影を行う際に許容される最大誤差。 projProjection、デフォルト: null オペレーションを実行するプロジェクション。指定しない場合、演算は球面座標系で実行され、線形距離は球面のメートル単位になります。
例
コードエディタ(JavaScript)
// Define a Geometry object.
var geometry = ee . Geometry ({
'type' : 'Polygon' ,
'coordinates' :
[[[ - 122.081 , 37.417 ],
[ - 122.086 , 37.421 ],
[ - 122.084 , 37.418 ],
[ - 122.089 , 37.416 ]]]
});
// Define other inputs.
var inputGeom = ee . Geometry . BBox ( - 122.085 , 37.415 , - 122.075 , 37.425 );
// Apply the difference method to the Geometry object.
var geometryDifference = geometry . difference ({ 'right' : inputGeom , 'maxError' : 1 });
// Print the result to the console.
print ( 'geometry.difference(...) =' , geometryDifference );
// Display relevant geometries on the map.
Map . setCenter ( - 122.085 , 37.422 , 15 );
Map . addLayer ( geometry ,
{ 'color' : 'black' },
'Geometry [black]: geometry' );
Map . addLayer ( inputGeom ,
{ 'color' : 'blue' },
'Parameter [blue]: inputGeom' );
Map . addLayer ( geometryDifference ,
{ 'color' : 'red' },
'Result [red]: geometry.difference' );
Python の設定
Python API とインタラクティブな開発での geemap の使用については、
Python 環境 のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# Define a Geometry object.
geometry = ee . Geometry ({
'type' : 'Polygon' ,
'coordinates' : [[
[ - 122.081 , 37.417 ],
[ - 122.086 , 37.421 ],
[ - 122.084 , 37.418 ],
[ - 122.089 , 37.416 ],
]],
})
# Define other inputs.
input_geom = ee . Geometry . BBox ( - 122.085 , 37.415 , - 122.075 , 37.425 )
# Apply the difference method to the Geometry object.
geometry_difference = geometry . difference ( right = input_geom , maxError = 1 )
# Print the result.
display ( 'geometry.difference(...) =' , geometry_difference )
# Display relevant geometries on the map.
m = geemap . Map ()
m . set_center ( - 122.085 , 37.422 , 15 )
m . add_layer ( geometry , { 'color' : 'black' }, 'Geometry [black]: geometry' )
m . add_layer ( input_geom , { 'color' : 'blue' }, 'Parameter [blue]: input_geom' )
m . add_layer (
geometry_difference , { 'color' : 'red' }, 'Result [red]: geometry.difference'
)
m
フィードバックを送信
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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。"],[],["The `Geometry.difference()` method subtracts a 'right' geometry from a 'left' geometry, returning the result as a new geometry. It accepts the `right` geometry, an optional `maxError` for reprojection tolerance, and an optional `proj` for the operation's projection. If `proj` is not defined the method will use the spherical coordinate system. Example code shows the difference operation using defined geometries and displays the result.\n"]]