Added new STAC-Item-Operator script (as an example)#324
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
4054308 to
3b0b10b
Compare
Signed-off-by: Ivan Birkmaier <ivanbirkmaier1@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds a new (example) “STAC Item Operator” Python component under src/claimed/components/geo/ that generates a STAC Item JSON from a GeoTIFF by filling a provided template, using GDAL for metadata extraction and filename parsing as a fallback for embeddings lacking embedded CRS.
Changes:
- Introduces
stac_item_operator.pywith a CLI entrypoint to produce a STAC Item JSON from a GeoTIFF + template. - Adds an example STAC Item template JSON (
stac/item_template.json) intended to be populated by the operator. - Adds component packaging + lock/config files (
pyproject.toml,uv.lock,.python-version) for the new geo component.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/claimed/components/geo/src/stac_item_operator.py | New operator implementation for extracting GeoTIFF metadata and emitting a STAC Item JSON. |
| src/claimed/components/geo/stac/item_template.json | Adds an example STAC Item template to be filled by the operator. |
| src/claimed/components/geo/pyproject.toml | Defines the new component package and dependencies (GDAL, pystac, shapely). |
| src/claimed/components/geo/uv.lock | Locks Python dependencies for the geo component. |
| src/claimed/components/geo/.python-version | Pins the component’s Python runtime version. |
| src/claimed/components/geo/src/init.py | Establishes the module package structure for the geo component. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| item.setdefault("properties", {}) | ||
| item["properties"]["datetime"] = _datetime_from_filename(stem) | ||
| item["properties"]["proj:epsg"] = meta["epsg"] |
There was a problem hiding this comment.
Fixed in commit 6fafccb. run() now conditionally sets properties['proj:epsg'] only when meta['epsg'] is not None, and actively removes the key from the item (via pop) when the code is unavailable, so no null/None projection metadata leaks into the STAC output.
3b0b10b to
90ee765
Compare
- _extract_tiff_metadata: treat any valid CRS WKT as georeferenced (not only when an authority code is present) and always reproject bbox/geometry to WGS 84 via an explicit CoordinateTransformation, so STAC output is always in lon/lat regardless of the file's native CRS. - run(): omit properties['proj:epsg'] when the EPSG code cannot be identified (epsg is None) instead of writing null/None into the STAC item. - Docstring: correct assets.embeddings.href description from 'relative filename' to 'full COS/S3 URL'. - Comment: replace 'relative path so the JSON is portable' with accurate description of the COS/S3 URL written to the asset href. - CLI: fix typos 'Url' -> 'URL' and 'were' -> 'where' in help text. - item_template.json: close the example polygon ring (last coordinate matches the first, making it valid GeoJSON). - item_template.json: remove leading space from 'licensing' value. Signed-off-by: Ivan Birkmaier <ivanbirkmaier1@gmail.com>
6fafccb to
aa1c1dc
Compare
What changes were proposed in this pull request?
I created a new operator for creating a STAC-Item which uses a script instead of an notebook
How was this pull request tested?
Tested it through unit test. Test were not added bc the changes only made in the example section and are not critical. Would just add noise to the project.
Developer's Certificate of Origin 1.1