Add fid features in SampleExtraction
When pixel values are extracted using SampleExtraction app with the optional parameter "out", the columns of the generated vector file by SampleSelection are kept. However, the fid feature (provided by the shapefile or the sqlite file) is lost. As far as I understand, since the file is possibly written using multiples threads, the initial pixel row order of the input sampling positions is lost and without the fid feature it is not possible to recover pixels extracted from different input images using the same input sampling position.
My example to make it clear: I need to extract the raw pixels, their corresponding Theia masks and their gap filled version. I use the same input sampling positions, but the output samples are in different raw orders. And I can't make a one to one affectation between raw, mask and gap filled extracted values. Because my data have a lot of temporal/spectral feature, the final files are CSV.
I solved my problem by creating a new feature in the vector file outputed by the SampleSelection app, before using the SampleExtraction app. I can then join the three CSVs according to this new feature.
But SampleExtraction could be modified to export the fid (or the row number) of the input sampling positions.