I want to run a classification application but feed it with time series data of Landsat imagery. I have a set of points (each point has an attribute of 'class') and an image collection LandsatCol. For my task, I need to extract time series of Landsat band values for each point over whole image collection, then make dataset of these sequences and their associated labels. What I was doing before was to first do a map and sampling in GEE as follows:

var LandsatSeries = 
    LandsatCol.map(function(image) {
      return image.sampleRegions({
        collection: points,
        properties: 'class',
        scale: 30

Then for each feature in the resulting feature collection I added an ID and also a date (using its system:index field) and exported the resulting 2-D table (band values as columns, each point in each image as rows) out of GEE. Then I had a second Python script to read the table and reorganize it to a 3-D dataset (points as first dimension, sequence time as the second dimension, and band values as the third dimension). Then I split it to training and testing partitions and do my classification.

But as my number of points grow, I am now thinking if there is a more efficient way of doing it but I couldn't find a clue how to define a map function over a collection to extract the time series for each point separately and wrap them in a 3-D feature collection directly. I also played a little with iterate function but I was not successful.

Any idea?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.