-
Notifications
You must be signed in to change notification settings - Fork 0
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
set up STAC metadata #2
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks really good! I love the use of dataclasses and pystac
PARTITION_FORMAT, | ||
) | ||
|
||
COLLECTION_DESCRIPTION_FORMAT = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd suggest a multi line string to make this easier to read
COLLECTION_DESCRIPTION_FORMAT = """\
## Overture Maps - {theme}
This collection contains items for the {theme} theme.
{theme_description}
etc
def theme_description(self) -> str: | ||
"""Scrape theme description from OvertureMaps/docs repo""" | ||
# Get the raw content | ||
raw_url = f"https://raw.githubusercontent.com/OvertureMaps/docs/refs/heads/main/docs/guides/{self.theme.value}.mdx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is mdx
, there may be some elements that don't render correctly in standard markdown.
) | ||
|
||
# version extension | ||
VersionExtension.ext(item, add_if_missing=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be assigned to something? Or does this have side-effects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# set primary geometry type to first geometry_type in geoparquet metadata | ||
item.ext.table.primary_geometry = self.geo_metadata["columns"]["geometry"][ | ||
"geometry_types" | ||
][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's a list of multiple geometry types, you really can't just pick one. It could be a mix of polygon and multi polygon and you'll lose that information
Description
First draft! I am so sorry for the monstrous line count but that's what I get for using pytest-recording and checking in the example json files.
Most of the interesting additions are in
metadata.py
which has the logic for extracting the metadata from parquet files.You can browse the example metadata here: https://radiantearth.github.io/stac-browser/#/external/raw.githubusercontent.com/stactools-packages/overture-maps/feat/stac/examples/catalog.json
Checklist
scripts/test
)