ee.Geometry.Point.convexHull

指定されたジオメトリの凸包を返します。単一のポイントの凸包はポイント自体であり、同一線上のポイントの凸包は線であり、それ以外のすべての凸包はポリゴンです。すべての頂点が同じ線上にある縮退ポリゴンは、線分になります。

用途戻り値
Point.convexHull(maxError, proj)ジオメトリ
引数タイプ詳細
これ: geometryジオメトリこのジオメトリの凸包を計算します。
maxErrorErrorMargin、デフォルト: null必要な再投影を行う際に許容される最大誤差。
projProjection、デフォルト: nullオペレーションを実行するプロジェクション。指定しない場合、演算は球面座標系で実行され、線形距離は球面のメートル単位になります。

コードエディタ(JavaScript)

// Define a Point object.
var point = ee.Geometry.Point(-122.082, 37.42);

// Apply the convexHull method to the Point object.
var pointConvexHull = point.convexHull({'maxError': 1});

// Print the result to the console.
print('point.convexHull(...) =', pointConvexHull);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(point,
             {'color': 'black'},
             'Geometry [black]: point');
Map.addLayer(pointConvexHull,
             {'color': 'red'},
             'Result [red]: point.convexHull');

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

# Define a Point object.
point = ee.Geometry.Point(-122.082, 37.42)

# Apply the convexHull method to the Point object.
point_convex_hull = point.convexHull(maxError=1)

# Print the result.
display('point.convexHull(...) =', point_convex_hull)

# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(point, {'color': 'black'}, 'Geometry [black]: point')
m.add_layer(
    point_convex_hull, {'color': 'red'}, 'Result [red]: point.convexHull'
)
m