Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
343 views
in Technique[技术] by (71.8m points)

javascript - How to include an image property to a created feature when using .sampleregion in google earth engine

I have an image collection of which I want to sample the pixels located at three different locations. For this I use a feature collection. When using the .sampleRegions function it is possible to include the properties from the features using the property argument. However, I was wondering if it is also possible to include a property (namely the system:time_start) of the images in the sampled pixels (besides the bands)? I need the date of the pixels as I am exporting the results of the sampling to analyse it and the date is not included in the ID of the image.

Here I include a part of my script:

// Function to extract pixels from an imagecollection at location of stations
var sample = function(image){
  var sample = image.sampleRegions({
      collection: Stations
})
return sample
}

var sd = '2016-03-01'
var ed = '2020-12-31'

var WAPOR_ET = ee.ImageCollection("FAO/WAPOR/2/L1_AETI_D").filterDate(sd,ed)
var WAPOR_ET_sample = WAPOR_ET.map(sample).flatten()

Export.table.toDrive(WAPOR_ET_sample, 'WAPOR_ET')

This does not provide any timestamp to the sampled pixels. I have tried some things to include the date but so far without any results. So, is there any way to include a property such as a timestamp from an image in the sampled features? And if so how should I do this?

question from:https://stackoverflow.com/questions/65938401/how-to-include-an-image-property-to-a-created-feature-when-using-sampleregion-i

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...