Closed agataelia closed 3 years ago
There are two data products here: segmentation and change characterization.
The segmentation array image is what you have shown as printed output, and the line of code is constructing the change characterization image.
The start year of the segment and the start year of the change differ by one year because it is not until the second year (segment start year + 1) that a change is actually detected (the year of detection in the change characterization product) we can't say precisely what year the change occurred because we are working with snapshot composites, the change occurred between one composite image and the next. For instance, if we are building summer composites (July-August) and a forest is harvested in Nov 2010, we don't see the change until the following year (summer, 2011). Duration is not adjusted because in the case where a segment is a single year e.g. 2010-2011, we did not want to assign a value of 0 for duration, because there was duration, maybe only a week of two if it is a clear cut harvest, but we don't have that temporal precision so round up to 1 year.
The addition of 1 year, however, should happen in the getChangeMap
function and not getSegmentData
. Originally getSegmentData
was written as an internal helper for getChangeMap
, but I decided to include it in the LT-GEE docs because it could be generically useful, but then never updated the code to do the year addition in getChangeMap
. See #12 for pending fix.
Hi @agataelia - I'm going to close this for now, reopen if anything is still unclear.
Hello! Me again, but I am really using your module and indeed thanks for creating such an interesting implementation and useful APIs.
Still in the getSegmentData function, I noticed that you increment of 1 every start year:
return ee.Image.cat([startYear.add(1), endYear, startVal, endVal, mag, dur, rate, dsnr])
So you basically assign every vertex to the segment at the left of the vertex. May I ask why did you make this choice? Is it in order not to have the endYear of a segment coincide with the startYear of the subsequent segment? Also the duration it is still returned as endYear - startYear so I found it a bit hard to wrap my head around it at first. Also, this leads to some segments of duration of 1 year having the same year as startYear and endYear, here an example:
So I wanted to ask you whether is there a computational reason behind this choice?
Thank you!