-
Notifications
You must be signed in to change notification settings - Fork 15
add eo STAC extension support #38
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
Conversation
rio_stac/stac.py
Outdated
@@ -271,28 +302,51 @@ def create_stac_item( | |||
get_media_type(dataset) if asset_media_type == "auto" else asset_media_type | |||
) | |||
|
|||
# Try to get datetime from https://gdal.org/user/raster_data_model.html#imagery-domain-remote-sensing | |||
dst_date = src_dst.get_tag_item("ACQUISITIONDATETIME", "IMAGERY") |
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.
get Datetime
from Raster Data model metadata
|
||
if "start_datetime" not in properties and "end_datetime" not in properties: | ||
input_datetime = ( | ||
input_datetime or dst_datetime or datetime.datetime.utcnow() |
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.
user input OR dataset metadata OR now
) | ||
|
||
eo_info = {"eo:bands": get_eobands_info(src_dst)} | ||
|
||
cloudcover = src_dst.get_tag_item("CLOUDCOVER", "IMAGERY") |
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.
get cloud cover from GDAL Raster Data model
# Description metadata or Colorinterp or Nothing | ||
description = descr or color | ||
if description: | ||
band_meta["description"] = description |
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.
eo:bands
description will be either:
- GDAL description metadata
- color interp value https://github.com/rasterio/rasterio/blob/main/rasterio/enums.py#L26-L45
|
||
colors = src_dst.colorinterp | ||
for ix in src_dst.indexes: | ||
band_meta = {"name": f"b{ix}"} |
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.
we set name to b{band index value}
(e.g b1, b2, ....)
FYSA I aped this for GDAL: OSGeo/gdal#6309 |
closes #36
Possible discussion includes:
eo:bands
name tob{index}
something good?undefined
) user friendly?