stac-utils / stactools

Command line utility and Python library for STAC
https://stactools.readthedocs.io/
Other
104 stars 28 forks source link

Implement migrate command #443

Closed jsignell closed 1 year ago

jsignell commented 1 year ago

Related Issue(s): Closes #319

Description: Looks like

stac migrate tests/data-files/planet-disaster/collection.json
Output The red/green is coming from github markdown :) ```diff --- before +++ after @@ -4,6 +4,11 @@ "stac_version": "1.0.0", "description": "[Planet Disaster Data](https://www.planet.com/disasterdata/) makes imagery available directly to the public, volunteers, humanitarian organizations, and other coordinating bodies in support of the International Charter for Space and Major Disasters. Data is released for individual disaster events, providing a 30 day window pre- and post-disaster. Imagery is provided under Creative Commons licenses, free of charge, with either CC-BY-SA or CC-BY-NC.", "links": [ + { + "rel": "self", + "href": "/home/jsignell/stactools/tests/data-files/planet-disaster/collection.json", + "type": "application/json" + }, { "rel": "root", "href": "./collection.json", @@ -16,8 +21,28 @@ "title": "Hurricane Harvey" } ], - "stac_extensions": [], "title": "Planet Disaster Data", + "extent": { + "spatial": { + "bbox": [ + [ + -96, + 28, + -93, + 31 + ] + ] + }, + "temporal": { + "interval": [ + [ + "2017-08-28T18:00:00Z", + null + ] + ] + } + }, + "license": "CC-BY-SA-4.0", "keywords": [ "disaster", "open" @@ -79,26 +104,5 @@ "minimum": 0, "maximum": 24 } - }, - "extent": { - "spatial": { - "bbox": [ - [ - -96, - 28, - -93, - 31 - ] - ] - }, - "temporal": { - "interval": [ - [ - "2017-08-28T18:00:00Z", - null - ] - ] - } - }, - "license": "CC-BY-SA-4.0" + } } ```

To save the file and not show the diff:

stac migrate tests/data-files/planet-disaster/collection.json --save --hide-diff

PR checklist:

jsignell commented 1 year ago

I kind of feel that we do not need to test the migrate behavior itself in this repo since that should be well tested in pystac itself.

jsignell commented 1 year ago

Oh also let me know what you want the default behavior to be.