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

Reference placeholders #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added reference placeholders for item, collection and asset.

### Changed

### Deprecated
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ This document explains the Web Map Links Extension to the
It allows to provide links to web map services for visualization purposes.

The following services are supported:

- [OGC WMTS](#ogc-wmts)
- [TileJSON](#tilejson)
- [XYZ](#xyz)

Important resources in this extension:

- Examples:
- [Item example](examples/item.json): Shows the basic usage of the extension in a STAC Item
- [Collection example](examples/collection.json): Shows the basic usage of the extension in a STAC Collection
Expand Down Expand Up @@ -105,6 +107,21 @@ The implementations can expand the given values into multiple URLs.
For example, if you provide `https://{s}/example` as `href` and `href:servers` is `["a.com", "b.eu"]`
you can expand that to `["https://a.com/example", "https://b.eu/example"]`.

#### Reference placeholders

The following placeholders can be used to reference a STAC Item in the current STAC catalog.

| Placeholder | Reference | Description |
| ------------- | -------------------- | ----------- |
| `{item.id}` | [Stac Item identifier](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#id) | Unique Item identifier within a Collection |
| `{item.self}` | [Stac Item self url](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#relation-types) | Absolute URL to the Item |
| `{col.id}` | [Stac Collection Id](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#collections) | Collection identifier |
| `{asset}` | [Stac Item asset key](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#asset-object) | Asset key |

For example, if you provide `https://maps.example.com/xyz/{z}/{x}/{y}.jpg?url={item.self}&assets={asset}`
or `https://maps.example.com/xyz/{z}/{x}/{y}.jpg?url=https://api.example.com/collections/{col.id}/items/{item.id}&assets={asset}`,
you can expand that to `https://maps.example.com/xyz/1/2/3.jpg?url=https://api.example.com/collections/my-collection/items/my-item&assets=rgb`.

## Contributing

All contributions are subject to the
Expand Down
6 changes: 6 additions & 0 deletions examples/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
"type": "image/jpeg",
"title": "RGB composite visualized through a XYZ"
},
{
"href": "https://maps.example.com/stac-xyz/{z}/{x}/{y}.png?url={item.self}&assets={asset}",
"rel": "xyz",
"type": "image/jpeg",
"title": "RGB composite visualized through a XYZ"
},
{
"href": "https://maps.example.com/item/tilejson.json",
"rel": "tilejson",
Expand Down