GEE使用表格生成要素集

使用表格生成要素集

主要功能

使用在线数据筛选生成要素集

代码

// 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. 使用在线数据,筛选字段属性
  2. 将筛选出的要素输出到一个数据对象中
  3. 设置地图中心,缩放等级
  4. 添加图层,展示结果

主要方法

  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

创建要素集。

  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

过滤器,判断是否包含特定字符串。
输入参数:左属性(字符串),右值,右属性(字符串),左值

  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

将地理几何要素输出到为影像数据。
输入参数:影像(输出结果),要素集,颜色,宽度

  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

对影像数据的第一波段中的不同值赋予随机颜色输出彩色图像,输出结果为8位RGB影像
输入参数:影像对象(需至少包含一个波段)

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 230,527评论 6 544
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 99,687评论 3 429
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 178,640评论 0 383
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 63,957评论 1 318
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 72,682评论 6 413
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 56,011评论 1 329
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 44,009评论 3 449
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 43,183评论 0 290
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 49,714评论 1 336
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 41,435评论 3 359
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 43,665评论 1 374
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 39,148评论 5 365
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 44,838评论 3 350
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 35,251评论 0 28
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 36,588评论 1 295
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 52,379评论 3 400
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 48,627评论 2 380

推荐阅读更多精彩内容

  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,487评论 0 13
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,415评论 0 10
  • 我们总是有一种错觉; 我们总是以自己最不喜欢的方式成熟; 我们对未来认知,一半为偏见,另外一半就是猜测; 未来总是...
    丰牛阅读 151评论 0 1
  • 第二次学习的开始还是先热身,随后先复习上节课的直滑降几趟,然后进入今天的课程学习“J型转弯”,顾名思义,就是在直滑...
    yuzideyuzi阅读 579评论 0 0
  • 1.基本概念:DOM事件的级别DOM0 element.onclick = function(){} 在js中:添...
    唐卡豆子阅读 298评论 0 0