developmentseed / eoAPI

[Active Development] Earth Observation API (Metadata, Raster and Vector services)
https://eoapi.dev
MIT License
197 stars 21 forks source link

Update S3 filekey parsing logic for Facebook demo #25

Closed leothomas closed 2 years ago

leothomas commented 2 years ago

In order avoid this issue (originally included as a note:... in the README text):

we need to do some manual editing here. Some files are duplicated (version 1.5.1 and 1.5.2) and we need to keep only one.

I opened the dataset's latest .vrt file (/hrsl_general-latest.vrt), which will not contain duplicate files for the same tile and pipe it to STDIN. I use grep to extract the file key (including the version number corresponding to the subfolder the COG is stored in, in this case v1 or v1.5) and sed to remove the first character of the extracted file key (>) which corresponds to a delimiting character from the .vrt XML file.

The facebook_items.json is built as before, and the result is a file that doesn't contain duplicate references for the same geospatial bounds