## 2 Materials and Methods
### Data Extraction
#### 2.3.1 Geolocation Correction  
As reported by ESA in [25], the Sentinel-2 L1C products may have a geolocation offset error, even after performing correction procedures [26]. This is only a translational offset and rarely exceeds 1.5 pixels (15 meters), being usually at the sub-pixel level. Normally this error is negligible, because the areas in study are wide enough not to influence the results. In our case, due to the dimensions of the FB (125 m wide) and the spatial resolution of Sentinel-2 (10 m), there are few pixels to use for the FB object representation. So, on the presence of a geolocation error, pixels within the boundaries of an FB shapefile may correspond to vegetation. Additionally, pixels in the other boundary corresponding to the FB will be discarded.  
The geolocation correction method used was proposed in [27]. It detects subpixel deviations and is processing efficient. Due to the large amount of information on each observation and to speed up the offset calculations, a smaller area is clipped and used for the analysis, significantly reducing the computation time.  
Since the methodology is implemented in QGIS, the geographic coordinates of each pixel play an important role in this study. All the observations are compared with a reference image (the one used for the FB shapefiles design) and the deviations are registered. The algorithm starts with the computation of the maximum value of the cross-correlation between the images, using the Fast Fourier Transform. Then, to detect the subpixel errors, a refinement is made by up-sampling a just narrower region of interest and again the algorithm computes the cross-correlation on a neighbour of 1.5 pixels.  
The application of the corrections is done using the GDAL library from OSGeo project ([[https://gdal.org/](https://gdal.org/)]([https://gdal.org/](https://gdal.org/))). The images' coordinates are then adjusted correcting the geolocation of the pixels accordingly to the estimated values. After that, the observations are ready for data extraction. Figure 9 shows an example of a geolocation error, being (a) the reference image and (b) an observation of the same site in a different day with a computed geolocation error of 0.7 (7 m) and \(-0.11\) (1.1 m) in North/South and East/West directions, respectively. This is highlighted by the dashed green ellipsis in Figure 9b.  
To estimate the error of the geolocation method, two tests were made. The first (\(T1\)) applies to artificial geolocation errors, allowing an error estimation without uncertainty. The second (\(T2\)) tests a real scenario, where a set of images was compared with a reference and the uncertainty calculated.  
Figure 8: Diagram of the data extraction stage.  
In \(T1\) a set of images were randomly deviated between \(-1.5\) and \(1.5\) pixels in both directions, creating an artificial geolocation error. The proposed algorithm for the geolocation error estimation compared the deviated observation with the corresponding non-deviated observation. The normalized root mean square error (_NRMSE_), presented in Equation (1), between the calculated geolocation errors and the artificial geolocation errors generated was used as an evaluation metric of this algorithm. In Equation (1) _RMSE_ stands for root mean square error, (2), where \(y_{p}\) corresponds to the predicted values and \(T\) the number of samples.  
\[NRMSE=\ \frac{RMSE}{y_{max}-y_{min}} \tag{1}\]  
\[RMSE=\ \sqrt{\frac{\sum_{t=1}^{T}\left(y-y_{p}\right)^{2}}{T}} \tag{2}\]  
\(T2\) consisted of a comparison of a set of reference images with their corrected geolocation. Then, a smaller area from the corrected observation is clipped and geolocation errors are computed again. The new calculated values correspond to the uncertainty of the method. The error was estimated with the same metric of \(T1\), and the results are presented in Table 3. The results show that the maximum error, obtained in the worst-case scenario of \(15\)m deviation, will be less than \(1.5\) m, which is acceptable.