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: update existing Collection TDE-1359 #1224

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

paulfouquet
Copy link
Collaborator

@paulfouquet paulfouquet commented Dec 19, 2024

Motivation

When a provider supplies an update for an already published dataset, we would like to update the Collection accordingly to the new files supplied.

NOTE: The current workaround is to merge the existing data with the new supply in order to process them an recreate a new Collection. This not efficient.

Modifications

  • Load a STAC Collection from its published location
  • Update existing Item links and add new Item links
  • Recreate spatial and temporal extents based on new Item list
  • Update existing capture-area

Verification

  • Unit tests
  • Manual tests
  • Argo Workflows tests

@paulfouquet paulfouquet added the container Publish a container label Dec 19, 2024
@paulfouquet paulfouquet added container Publish a container and removed container Publish a container labels Feb 4, 2025
@paulfouquet paulfouquet changed the title feat: update existing Collection (WIP) feat: update existing Collection (WIP) TDE-1359 Feb 4, 2025
@paulfouquet paulfouquet added container Publish a container and removed container Publish a container labels Feb 4, 2025
@paulfouquet paulfouquet added container Publish a container and removed container Publish a container labels Feb 7, 2025
@paulfouquet paulfouquet added container Publish a container and removed container Publish a container labels Feb 12, 2025
@paulfouquet paulfouquet added container Publish a container and removed container Publish a container labels Feb 12, 2025
@paulfouquet paulfouquet added container Publish a container and removed container Publish a container labels Feb 18, 2025
@paulfouquet paulfouquet added container Publish a container and removed container Publish a container labels Feb 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Feb 25, 2025
### Motivation

When an existing capture-area geometry is being modified (polygon being
removed/added), as a result the polygons points can be moved around.
When the overall geometry ends up being the same (no visual change), we
prefer the capture-area geometry to not show a change (difference
between existing and new/re-processed one).

### Modifications

- Use
[shapely.normalize()](https://shapely.readthedocs.io/en/2.0.3/reference/shapely.normalize.html)
to keep the geometry consistent.

What does `shapely.normalize()`?

According to [the official
documentation](https://shapely.readthedocs.io/en/latest/geometry.html#canonical-form):

> - the coordinates of exterior rings follow a clockwise orientation and
interior rings have a counter-clockwise orientation
> - the starting point of rings is lower left
> - elements in collections are ordered by geometry type: by descending
dimension and multi-types first (MultiPolygon, Polygon, MultiLineString,
LineString, MultiPoint, Point). Multiple elements from the same type are
ordered from right to left and from top to bottom.

Because, "_the coordinates of exterior rings follow a clockwise
orientation and interior rings have a counter-clockwise orientation_" is
going against [RFC
7946](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6) - "_A
linear ring MUST follow the right-hand rule with respect to the area it
bounds, i.e., exterior rings are counterclockwise, and holes are
clockwise._", we need to apply `orient()` after `normalize()` the
geometry.

### Verification

- Unit tests
- Other tests to come  in #1224
@paulfouquet paulfouquet changed the title feat: update existing Collection (WIP) TDE-1359 feat: update existing Collection TDE-1359 Feb 25, 2025
@paulfouquet paulfouquet added container Publish a container and removed container Publish a container labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
container Publish a container
Development

Successfully merging this pull request may close these issues.

1 participant