#javascript #google-earth-engine
#язык JavaScript #google-земля-движок
Вопрос:
Я пытаюсь получить сумму моей информации о пикселях (содержание углерода по пикселям) и номер пикселя изображения в свойстве BIOTYP8 моих коллекций объектов. На выходе должно быть содержание углерода и площадь различных кодов свойства BIOTYP8. Пример: 0836-это березовый лес, в котором хранится общее количество пикселей X и общая сумма углерода XXXX. Я попытался растеризировать коллекцию объектов, добавить полосы к углеродному изображению, но анализ не сработает. Может ли кто-нибудь помочь или у кого есть лучший подход?
Map.addLayer(JRC18C,vizParamsC,'JRC18 carbon content'); Map.addLayer(ESA18C,vizParamsC,'ESA18 carbon content'); Map.addLayer(CIRB_f,{},'Forest Biotopes'); var CIRB_fn=CIRB_f.map(function(feature){ var num = ee.Number.parse(feature.get('BIOTYP8')); return feature.set('BIOTYP8', num); }); function getCols(tableMetadata) { print(tableMetadata.columns); } ///Check on pixel in total covered by Biotopes var Biot_pixelDic_ESAC = ESA18C.reduceRegion({ reducer: ee.Reducer.count(), geometry: CIRB_f, scale: 100, maxPixels: 1e9 }); print('Area of ESA forest in CIRB', Biot_pixelDic_ESAC); var Biot_pixelDic_JRCC = JRC18C.reduceRegion({ reducer: ee.Reducer.count(), geometry: CIRB_f, scale: 100, maxPixels: 1e9 }); print('Area of JRC forest in CIRB', Biot_pixelDic_JRCC); //Total stored carbon in biotopes classes var Biot_sum_ESAC = ESA18C.reduceRegion({ reducer: ee.Reducer.sum(), geometry: CIRB_f, scale: 100, maxPixels: 1e9 }); print('Sum of ESA forest carbon in CIRB', Biot_sum_ESAC); var Biot_sum_JRCC = JRC18C.reduceRegion({ reducer: ee.Reducer.sum(), geometry: CIRB_f, scale: 100, maxPixels: 1e9 }); print('Area of JRC forest carbon in CIRB', Biot_sum_JRCC); /////////////////// Area by class //transform vector to image var CIRB_fi = CIRB_fn.filter(ee.Filter.notNull(['BIOTYP8'])) .reduceToImage({ properties: ['BIOTYP8'], reducer: ee.Reducer.first(), }); Map.setCenter(13.5145, 52.924, 12); Map.addLayer(CIRB_fi, {},'CIRB forest image'); //merge image bands var ESA18C_bioclass= CIRB_fi.addBands(ESA18C); Map.addLayer(ESA18C_bioclass,{},'ESA18C Biotopes'); var DIcBiotopes_ESAC = ESA18C_bioclass.reduceRegion({ reducer: ee.Reducer.sum().group({ groupField: 1, groupName: 'BIOTYP8', }), geometry: CIRB_f.geometry, scale: 100, crs:3035, maxPixels: 1e9 }); print('Biotypes of ESA forest', Biotopes_ESAC);
Который получает эту ошибку для строки var DIcBiotopes_ESAC:
Invalid GeoJSON geometry: undefined