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

该博客介绍了如何在GEE(Google Earth Engine)中利用矢量数据进行区域面积统计并绘制直方图。首先,准备地理数据,然后按区域划分,计算各区域面积。接着,通过GEE的aggregate_array、Export.table.toDrive等函数进行数据处理和分析,最后用ee.Filter.inList和ui.Chart.feature.byFeature等功能创建直方图,展示不同区域的面积分布。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

简介

在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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

此星光明

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值