NASA-IMPACT / NASA-IMPACT/veda-data

Fix STAC `proj:` values and project extension schema for existing items

Open
#57 34 comments 0 reactions 2 assignees View on GitHub

@omshinde is already working on this.

Since Apr 17, 2023.

Dominant language
Jupyter Notebook
Stars
9
Forks
1
Avg merge
1d 9m
Merged PRs (30d)
1

Description

  1. projection extension schema version should be v1.1.0
  2. proj:epsg should be type int and proj:shape should be type List[int]

Context

I was debugging an issue on VEDA where epsg was being read as a float and causing some issues.

import pystac
from pystac.extensions.projection import ProjectionExtension

item = pystac.Item.from_file("https://staging-stac.delta-backend.com/collections/nceo_africa_2017/items/AGB_map_2017v0m_COG")
print(ProjectionExtension.has_extension(item))  # False
print(item.properties["proj:epsg"])  # 4326.0

I decided that maybe there was a mismatch between the STAC version and the extension version, so I pulled the file locally (using wget) and changed proj ext schema version from v1.0.0 to v1.1.0

import pystac
from pystac.extensions.projection import ProjectionExtension

item = pystac.Item.from_file("AGB_map_2017v0m_COG")
print(ProjectionExtension.has_extension(item))  # True
print(item.properties["proj:epsg"])  # 4326.0

This time the proj ext is understood, but since "proj:epsg" is stored as a float in the STAC item json it is in the properties dict as a float.

I opened a ticket on pystac to track try to get type coersion based on extension support (https://github.com/stac-utils/pystac/issues/1044) but in this is still something that VEDA should correct in its own STAC.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.