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

Add stactools.core.create.item #201

Merged
merged 3 commits into from
Sep 16, 2021
Merged

Add stactools.core.create.item #201

merged 3 commits into from
Sep 16, 2021

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Sep 13, 2021

Related Issue(s): #179

Description: This creates an item from a rasterio openable asset. The function tries to fill in as much data as possible from the rasterio dataset, but generally created items should be enhanced after creation with additional properties and STAC extensions.

Also includes a drop-dead simple command line interface.

PR checklist:

  • Code is formatted (run scripts/format).
  • Code lints properly (run scripts/lint).
  • Tests pass (run scripts/test).
  • Documentation has been updated to reflect changes, if applicable.
  • Changes are added to the CHANGELOG.

gadomski added a commit that referenced this pull request Sep 13, 2021
@gadomski gadomski linked an issue Sep 13, 2021 that may be closed by this pull request
@gadomski
Copy link
Member Author

In #196 (comment) @kylebarron brought my attention to rio stac, which does more-or-less the same thing as this PR (with a slightly different approach). My initial instinct is to close this PR and recommend users favors rio stac, as it is (a) more feature-ful and (b) already extant, but I'd be curious whether @lossyrob, @cholmes, or others think it's worth having a "make an Item from an asset" functionality over here in stactools as well.

If this PR is closed, 7d74398 should be pulled out to its own PR.

@cholmes
Copy link
Contributor

cholmes commented Sep 14, 2021

I'll let @lossyrob speak from the API perspective, but from a CLI perspective I think it makes good sense to include a 'create-item' command in the stac cli. If behind the scenes that uses rio stac directly I think that's fine / perhaps preferable for less code duplication. But I see stactools as the 'first' command line tool someone coming to STAC would use, and they might not know to install rio stac. But then there are also lots of rasterio users who may learn about stac from rio stac.

If it simplifies the code I could see stac create-item being really simple, but then also in its help / docs it'd point users at rio stac if they want more options.

gadomski added a commit that referenced this pull request Sep 14, 2021
This creates an item from a `rasterio` openable asset. The function
tries to fill in as much data as possible from the `rasterio` dataset,
but generally created items should be enhanced after creation with
additional properties and STAC extensions.

Also includes a drop-dead simple command line interface.
This fixes typing in Python 3.7
@lossyrob
Copy link
Member

If it simplifies the code I could see stac create-item being really simple, but then also in its help / docs it'd point users at rio stac if they want more options.

This seems like a good approach to me.

@gadomski gadomski merged commit f3086db into main Sep 16, 2021
@gadomski gadomski deleted the issues/179-create-item branch September 16, 2021 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stac create-item and associated API function
3 participants