I am not able to use the Vegetation Change Tracker algorithm of GEE

34 Views Asked by At
// Load a Landsat image collection
var landsatCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1')
  .filterBounds(roi)
  .filterDate('2021-01-01', '2021-01-17')
  .sort('system:time_start');
  
print(landsatCollection)

// Map bands to match VCT requirements
var mappedCollection = landsatCollection.map(function(image) {
  return ee.Image([
    image.select('B3'),   // Band 3
    image.select('B4'),   // Band 4
    image.select('B5'),   // Band 5
    image.select('B7'),   // Band 7
    image.select('B10'),  // Thermal band for Landsat 8
    image.normalizedDifference(['B5', 'B4']).rename('NDVI'),  // NDVI calculation
    image.normalizedDifference(['B5', 'B6']).rename('DNBR'),  // DNBR calculation
    // Create a composite band
    image.expression('(B5 + B4 + B3) / 3', {
      B3: image.select('B3'),
      B4: image.select('B4'),
      B5: image.select('B5')
    }).rename('COMP')
  ]).copyProperties(image, ['system:time_start']);
});

Map.addLayer(mappedCollection,{},'mappedCollection')

// Define parameters for the VCT algorithm
var maxUd = 0.15;     
var minNdvi = 0.2;    
var forThrMax = 0.2;  
var nYears = 2;      

// Load Sentinel-2 LULC data
var sentinel2LULC = ee.Image("COPERNICUS/Landcover/100m/Proba-V-C3/Global/2019").clip(roi)


// Perform VCT analysis using the Sentinel-2 LULC as the land cover data
var vctResult = ee.Algorithms.TemporalSegmentation.VCT(mappedCollection, sentinel2LULC, maxUd, minNdvi, forThrMax, nYears);

// Visualize the result
Map.centerObject(roi, 10);
Map.addLayer(landsatCollection.first(), {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'Landsat image'); // Add a Landsat image
Map.addLayer(sentinel2LULC, {}, 'Sentinel-2 LULC'); // Visualize the Sentinel-2 LULC data
Map.addLayer(vctResult, {}, 'VCT result');  // Add the VCT result

Error: VCT result: Tile error: An internal error has occurred (request: 0b873a1f-84c1-46d7-8412-22895f41b44b) (computation: "e5aa2c9082969f4d12c078ff643bc5de")

It is showing internal error, when I have checked and searched , I have not found anything related to this. For the VCT algorithm we need two ImageCollections, one of Landsat with 10 bands and indices altogether and another one is the LULC of that year. For that case I was using the COPERNICUS/Landcover/100m/Proba-V-C3/Global/2019 product for LULC. For testing the script I have taken the date range in such a way so that only one image come in the image collection, but it is showing internal error.

0

There are 0 best solutions below