ee.Geometry.MultiPoint.convexHull

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

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

コードエディタ(JavaScript)

// Define a MultiPoint object.
var multiPoint = ee.Geometry.MultiPoint([[-122.082, 37.420], [-122.081, 37.426]]);

// Apply the convexHull method to the MultiPoint object.
var multiPointConvexHull = multiPoint.convexHull({'maxError': 1});

// Print the result to the console.
print('multiPoint.convexHull(...) =', multiPointConvexHull);

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

Python の設定

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

import ee
import geemap.core as geemap

Colab(Python)

# Define a MultiPoint object.
multipoint = ee.Geometry.MultiPoint([[-122.082, 37.420], [-122.081, 37.426]])

# Apply the convexHull method to the MultiPoint object.
multipoint_convex_hull = multipoint.convexHull(maxError=1)

# Print the result.
display('multipoint.convexHull(...) =', multipoint_convex_hull)

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