GEE數(shù)據(jù)集距離計算

標記特定像素

主要功能

標記大于1000m的像素點,標記等于1000m的像素點

代碼

// Collection.distance example.
// Computes the distance to the nearest feature in a collection.

// Construct a FeatureCollection from a list of geometries.
var fc = ee.FeatureCollection([
  ee.Geometry.Point(-72.94411, 41.32902),
  ee.Geometry.Point(-72.94411, 41.33402),
  ee.Geometry.Point(-72.94411, 41.33902),
  // The geometries do not need to be the same type.
  ee.Geometry.LineString(
      -72.93411, 41.30902, -72.93411, 41.31902, -72.94411, 41.31902)
]);

// Compute distance from the dfeatures, to a max of 1000 meters.
var distance = fc.distance(1000, 100);

Map.setCenter(-72.94, 41.32, 13);
Map.addLayer(distance, {min: 0, max: 1000, palette: ['yellow', 'red']});
Map.addLayer(fc);

步驟分析

  1. 創(chuàng)建ee對象,使用自定義坐標來創(chuàng)建的了點和線的混合要素集合。
  2. 計算與要素距離在設置范圍中的部分。
  3. 添加圖層,設置顯示方式。

主要方法

  1. ee.feature.distance()
    Returns the minimum distance between the geometries of two features.
    Arguments:
    this:left (Element): The feature containing the geometry used as the left operand of the operation.
    right (Element): The feature containing the geometry used as the right operand of the operation.
    maxError (ErrorMargin, default: null): The maximum amount of error tolerated when performing any necessary reprojection.
    proj (Projection, default: null): The projection in which to perform the operation. If not specified, the operation will be performed in a spherical coordinate system, and linear distances will be in meters on the sphere.

計算兩個地理要素之間的最小距離。
輸入?yún)?shù): 左操作數(shù)(計算結果)、右操作數(shù)(計算使用的要素)、容差、投影坐標系。
返回值:浮點型地理要素距離計算結果。

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

  • d3 (核心部分)選擇集d3.select - 從當前文檔中選擇一系列元素。d3.selectAll - 從當前文...
    謝大見閱讀 3,573評論 1 4
  • 聲明:作者翻譯論文僅為學習,如有侵權請聯(lián)系作者刪除博文,謝謝! 翻譯論文匯總:https://github.com...
    SnailTyan閱讀 12,895評論 3 12
  • 以前我對自己的未來無數(shù)次想象過 會做什么工作 遇見什么樣的人 過什么樣的生活 我統(tǒng)統(tǒng)都幻想過 給自己假設了很多各種...
    小緈運閱讀 237評論 0 0
  • 看完第四章了,邊看也邊在想,這位老師看來真不打算重復《真》里面的內容。 要想獲得緊密充滿愛的婚姻, 兩者的比例 需...
    周娜Zhou閱讀 220評論 0 0
  • 中學畢業(yè)那一年, 父親給予的一次旅行獎勵喚醒了我看世界的心。 那一年, 我十五歲, 爸爸為獎勵我以優(yōu)秀的成績中學畢...
    綠洲玫瑰閱讀 1,144評論 2 4

友情鏈接更多精彩內容