お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、アクセスを維持するために
非商用目的での利用資格を確認する必要があります。2025 年 9 月 26 日までに確認が完了していない場合、アクセスが保留されることがあります。
ee.FeatureCollection.distance
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
各ピクセルが、ピクセルの中央からコレクション内の最も近い Point、LineString、またはポリゴンの境界までの距離(メートル単位)である DOUBLE 画像を生成します。距離はポリゴンの内部でも測定されます。ジオメトリから「searchRadius」メートル以内のピクセルはマスクされます。
距離は球体上で計算されるため、各ピクセルと最も近いジオメトリの緯度の差に比例した小さな誤差が生じます。
用途 | 戻り値 |
---|
FeatureCollection.distance(searchRadius, maxError) | 画像 |
引数 | タイプ | 詳細 |
---|
これ: features | FeatureCollection | ピクセル距離の計算に使用する特徴を取得する特徴コレクション。 |
searchRadius | 浮動小数点数、デフォルト: 100000 | 各ピクセルからエッジを探す最大距離(メートル単位)。この距離内にエッジがない限り、ピクセルはマスクされます。 |
maxError | 浮動小数点数、デフォルト: 100 | 再投影の最大誤差(メートル単位)。入力ポリラインの再投影が必要な場合にのみ使用されます。「0」が指定されている場合、射影が必要な場合、このオペレーションは失敗します。 |
例
コードエディタ(JavaScript)
// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Generate an image of distance to nearest power plant.
var distance = fc.distance({searchRadius: 50000, maxError: 50});
// Display the image and FeatureCollection on the map.
Map.setCenter(4.56, 50.78, 7);
Map.addLayer(distance, {max: 50000}, 'Distance to power plants');
Map.addLayer(fc, {color: 'red'}, 'Power plants');
Python の設定
Python API とインタラクティブな開発での geemap
の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"'
)
# Generate an image of distance to nearest power plant.
distance = fc.distance(searchRadius=50000, maxError=50)
# Display the image and FeatureCollection on the map.
m = geemap.Map()
m.set_center(4.56, 50.78, 7)
m.add_layer(distance, {'max': 50000}, 'Distance to power plants')
m.add_layer(fc, {'color': 'red'}, 'Power plants')
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。"],[],[]]