I need to work with Sentinel-2 MSI: MultiSpectral Instrument, Level-2A collection in Google Earth Engine, but I need the ID (according to the naming convention in this format: MMM_MSIXXX_YYYYMMDDHHMMSS_Nxxyy_ROOO_Txxxxx_
How can I keep or display the ID of each image in a Sentinel-2 Collection after applying a function to mask clouds, bounds filters and date filters. Because I only get the properties system:time_start and system:index (highlighted in yellow in the image below).
You can find the code in this link
Best Answer
After applying a function, the image loses the original properties.
maskS2clouds
is doing that, not bounds and date filters as you mentioned.The function
copyProperties
lets you preserve properties after applying functions.The code you have preserves one property from the original image in this line (inside
maskS2clouds
function):Yo can change that line preserving all properties:
Or preserving only granule ID (with time stamp - recommended for further analysis -):