GEE缓冲区

要素缓冲区功能实现

主要功能

对指定要素执行缓冲区分析。
获取旧金山BART点位置,做2KM缓冲区,显示结果。

代码

// Feature buffer example.
// Display the area within 2 kilometers of San Francisco BART stations.

// Instantiate a FeatureCollection of BART locations in Downtown San Francisco
// (points).
var stations = [
  ee.Feature(
      ee.Geometry.Point(-122.42, 37.77), {'name': '16th St. Mission (16TH)'}),
  ee.Feature(
      ee.Geometry.Point(-122.42, 37.75), {'name': '24th St. Mission (24TH)'}),
  ee.Feature(
      ee.Geometry.Point(-122.41, 37.78),
      {'name': 'Civic Center/UN Plaza (CIVC)'})
];
var bartStations = ee.FeatureCollection(stations);

// Map a function over the collection to buffer each feature.
var buffered = bartStations.map(function(f) {
  return f.buffer(2000, 100); // Note that the errorMargin is set to 100.
});

Map.addLayer(buffered, {color: '800080'});

Map.setCenter(-122.4, 37.7, 11);

步骤分析

  1. 创建地理要素集,使用自定义坐标,属性
  2. 对要素集执行缓冲区
  3. 添加缓冲区图层
  4. 设置地图中心,缩放等级

主要方法

  1. ee.Feature.buffer()
    Returns the input buffered by a given distance. If the distance is positive, the geometry is expanded, and if the distance is negative, the geometry is contracted.
    Arguments:
    this:feature (Element): The feature the geometry of which is being buffered.
    distance (Float): The distance of the buffering, which may be negative. If no projection is specified, the unit is meters. Otherwise the unit is in the coordinate system of the projection.
    maxError (ErrorMargin, default: null): The maximum amount of error tolerated when approximating the buffering circle and performing any necessary reprojection. If unspecified, defaults to 1% of the distance.
    proj (Projection, default: null): If specified, the buffering will be performed in this projection and the distance will be interpreted as units of the coordinate system of this projection. Otherwise the distance is interpereted as meters and the buffering is performed in a spherical coordinate system.
    Returns: Feature

缓冲区功能,对地理要素进行换出去分析。
输入参数:进行缓冲区分析的地理要素,缓冲区分析距离,容差,坐标系

你可能感兴趣的:(GEE缓冲区)