我们有时候需要将一个影像数据按照经纬度去提取,但是有没有那么多坐标,我们应该怎么做?起始很简单,直接给影像添加一个经纬度生成波段,然后利用sample在生成点的过程中,就会自带这个属性单位内的经纬度,主要要根据你的需要设定分辨率大小即可。
所需用大奥的函数:
sample(region,scale,projection,factor,numPixels,seed,dropNulls,tileScale,geometries)
Samples the pixels of an image, returning them as a FeatureCollection. Each feature will have 1 property per band in the input image. Note that the default behavior is to drop features that intersect masked pixels, which result in null-valued properties (see dropNulls argument).
对图像的像素进行采样,将它们作为 FeatureCollection 返回。每个特征在输入图像中的每个波段都有 1 个属性。请注意,默认行为是删除与屏蔽像素相交的特征,这会导致空值属性(请参阅 dropNulls 参数)。
Arguments:
this:image(Image):
The image to sample.
region(Geometry, default: null):