Я работаю с алгоритмом Landtrendr в Gee. Я хочу использовать платтер временных рядов Pixel для моего собственного ImageCollection на основе Landsat 4-9. Когда я применяю Landtrendr, используя свою собственную функцию NDVI, результат выглядит довольно хорошо. Но когда я применяю тот же код, но с NDVI, предоставленным API Landtrendr, не кажется, что алготифм определяет правильные разбитые моменты. Я понятия не имею, как исправить и изменить это, потому что мне нужно использовать NDVI, предоставленный API, иначе GetChangeMap не работает. Я очень благодарен за любые советы или советы. < /P>
```
// LANDTRENDR LANDSAT TIME SERIES ANALYSIS
// Define coordinates for the Time Series Plot
var long = 55.40631284191384
var lat = -4.6561753011485605
var coordinates = ee.Geometry.Point(long, lat);
// Define AOI to download Landsat scenes for //
var my_aoi = geometry;
// add to map
Map.addLayer(my_aoi, {}, 'aoi');
// Zoom to aoi
Map.centerObject(my_aoi, 15);
// Define Time Range for your Time Series Analysis
var startYear = 1990 // what year do you want to start the time series, Note: no
images before 1990
var endYear = 2024; // what year do you want to end the time series
var startDay = '01-01'; // what is the beginning of date filter | month-day
var endDay = '12-31'; // what is the end of date filter | month-day
// Defne LandtrendR parameters
var run_params = {
maxSegments: 6,
spikeThreshold: 0.9,
vertexCountOvershoot: 3,
preventOneYearRecovery: true,
recoveryThreshold: 0.25,
pvalThreshold: 0.05,
bestModelProportion: 0.75,
minObservationsNeeded: 6
};
// define the sign of spectral delta for vegetation loss for the segmentation index -
var distDir = -1;
// define index for the Time Series Analysis //
// NDVI
var NDVI = function(img) {
var index = img.normalizedDifference(['NIR', 'R']) //
calculate normalized difference of band 4 and band 7 (B4-B7)/(B4+B7)
.multiply(1000) // ...scale
results by 1000 so we can convert to int and retain some precision
.select([0], ['NDVI'])
.set('system:time_start',
img.get('system:time_start'));
return index ;
};
//
///// ----------------------- \\\\\
/// Prepare Landsat Collections \\\
///// ----------------------- \\\\\
// Scaling factor is needed for Landsat
function applyScaleFactors(image) {
var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
return image.addBands(opticalBands, null, true)
.addBands(thermalBands, null, true);
}
// functions to select and rename bands for Landsat-4/5/7
function renameBandsTM_ETM(image) {
var bands = ['SR_B1', 'SR_B2', 'SR_B3', 'SR_B4', 'SR_B5', 'SR_B7'];
var new_bands = ['B', 'G', 'R', 'NIR', 'SWIR1', 'SWIR2'];
return image.select(bands).rename(new_bands);
}
// functions to select and rename bands for Landsat-8
function renameBandsOLI(image) {
var bands = ['SR_B2', 'SR_B3', 'SR_B4', 'SR_B5', 'SR_B6', 'SR_B7'];
var new_bands = ['B', 'G', 'R', 'NIR', 'SWIR1', 'SWIR2'];
return image.select(bands).rename(new_bands);
}
// Mask clouds, snow and cloud shadows based on the pixel_qa band
var cloudMask = function (image) {
// Get the pixel QA band.
var qa = image.select('QA_PIXEL');
// Bits 3 and 5 are cloud shadow and cloud, respectively.
// Use LeftShift-Operators to define Bit values
var CloudShadowBitValue = (1
Подробнее здесь: https://stackoverflow.com/questions/795 ... al-indices
Landtrendr на спектральных индексах GEE ⇐ Javascript
Форум по Javascript
1744126934
Anonymous
Я работаю с алгоритмом Landtrendr в Gee. Я хочу использовать платтер временных рядов Pixel для моего собственного ImageCollection на основе Landsat 4-9. Когда я применяю Landtrendr, используя свою собственную функцию NDVI, результат выглядит довольно хорошо. Но когда я применяю тот же код, но с NDVI, предоставленным API Landtrendr, не кажется, что алготифм определяет правильные разбитые моменты. Я понятия не имею, как исправить и изменить это, потому что мне нужно использовать NDVI, предоставленный API, иначе GetChangeMap не работает. Я очень благодарен за любые советы или советы. < /P>
```
// LANDTRENDR LANDSAT TIME SERIES ANALYSIS
// Define coordinates for the Time Series Plot
var long = 55.40631284191384
var lat = -4.6561753011485605
var coordinates = ee.Geometry.Point(long, lat);
// Define AOI to download Landsat scenes for //
var my_aoi = geometry;
// add to map
Map.addLayer(my_aoi, {}, 'aoi');
// Zoom to aoi
Map.centerObject(my_aoi, 15);
// Define Time Range for your Time Series Analysis
var startYear = 1990 // what year do you want to start the time series, Note: no
images before 1990
var endYear = 2024; // what year do you want to end the time series
var startDay = '01-01'; // what is the beginning of date filter | month-day
var endDay = '12-31'; // what is the end of date filter | month-day
// Defne LandtrendR parameters
var run_params = {
maxSegments: 6,
spikeThreshold: 0.9,
vertexCountOvershoot: 3,
preventOneYearRecovery: true,
recoveryThreshold: 0.25,
pvalThreshold: 0.05,
bestModelProportion: 0.75,
minObservationsNeeded: 6
};
// define the sign of spectral delta for vegetation loss for the segmentation index -
var distDir = -1;
// define index for the Time Series Analysis //
// NDVI
var NDVI = function(img) {
var index = img.normalizedDifference(['NIR', 'R']) //
calculate normalized difference of band 4 and band 7 (B4-B7)/(B4+B7)
.multiply(1000) // ...scale
results by 1000 so we can convert to int and retain some precision
.select([0], ['NDVI'])
.set('system:time_start',
img.get('system:time_start'));
return index ;
};
//
///// ----------------------- \\\\\
/// Prepare Landsat Collections \\\
///// ----------------------- \\\\\
// Scaling factor is needed for Landsat
function applyScaleFactors(image) {
var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);
return image.addBands(opticalBands, null, true)
.addBands(thermalBands, null, true);
}
// functions to select and rename bands for Landsat-4/5/7
function renameBandsTM_ETM(image) {
var bands = ['SR_B1', 'SR_B2', 'SR_B3', 'SR_B4', 'SR_B5', 'SR_B7'];
var new_bands = ['B', 'G', 'R', 'NIR', 'SWIR1', 'SWIR2'];
return image.select(bands).rename(new_bands);
}
// functions to select and rename bands for Landsat-8
function renameBandsOLI(image) {
var bands = ['SR_B2', 'SR_B3', 'SR_B4', 'SR_B5', 'SR_B6', 'SR_B7'];
var new_bands = ['B', 'G', 'R', 'NIR', 'SWIR1', 'SWIR2'];
return image.select(bands).rename(new_bands);
}
// Mask clouds, snow and cloud shadows based on the pixel_qa band
var cloudMask = function (image) {
// Get the pixel QA band.
var qa = image.select('QA_PIXEL');
// Bits 3 and 5 are cloud shadow and cloud, respectively.
// Use LeftShift-Operators to define Bit values
var CloudShadowBitValue = (1
Подробнее здесь: [url]https://stackoverflow.com/questions/79562505/landtrendr-on-gee-spectral-indices[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия