Skip to content

save pulls in external catalogs #1106

@constantinius

Description

@constantinius

When doing catalog.save(), referenced external catalogs are pulled in and are saved next to the save location with a weird path.

Consider the following example catalog.json referencing an external collection:

{
    "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"
      }
    ]
  }

Now consider the following usage in Python:

>>> catalog = pystac.read_file("catalog.json")
>>> list(catalog.get_children())
[<Collection id=simple-collection>]
>>> catalog.save(pystac.CatalogType.SELF_CONTAINED, dest_href="out/catalog.json")

Now the directory contents are similar to as following tree:

.
├── https:
│   └── raw.githubusercontent.com
│       └── radiantearth
│           └── stac-spec
│               └── v1.0.0
│                   └── collection.json
├── out
│   └── catalog.json
└── test.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThings which are broken

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions