I am attempting to generate 50 random points per land use class through Google Earth Engine. I have performed this operation before on an earlier instance, where the inputs were the following
(1) SRTMGL1 data (2) Table asset data (polygons/points)
However, now I am attempting to repeat the same operation i.e. randomly sample from a FeatureCollection, but instead of sampling 50 random points from polygons subsetted according to their land use class, I am wanting sample from points
i.e. From a vector layer made up of points (not polygons), randomly select 50 points per land use class, and NOT randomly select points within polygons.
However, although the code works, the CSVs I generated after running the code are empty, and there are no entries. I found then that the ee.Filter.eq operation that I applied in my code did not actually filter anything, and after troubleshooting via print(var), it showed zero elements.
After comparing my two scripts, I postulated that the error in filtering arises because now, my Table data has values for land use classifiers under the feature 'id' and 'id2' (corresponding to 2 levels of land cover classification) to be in 'Long' format instead of the 'String' format that I previously managed to get it working on.
Is there a way to convert 'Long' data to 'String' data? Or is there something else wrong with my code/workflow? Or is there a way to properly code to filter from 'Long' data?
The link to my current script is https://code.earthengine.google.com/3a5e3bbffea2c37ca6393b8d5df75d06