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: generate initial collection-related STAC metadata TDE-1300 #1124

Merged
merged 25 commits into from
Nov 6, 2024

Conversation

amfage
Copy link
Contributor

@amfage amfage commented Nov 4, 2024

Motivation

Set up metadata that is required for the standardising workflow:
linz-slug: required for Basemaps URL creation, will also be used for generating the ODR path.
collection-id: required for creating STAC metadata

Modification

Add a new command, stac-setup to create these parameter files for Argo Workflows to use.

The stac-setup command is based on the generate-path command. Once the linz:slug field has been populated throughout existing collections, the generate-path command will be updated to use the slug for ODR path generation.

Checklist

  • Tests updated
  • Docs updated
  • Issue linked in Title

@amfage amfage changed the title feat: generate standardising STAC metadata TDE-1283 feat: generate standardising STAC metadata TDE-1300 Nov 4, 2024
@amfage amfage marked this pull request as ready for review November 4, 2024 19:41
@amfage amfage requested review from a team as code owners November 4, 2024 19:41
src/commands/stac-setup/stac.setup.ts Outdated Show resolved Hide resolved
src/commands/stac-setup/stac.setup.ts Outdated Show resolved Hide resolved
src/commands/stac-setup/stac.setup.ts Outdated Show resolved Hide resolved
src/commands/stac-setup/stac.setup.ts Outdated Show resolved Hide resolved
src/commands/stac-setup/stac.setup.ts Outdated Show resolved Hide resolved
src/commands/stac-setup/stac.setup.ts Outdated Show resolved Hide resolved
@amfage amfage marked this pull request as draft November 4, 2024 20:47
@amfage amfage marked this pull request as ready for review November 5, 2024 01:17
@amfage amfage changed the title feat: generate standardising STAC metadata TDE-1300 feat: generate collection-related STAC metadata TDE-1300 Nov 5, 2024
@amfage amfage changed the title feat: generate collection-related STAC metadata TDE-1300 feat: generate initial collection-related STAC metadata TDE-1300 Nov 5, 2024
amfage and others added 2 commits November 5, 2024 15:47
Co-authored-by: paulfouquet <86932794+paulfouquet@users.noreply.github.com>
@amfage amfage marked this pull request as draft November 5, 2024 03:35
@amfage amfage marked this pull request as ready for review November 5, 2024 03:42
@amfage amfage added this pull request to the merge queue Nov 6, 2024
Merged via the queue into master with commit e30dff9 Nov 6, 2024
2 checks passed
@amfage amfage deleted the feat/generate-slug-id-tde-1283 branch November 6, 2024 21:51
@github-actions github-actions bot mentioned this pull request Nov 6, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 13, 2024
🤖 I have created a release *beep* *boop*
---


## [4.8.0](v4.7.0...v4.8.0)
(2024-11-12)


### Features

* attempt to remove slivers by dropping small polygons TDE-1130
([#1119](#1119))
([aa1f931](aa1f931))
* generate initial collection-related STAC metadata TDE-1300
([#1124](#1124))
([e30dff9](e30dff9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-merge-queue bot pushed a commit to linz/imagery that referenced this pull request Nov 14, 2024
### Motivation
An update to `topo-imagery` ([PR
#1152](linz/topo-imagery#1152)) and `argo-tasks`
([PR #1124](linz/argo-tasks#1124)) will add the
the `linz:slug` attribute new `collection.json` files and expect this
attribute to be present with [release
4.8.0](linz/argo-tasks#1127).
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"
```
github-merge-queue bot pushed a commit to linz/elevation that referenced this pull request Nov 14, 2024
### Motivation
An update to `topo-imagery` ([PR
#1152](linz/topo-imagery#1152)) and `argo-tasks`
([PR #1124](linz/argo-tasks#1124)) will add the
the `linz:slug` attribute new `collection.json` files and expect this
attribute to be present with [release
4.8.0](linz/argo-tasks#1127).
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"
```
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