Skip to content

Commit

Permalink
updated all landsat collection IDs from C01 to C02
Browse files Browse the repository at this point in the history
  • Loading branch information
sacridini committed Jul 26, 2024
1 parent 56927cf commit c7c0b9e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GEET using Landsat collection 2 will be available soon!
![ndvi](https://user-images.githubusercontent.com/7756611/28606761-031da9b8-71af-11e7-8e4a-3a716e8a9886.jpg)

## Documentation:
All functions implemented (Version 0.7.6 - Beta):
All functions implemented (Version 0.7.7 - Beta):
[svm](#svm)
[cart](#cart)
[rf](#rf)
Expand Down
78 changes: 39 additions & 39 deletions geet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1454,21 +1454,21 @@ var load_image = function (collection, year, roi, cloudFree) {
// Check collection
if (year >= 2013) {
if (collection === 'RAW') {
collection = 'LANDSAT/LC08/C01/T1';
collection = 'LANDSAT/LC08/C02/T1_RT';
} else if (collection === 'TOA') {
collection = 'LANDSAT/LC08/C01/T1_TOA';
collection = 'LANDSAT/LC08/C02/T1_TOA';
} else if (collection === 'SR') {
collection = 'LANDSAT/LC08/C01/T1_SR';
collection = 'LANDSAT/LC08/C02/T1_SR';
} else {
print("Error: Wrong collection type. Possible inputs: 'RAW', 'TOA' or 'SR'.");
}
} else if (year < 2013 && year >= 1985) {
if (collection === 'RAW') {
collection = 'LANDSAT/LT05/C01/T1';
collection = 'LANDSAT/LT05/C02/T1';
} else if (collection === 'TOA') {
collection = 'LANDSAT/LT05/C01/T1_TOA';
collection = 'LANDSAT/LT05/C02/T1_TOA';
} else if (collection === 'SR') {
collection = 'LANDSAT/LT05/C01/T1_SR';
collection = 'LANDSAT/LT05/C02/T1_SR';
} else {
print("Error: Wrong collection type. Possible inputs: 'RAW', 'TOA' or 'SR'.");
}
Expand Down Expand Up @@ -2139,9 +2139,9 @@ var build_annual_landsat_timeseries = function (roi) {

roi = typeof roi !== 'undefined' ? roi : ee.Geometry.Point([-43.0879, -22.8632]);

var ls5_sr = ee.ImageCollection("LANDSAT/LT05/C01/T1_SR"),
ls7_sr = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR"),
ls8_sr = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR");
var ls5_sr = ee.ImageCollection("LANDSAT/LT05/C02/T1_SR"),
ls7_sr = ee.ImageCollection("LLANDSAT/LE07/C02/T1_SR"),
ls8_sr = ee.ImageCollection("LANDSAT/LC08/C02/T1_SR");

var ls5_ic = ee.ImageCollection(ls5_sr)
.filterBounds(roi)
Expand Down Expand Up @@ -2352,42 +2352,42 @@ var landsat_timeseries_by_pathrow = function (type, path, row) {

switch (type) {
case 'raw':
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1')
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
/* var ls7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1')
/* var ls7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1')
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_RT')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
var all_ls_collection = ls5_collection.merge(ls8_collection);
return all_ls_collection;
case 'toa':
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1_TOA')
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1_TOA')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row))
.map(add_ndvi_ls);
/* var ls7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1_TOA')
/* var ls7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1_TOA')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row))
.map(add_ndvi_ls);
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row))
.map(add_ndvi_ls8);
var all_ls_collection = ls5_collection.merge(ls8_collection);
return all_ls_collection;
case 'sr':
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1_SR')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row))
.map(add_ndvi_ls);
/* var ls7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1_SR')
/* var ls7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1_SR')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row))
.map(add_ndvi_ls);
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_SR')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row))
.map(add_ndvi_ls8)
Expand Down Expand Up @@ -2428,34 +2428,34 @@ var landsat_timeseries_by_roi = function (type, roi) {

switch (type) {
case 'raw':
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1')
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1')
.filterBounds(roi);
/* var ls7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1')
/* var ls7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1')
.filterBounds(roi);
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1')
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_RT')
.filterBounds(roi);
var all_ls_collection = ls5_collection.merge(ls8_collection);
return all_ls_collection;
case 'toa':
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1_TOA')
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1_TOA')
.filterBounds(roi)
.map(add_ndvi_ls);
/* var ls7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1_TOA')
/* var ls7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1_TOA')
.filterBounds(roi)
.map(add_ndvi_ls);
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
*/ var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
.filterBounds(roi)
.map(add_ndvi_ls8);
var all_ls_collection = ls5_collection.merge(ls8_collection);
return all_ls_collection;
case 'sr':
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
var ls5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1_SR')
.filterBounds(roi)
.map(add_ndvi_ls);
/* var ls7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1_SR')
/* var ls7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1_SR')
.filterBounds(roi)
.map(add_ndvi_ls);*/
var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
var ls8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_SR')
.filterBounds(roi)
.map(add_ndvi_ls8)
.map(function (image) { return cloudmask_sr(image, image.select("pixel_qa")); });
Expand Down Expand Up @@ -2486,17 +2486,17 @@ var ls5_timeseries_by_pathrow = function (type, path, row) {

switch (type) {
case 'raw':
var l5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1')
var l5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l5_collection;
case 'toa':
var l5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1_TOA')
var l5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1_TOA')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l5_collection;
case 'sr':
var l5_collection = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
var l5_collection = ee.ImageCollection('LANDSAT/LT05/C02/T1_SR')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l5_collection;
Expand Down Expand Up @@ -2525,17 +2525,17 @@ var ls7_timeseries_by_pathrow = function (type, path, row) {

switch (type) {
case 'raw':
var l7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1')
var l7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l7_collection;
case 'toa':
var l7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1_TOA')
var l7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1_TOA')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l7_collection;
case 'sr':
var l7_collection = ee.ImageCollection('LANDSAT/LE07/C01/T1_SR')
var l7_collection = ee.ImageCollection('LLANDSAT/LE07/C02/T1_SR')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l7_collection;
Expand Down Expand Up @@ -2564,17 +2564,17 @@ var ls8_timeseries_by_pathrow = function (type, path, row) {

switch (type) {
case 'raw':
var l8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1')
var l8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_RT')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l8_collection;
case 'toa':
var l8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
var l8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l8_collection;
case 'sr':
var l8_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
var l8_collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_SR')
.filter(ee.Filter.eq('WRS_PATH', path))
.filter(ee.Filter.eq('WRS_ROW', row));
return l8_collection;
Expand Down Expand Up @@ -2670,7 +2670,7 @@ var mosaic_l5 = function (startDate, endDate, roi, showMosaic) {
if (endDate === undefined) error('mosaic_l5', 'You need to specify the end date of the image series.');


var l5 = ee.ImageCollection('LANDSAT/LT05/C01/T1_TOA');
var l5 = ee.ImageCollection('LANDSAT/LT05/C02/T1_TOA');

// Default params
showMosaic = typeof showMosaic !== 'undefined' ? showMosaic : true;
Expand Down Expand Up @@ -2726,7 +2726,7 @@ var mosaic_l7 = function (startDate, endDate, roi, showMosaic) {
if (startDate === undefined) error('mosaic_l7', 'You need to specify the start date of the image series.');
if (endDate === undefined) error('mosaic_l7', 'You need to specify the end date of the image series.');

var l7 = ee.ImageCollection('LANDSAT/LE07/C01/T1_TOA');
var l7 = ee.ImageCollection('LLANDSAT/LE07/C02/T1_TOA');

// Default params
showMosaic = typeof showMosaic !== 'undefined' ? showMosaic : true;
Expand Down Expand Up @@ -2782,7 +2782,7 @@ var mosaic_l8 = function (startDate, endDate, roi, showMosaic) {
if (startDate === undefined) error('mosaic_l8', 'You need to specify the start date of the image series.');
if (endDate === undefined) error('mosaic_l8', 'You need to specify the end date of the image series.');

var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA');
var l8 = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA');

// Default params
showMosaic = typeof showMosaic !== 'undefined' ? showMosaic : true;
Expand Down

0 comments on commit c7c0b9e

Please sign in to comment.