I am working with a Feature Collection in Google Earth Engine (GEE) to extract attribute values that will be used as parameter values in subsequent processes. Essentially, I’m using the Feature Collection as a configuration file. The collection contains data for multiple provinces, each with a set of parameters that will be applied later in the workflow.
In my workflow, I have an initial function that calls another function to perform the CCDC algorithm for a specified province and time period. The results from the CCDC analysis are then classified into different types of changes using the initial function.
I am extracting information from the FeatureCollection in GEE using the following code:
var prov_info = configFile.filter(ee.Filter.eq('NAMEUNIT', prov)).first();
var saveRegion = configFile.filter(ee.Filter.eq('NAMEUNIT', prov));
var bands = prov_info.get('BANDS').getInfo();
var list_bands = ee.List(bands.split(', '));
var bands_class = prov_info.get('CHG_BANDS').getInfo();
var list_bands_class = ee.List(bands_class.split(', '));
var description = prov_info.get('NAMEUNIT').getInfo();
var obs = prov_info.get('OBS').getInfo();
var thr = prov_info.get('THR').getInfo();
var model = prov_info.get('MODEL').getInfo();
While this code works, I am concerned that the current approach may not be efficient. Whenever I run it, the process takes time to start, causing the page to freeze and a pop-up warning appears, stating “the page is not responding” and asking whether to wait or exit. Eventually, the task is created, but the issue persists even when running the function for just one province, and it takes even longer for multiple provinces.
Is there a more efficient way to extract and use the information from the FeatureCollection to avoid these delays and freezing issues?