pystac icon indicating copy to clipboard operation
pystac copied to clipboard

Add `file://` protocol to `self` links that currently don't have a protocol

Open gadomski opened this issue 1 year ago • 6 comments

xref https://github.com/radiantearth/stac-spec/pull/1281, but it seems likely that at some point in the future self links will be required to have a protocol (i.e. absolute filesystem paths won't be enough). We should update to pystac to write file:// absolute paths to future-proof ourselves and help ecosystem adoption.

gadomski avatar Jun 03 '24 15:06 gadomski

Does this also imply that RELATIVE_PUBLISHED is no longer a valid catalog type?

jsignell avatar Aug 06 '24 16:08 jsignell

🤔 I'm not sure why it would be invalid ... per best practices:

This is a self-contained catalog as described above, except it includes an absolute self link at the root to identify its online location.

I think a file:///path/to/something href would count as an absolute self link?

gadomski avatar Aug 06 '24 16:08 gadomski

Oh ok so absolute in this context just means a url with a protocol. Not as in absolute vs relative path?

jsignell avatar Aug 06 '24 17:08 jsignell

Oh ok so absolute in this context just means a url with a protocol. Not as in absolute vs relative path?

Yeah, I think that text from the best practices is now a bit confusing since a href with a protocol is probably always absolute ... I can't think of an example of a protocol://-style href that could be relative?

gadomski avatar Aug 07 '24 00:08 gadomski

I was thinking about this more in the context of the migrate function. I think the next version of pystac should be able to read URIs that have the file:/// protocol, but I think it should not write them that way until version 2.0. It just feels like too big of a change to put in a minor release.

jsignell avatar Jan 03 '25 21:01 jsignell

I'll open a new PR now taking just the reading bits from #1472

jsignell avatar Jan 06 '25 15:01 jsignell