GEE使用表格生成要素集

使用表格生成要素集

主要功能

使用在線數(shù)據(jù)篩選生成要素集

代碼

// Create a FeatureCollection from a Fusion Table.

// Select "desert" features from the TNC Ecoregions fusion table.
var fc = ee.FeatureCollection('ft:1Ec8IWsP8asxN-ywSqgXWMuBaxI6pPaeh6hC64lA')
  .filter(ee.Filter.stringContains('ECO_NAME', 'desert'));

// Paint into a blank image.  Cast to byte() so we can use more than 1 color.
var image1 = ee.Image().byte().paint(fc, 'ECO_NUM');

// Display the image using random colors for each value.
Map.setCenter(-109.687, 30.524, 5);
Map.addLayer(image1.randomVisualizer());

步驟分析

  1. 使用在線數(shù)據(jù),篩選字段屬性
  2. 將篩選出的要素輸出到一個(gè)數(shù)據(jù)對(duì)象中
  3. 設(shè)置地圖中心,縮放等級(jí)
  4. 添加圖層,展示結(jié)果

主要方法

  1. ee.FeatureCollection()
    FeatureCollections can be constructed from the following arguments:
  • A string: assumed to be the name of a collection.
  • A single geometry.
  • A single feature.
  • A list of features.
  • A computed object: reinterpreted as a collection.
    Arguments:
    args (ComputedObject|Feature|FeatureCollection|Geometry|List<Object>|Number|String):
    The constructor arguments.
    column (String, optional):
    The name of the geometry column to use. Only useful with constructor type 1.
    Returns: FeatureCollection

創(chuàng)建要素集。

  1. ee.Filter.stringContains()
    Creates a unary or binary filter that passes if the left operand, a string, contains the right operand, also a string.
    Arguments:
    leftField (String, default: null):
    A selector for the left operand. Should not be specified if leftValue is specified.
    rightValue (Object, default: null):
    The value of the right operand. Should not be specified if rightField is specified.
    rightField (String, default: null):
    A selector for the right operand. Should not be specified if rightValue is specified.
    leftValue (Object, default: null):
    The value of the left operand. Should not be specified if leftField is specified.
    Returns: Filter

過濾器,判斷是否包含特定字符串。
輸入?yún)?shù):左屬性(字符串),右值,右屬性(字符串),左值

  1. ee.Image.paint()
    Paints the geometries of a collection onto an image.
    Arguments:
    this:image (Image):
    The image on which the collection is painted.
    featureCollection (FeatureCollection):
    The collection painted onto the image.
    color (Object, default: 0):
    Either the name of a color property or a number.
    width (Object, default: null):
    Either the name of a line-width property or a number.
    Returns: Image

將地理幾何要素輸出到為影像數(shù)據(jù)。
輸入?yún)?shù):影像(輸出結(jié)果),要素集,顏色,寬度

  1. ee.Image.randomVisualizer()
    Creates a vizualization image by assigning a random color to each unique value of the pixels of the first band. The first three bands of the output image will contan 8-bit R, G and B values, followed by all bands of the input image.
    Arguments:
    this:image (Image):
    Image with at least one band.
    Returns: Image

對(duì)影像數(shù)據(jù)的第一波段中的不同值賦予隨機(jī)顏色輸出彩色圖像,輸出結(jié)果為8位RGB影像
輸入?yún)?shù):影像對(duì)象(需至少包含一個(gè)波段)

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

相關(guān)閱讀更多精彩內(nèi)容

  • pyspark.sql模塊 模塊上下文 Spark SQL和DataFrames的重要類: pyspark.sql...
    mpro閱讀 9,918評(píng)論 0 13
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,854評(píng)論 0 10
  • 我們總是有一種錯(cuò)覺; 我們總是以自己最不喜歡的方式成熟; 我們對(duì)未來認(rèn)知,一半為偏見,另外一半就是猜測(cè); 未來總是...
    豐牛閱讀 193評(píng)論 0 1
  • 第二次學(xué)習(xí)的開始還是先熱身,隨后先復(fù)習(xí)上節(jié)課的直滑降幾趟,然后進(jìn)入今天的課程學(xué)習(xí)“J型轉(zhuǎn)彎”,顧名思義,就是在直滑...
    yuzideyuzi閱讀 657評(píng)論 0 0
  • 1.基本概念:DOM事件的級(jí)別DOM0 element.onclick = function(){} 在js中:添...
    唐卡豆子閱讀 346評(píng)論 0 0

友情鏈接更多精彩內(nèi)容