From 7810cc00697560bd83789f29725f3c1175b2545b Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Thu, 4 May 2023 15:27:04 +0200 Subject: [PATCH 1/2] reference placeholder --- README.md | 17 +++++++++++++++++ examples/item.json | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index 2f1a4ba..29f6772 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/examples/item.json b/examples/item.json index 903e68c..220b02e 100644 --- a/examples/item.json +++ b/examples/item.json @@ -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", From b744948d80fcec30af59a079cbbd0a5b14bbda14 Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Thu, 4 May 2023 15:29:00 +0200 Subject: [PATCH 2/2] updated changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c0392..7c19f3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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