stac-utils / stactools

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

stac copy pulls in external catalogs/collections #418

Closed constantinius closed 1 year ago

constantinius commented 1 year ago

Describe the bug I have a local catalog referencing a remote catalog/collection. When I copy my local collection to some place using stac copy, the remote collection is saved right next to the local one.

To reproduce

catalog.json contents:

{
    "id": "test",
    "type": "Catalog",
    "stac_extensions": [],
    "stac_version": "1.0.0",
    "description": "test",
    "title": "test",
    "links": [
      {
        "rel": "child",
        "href": "https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/collection.json",
        "type": "application/json"
      }
    ]
  }
  1. Install stactools
  2. Run stac copy catalog.json out
  3. Run tree
.
├── out
│   ├── catalog.json
│   └── simple-collection
│       ├── 20201211_223832_CS2
│       │   └── 20201211_223832_CS2.json
│       └── collection.json
└── test.json

Expected behavior The remote collections should not be copied locally, at least there should be a way to opt out of that behavior.

Screenshots and shell session dumps


Additional context