Estoy intentando obtener una tabla de una imagen 2d-array. Básicamente, la imagen (llamada segmentationInfo
) tiene este aspecto:
The 2-D ‘LandTrendr’ annual segmentation array looks like this:
[
[1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, ...] // Year list
[ 811, 809, 821, 813, 836, 834, 833, 818, 826, 820, 765, 827, 775, ...] // Source list
[ 827, 825, 823, 821, 819, 817, 814, 812, 810, 808, 806, 804, 802, ...] // Fitted list
[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...] // Is Vertex list
]
¿Cómo convierto esto en un exportable ¿Mesa?
Mi código comentado está más abajo.
// START INPUTS
var area = ee.Geometry.Polygon(
[[[-64.77293019260956, -2.4770762036671767],
[-64.77293019260956, -2.5250956006529575],
[-64.71902852024628, -2.5250956006529575],
[-64.71902852024628, -2.4770762036671767]]], null, false);
// define collection parameters
var startYear = 1986;
var endYear = 2020;
var startDay = '06-01';
var endDay = '12-31';
var index = 'B5';
var maskThese = ['cloud', 'shadow', 'water'];
// define landtrendr parameters
var runParams = {
maxSegments: 6,
spikeThreshold: 0.6,
vertexCountOvershoot: 3,
preventOneYearRecovery: true,
recoveryThreshold: 0.25,
pvalThreshold: 0.05,
bestModelProportion: 0.75,
minObservationsNeeded: 6
};
// define change parameters
var changeParams = {
delta: 'loss',
sort: 'greatest', //option: newtest, least, oldest, fastest, slowest
year: {checked:true, start:1986, end:2020},
mag: {checked:true, value:200, operator:'>'}, //default 200
dur: {checked:true, value:4, operator:'<'}, // default 4
preval: {checked:true, value:300, operator:'>'},
mmu: {checked:true, value:11},
};
// END INPUTS
// load the LandTrendr.js module
var ltgee = require('users/emaprlab/public:Modules/LandTrendr.js');
// add index to changeParams object
changeParams.index = index;
// run landtrendr
var lt = ltgee.runLT(startYear, endYear, startDay, endDay, area, index, [], runParams, maskThese);
print(lt, 'LandTrendr');
// selecting the LandTrendr band
var segmentationInfo = lt.select(['LandTrendr']); // subset the LandTrendr segmentation info
print(segmentationInfo, 'segmentInfo'); //It contains 4 rows and as many columns as there are annual observations for a given pixel through the time series.