GEE图表案例——不同区域各地类面积直方图分布图表(矢量面积叠加直方图图)

2024-04-15 08:43:00 浏览数 (2)

简介

在GEE中对不同区域面积统计的直方图绘制具体流程如下:

  1. 数据准备: 首先,需要准备用于面积统计的地理数据,可以是矢量数据,如行政边界、土地使用类型等。也可以是栅格数据,如分类结果、土地覆盖数据等。
  2. 区域划分: 根据需要统计的区域,将数据进行区域划分。可以使用GEE提供的几何图形对象,如点、线、面等,来定义统计区域。
  3. 面积统计: 使用GEE提供的统计工具来计算不同区域的面积。可以使用.reduceRegion()函数来计算每个区域内的像素数量,并通过计算像素数量与像素分辨率的乘积来得到面积。也可以使用.reduceRegions()函数来计算多个区域的面积。
  4. 数据处理和分析: 根据需要进行数据处理和分析。可以使用GEE提供的函数来计算总面积、平均面积、面积比例等指标。也可以将面积数据与其他数据进行关联分析,以探索不同区域的面积分布情况。
  5. 可视化: 最后,使用GEE提供的可视化工具将统计结果可视化。可以使用图表工具绘制直方图,将不同区域的面积分布情况以柱状图的形式展示出来。也可以使用地图工具将统计结果叠加到地图上,使用不同的颜色或密度表示不同区域的面积。

结果

函数

aggregate_array(property)

Aggregates over a given property of the objects in a collection, calculating a list of all the values of the selected property.

Arguments:

this:collection (FeatureCollection):

The collection to aggregate over.

property (String):

The property to use from each element of the collection.

Returns: List

Export.table.toDrive(collection, descriptionfolderfileNamePrefixfileFormatselectorsmaxVerticespriority)

Creates a batch task to export a FeatureCollection as a table to Drive. Tasks can be started from the Tasks tab.

Arguments:

collection (FeatureCollection):

The feature collection to export.

description (String, optional):

A human-readable name of the task. May contain letters, numbers, -, _ (no spaces). Defaults to "myExportTableTask".

folder (String, optional):

The Google Drive Folder that the export will reside in. Note: (a) if the folder name exists at any level, the output is written to it, (b) if duplicate folder names exist, output is written to the most recently modified folder, (c) if the folder name does not exist, a new folder will be created at the root, and (d) folder names with separators (e.g. 'path/to/file') are interpreted as literal strings, not system paths. Defaults to Drive root.

fileNamePrefix (String, optional):

The filename prefix. May contain letters, numbers, -, _ (no spaces). Defaults to the description.

fileFormat (String, optional):

The output format: "CSV" (default), "GeoJSON", "KML", "KMZ", or "SHP", or "TFRecord".

selectors (List<String>|String, optional):

A list of properties to include in the export; either a single string with comma-separated names or a list of strings.这个是当我们对矢量表格进行导出的时候,可以选择我们指定的属性进行导出

maxVertices (Number, optional):

Max number of uncut vertices per geometry; geometries with more vertices will be cut into pieces smaller than this size.

priority (Number, optional):

The priority of the task within the project. Higher priority tasks are scheduled sooner. Must be an integer between 0 and 9999. Defaults to 100.

ee.Filter.inList(leftFieldrightValuerightFieldleftValue)

Filter on metadata contained in a list.

Returns the constructed filter.

Arguments:

leftField (String, optional):

A selector for the left operand. Should not be specified if leftValue is specified.

rightValue (List<Object>|Object, optional):

The value of the right operand. Should not be specified if rightField is specified.

rightField (String, optional):

A selector for the right operand. Should not be specified if rightValue is specified.

leftValue (List<Object>|Object, optional):

The value of the left operand. Should not be specified if leftField is specified.

0 人点赞