公告 :所有在
2025 年 4 月 15 日 之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件 ,才能继续使用 Earth Engine。
发送反馈
放下你的酒杯 让幸福伴你左右——安全在我心中演讲稿
将元数据属性从一个元素复制到另一个元素。
百度 随后,陈长春通过对当地人民的调查了解,龙华人几乎都是清朝初年的“湖广填四川”移民大迁徙中几经辗转,来到龙华并在这里生养繁殖。
用法 返回 FeatureCollection. copyProperties (source , properties , exclude )
元素
参数 类型 详细信息 此:destination
元素,默认值:null 要替换其属性的对象。 source
元素,默认值:null 要从中复制属性的对象。 properties
列表,默认值:null 要复制的属性。如果省略,则会复制所有常规(即非系统)属性。 exclude
列表,默认值:null 复制所有属性时要排除的属性列表。如果指定了 properties,则不得指定此参数。
示例
代码编辑器 (JavaScript)
// Import a Landsat 8 surface reflectance image to sample.
var image = ee . Image ( 'LANDSAT/LC08/C02/T1_L2/LC08_038032_20170722' )
// Select the optical bands.
. select ([ 'SR_B.' ]);
// Get the image geometry to define the geographical bounds of the sample.
var imageBounds = image . geometry ();
// Sample the image at a set of random points; a feature collection is returned.
var pointSampleFc = image . sample (
{ region : imageBounds , scale : 30 , numPixels : 5 , geometries : true });
// Copy image properties to the FeatureCollection; three options follow.
print ( 'All non-system image properties copied to the FeatureCollection' ,
pointSampleFc . copyProperties ( image ));
print ( 'Selected image properties copied to the FeatureCollection' ,
pointSampleFc . copyProperties ({
source : image ,
properties : [ 'system:time_start' , 'SPACECRAFT_ID' ]
}));
print ( 'All but selected image properties copied to the FeatureCollection' ,
pointSampleFc . copyProperties ({
source : image ,
exclude : [ 'TIRS_SSM_MODEL' , 'TIRS_SSM_POSITION_STATUS' ]
}));
Python 设置
如需了解 Python API 和如何使用 geemap
进行交互式开发,请参阅
Python 环境 页面。
import ee
import geemap.core as geemap
Colab (Python)
# Import a Landsat 8 surface reflectance image to sample.
image = ee . Image ( 'LANDSAT/LC08/C02/T1_L2/LC08_038032_20170722' ) . select (
# Select the optical bands.
[ 'SR_B.' ])
# Get the image geometry to define the geographical bounds of the sample.
image_bounds = image . geometry ()
# Sample the image at a set of random points; a feature collection is returned.
point_sample_fc = image . sample (
** { 'region' : image_bounds , 'scale' : 30 , 'numPixels' : 5 , 'geometries' : True })
# Copy image properties to the FeatureCollection; three options follow.
print ( 'All non-system image properties copied to the FeatureCollection:' ,
point_sample_fc . copyProperties ( image ) . getInfo ())
print ( 'Selected image properties copied to the FeatureCollection:' ,
point_sample_fc . copyProperties ( ** {
'source' : image ,
'properties' : [ 'system:time_start' , 'SPACECRAFT_ID' ]
}) . getInfo ())
print ( 'All but selected image properties copied to the FeatureCollection:' ,
point_sample_fc . copyProperties ( ** {
'source' : image ,
'exclude' : [ 'TIRS_SSM_MODEL' , 'TIRS_SSM_POSITION_STATUS' ]
}) . getInfo ())
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
需要向我们提供更多信息?
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-04。"],[[["`copyProperties()` transfers metadata properties from a source element to a destination element in Earth Engine."],["You can copy all properties, a specified list of properties, or all properties except those in an exclusion list."],["This function is useful for maintaining metadata consistency when manipulating Earth Engine objects, such as copying image metadata to a FeatureCollection derived from it."],["The function returns the modified destination element with the copied properties."]]],[]]