Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: backfill linz:slug attribute in collection.json files TDE-1315 #322

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

schmidtnz
Copy link
Contributor

Motivation

An update to topo-imagery (PR #1152) and argo-tasks (PR #1124) will add the the linz:slug attribute new collection.json files and expect this attribute to be present with release 4.8.0.
This pull request is to manually (one-off) add the new linz:slug attribute to all existing collection.json files in the elevation and imagery repositories.
Original motivation for this change is from BM-1076.

Modifications

Added linz:slug attribute to each collection.json file from its location in this repository.

#!/bin/bash
for dir in ./stac/*/*; do
  find $dir -type f -name 'collection.json' -print -exec sed -i 's;  "extent": {;  "linz:slug": "'${dir#./stac/*/}'",\n  "extent": {;g' {} \;
done

Verification

Checked for invalid json using jq

echo "Checking for invalid json files"
shopt -s globstar
for file in ./**/collection.json; do
  jq . "${file}" >/dev/null || echo "failed: ${file}"
done
echo "DONE"

Checked for files containing multiple linz:slug attributes:

echo "Files with number of slugs not equal to 1:"
grep -R --include='collection.json' 'linz:slug' . -c --color=no | grep -v 'n:1$'
echo "END OF LIST"

@schmidtnz schmidtnz marked this pull request as ready for review November 14, 2024 01:49
@schmidtnz schmidtnz requested review from a team as code owners November 14, 2024 01:49
@schmidtnz schmidtnz added this pull request to the merge queue Nov 14, 2024
Merged via the queue into master with commit 2a063bb Nov 14, 2024
3 checks passed
@schmidtnz schmidtnz deleted the feat/backfill-linz-slug-tde-1315 branch November 14, 2024 01:59
@schmidtnz schmidtnz changed the title feat: backfill linz:slug attribute in collection.json files feat: backfill linz:slug attribute in collection.json files TDE-1315 Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants