GEE影像数据集裁剪

影像数据集裁剪过滤

主要功能

对影像数据集进行要素裁剪,使用边界来获取特定区域数据。

代码

// Filter an image collection by date and region to make a
// median pixel composite.
//
// See also: ClippedComposite, which crops the output image
// instead of filtering the input collection.

// Filter to only include images intersecting Colorado or Utah.
var polygon = ee.Geometry.Polygon({
  coords: [[[-109.05, 37.0], [-102.05, 37.0], [-102.05, 41.0], // Colorado
            [-109.05, 41.0], [-111.05, 41.0], [-111.05, 42.0], // Utah
            [-114.05, 42.0], [-114.05, 37.0], [-109.05, 37.0]]],
  geodesic: false
});

// Create a Landsat 7 composite for Spring of 2000, and filter by
// the bounds of the FeatureCollection.
var collection = ee.ImageCollection('LANDSAT/LE07/C01/T1')
    .filterDate('2000-04-01', '2000-07-01')
    .filterBounds(polygon);

// Compute the median in each band, in each pixel.
var median = collection.median();

// Select the red, green and blue bands.
var result = median.select('B3', 'B2', 'B1');
Map.addLayer(result, {gain: [1.4, 1.4, 1.1]});
Map.setCenter(-110, 40, 5);

步骤分析

  1. 创建多边形对象,使用自定义要素坐标来定义
  2. 创建影像数据集对象,使用名称,日期,多边形来裁剪
  3. 计算影像数据集的中值
  4. 选择用于展示结果的三个波段
  5. 添加图层,定义图层增强
  6. 设置地图中心,缩放等级

主要方法

  1. ee.Geometry.Polygon()
    Constructs an ee.Geometry describing a polygon.
    For convenience, varargs may be used when all arguments are numbers. This allows creating geodesic EPSG:4326 Polygons with a single LinearRing given an even number of arguments, e.g. ee.Geometry.Polygon(aLng, aLat, bLng, bLat, ..., aLng, aLat).
    Arguments:
    coords (List<Geometry>|List<List<List<Number>>>|List<Number>):
    A list of rings defining the boundaries of the polygon. May be a list of coordinates in the GeoJSON 'Polygon' format, a list of ee.Geometry describing a LinearRing, or a list of number defining a single polygon boundary.
    proj (Projection, optional):
    The projection of this geometry. The default is the projection of the inputs, where Numbers are assumed to be EPSG:4326.
    geodesic (Boolean, optional):
    If false, edges are straight in the projection. If true, edges are curved to follow the shortest path on the surface of the Earth. The default is the geodesic state of the inputs, or true if the inputs are numbers.
    maxError (ErrorMargin, optional):
    Max error when input geometry must be reprojected to an explicitly requested result projection or geodesic state.
    evenOdd (Boolean, optional):
    If true, polygon interiors will be determined by the even/odd rule, where a point is inside if it crosses an odd number of edges to reach a point at infinity. Otherwise polygons use the left- inside rule, where interiors are on the left side of the shell's edges when walking the vertices in the given order. If unspecified, defaults to true.
    Returns: Geometry.Polygon

创建一个ee地理多边形对象。方便起见,也可以使用参数全部为数字形式,来定义一个多边形。默认的投影为EPSG:4326,需要输入一个环的坐标(经度1纬度1,经度2纬度2,经度3纬度3,。。。经度1纬度1)
输入参数:
拐点坐标,投影,geodesic,maxError,evenOdd

  1. ee.Collection.filterBounds()
    Shortcut to filter a collection by geometry. Items in the collection with a footprint that fails to intersect the bounds will be excluded when the collection is evaluated.
    This is equivalent to this.filter(ee.Filter.bounds(...)).
    Returns the filtered collection.
    Arguments:
    this:collection (Collection):
    The Collection instance.
    geometry (Feature|Geometry):
    The geometry to filter to.
    Returns: Collection

空间"相交"操作,选择重叠部分。
输入参数:影像数据集,地理要素对象。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,449评论 0 10
  • 【软件名称】 jquery.mentionsInput 【软件描述】 看看上面的截图,你能明白该插件的用途了吗?当...
    小拾一阅读 329评论 0 0
  • 另一边雨幽屋里传来一声尖叫,原来是丫鬟小桃,小桃才发现自家小姐并不在屋里,父母知道后,无奈之下只好把她的妹妹慕容雨...
    夜魅蓝阅读 817评论 0 0
  • 文:圆子与墨 儿大南北各去, 孤老树下棚居; 寒鸦声衰十里, 哪堪雨雪来急?!
    缘子与墨阅读 346评论 0 0
  • 前几天一位学弟和约我吃饭,向我袒露了他目前的一些苦恼,他说他很喜欢写作,毕生梦想就是当作家,也一直笔耕不懈,但投稿...
    张嘉豪sky阅读 1,634评论 11 25