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

Adds render cross reference in links #6

Merged
merged 2 commits into from
Jun 13, 2024
Merged
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

- Adds render cross reference in links ([#2](https://github.com/stac-extensions/render/issues/2))

### Changed

### Deprecated
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,22 @@ It is highly suggested to have a web map link in the `links` section of the STAC
[Web Map Link extension](https://github.com/stac-extensions/web-map-links) to allow application to
find the tiling endpoint of the dynamic tile server.

### Additional Attributes

A [web map link](https://github.com/stac-extensions/web-map-links) can be extended with the attribute `render`
with a value corresponding to the key of the render object in the `renders` field
in order to provide a cross link to the render object.

```json
{
"rel": "xyz",
"type": "image/png",
"title": "NDVI",
"href": "https://api.cogeo.xyz/stac/preview.png?url=https://raw.githubusercontent.com/stac-extensions/raster/main/examples/item-landsat8.json&expression=(B5–B4)/(B5+B4)&max_size=512&width=512&resampling_method=average&rescale=-1,1&color_map=ylgn&return_mask=true",
"render": "ndvi"
}
```

## Contributing

All contributions are subject to the
Expand Down
16 changes: 15 additions & 1 deletion examples/item-landsat8.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
"https://stac-extensions.github.io/render/v1.0.0/schema.json",
"https://stac-extensions.github.io/virtual-assets/v1.0.0/schema.json"
"https://stac-extensions.github.io/virtual-assets/v1.0.0/schema.json",
"https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json"
],
"id": "LC08_L1TP_044033_20210305_20210312_01_T1",
"properties": {
Expand Down Expand Up @@ -102,6 +103,19 @@
"type": "image/png",
"title": "RGB composite visualized through a XYZ"
},
{
"rel": "xyz",
"type": "image/png",
"title": "NDVI",
"href": "https://api.cogeo.xyz/stac/preview.png?url=https://raw.githubusercontent.com/stac-extensions/raster/main/examples/item-landsat8.json&expression=(B5–B4)/(B5+B4)&max_size=512&width=512&resampling_method=average&rescale=-1,1&color_map=ylgn&return_mask=true",
"render": "ndvi"
},
{
"rel": "xyz",
"type": "image/png",
"title": "NDVI",
"href": "https://api.cogeo.xyz/stac/preview.png?url=https://raw.githubusercontent.com/stac-extensions/raster/main/examples/item-landsat8.json&expression=(B5–B4)/(B5+B4)&max_size=512&width=512&resampling_method=average&rescale=-1,1&color_map=ylgn&return_mask=true"
},
{
"rel": "collection",
"href": "https://landsat-stac.s3.amazonaws.com/collections/landsat-8-l1.json",
Expand Down
127 changes: 113 additions & 14 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,37 @@
}
}
}
},
{
"if": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this schema saying if stac extensions includes both renders and web-map-links, a render sub-property is required? Why do you think it should be required? Seems like an optional property.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I may be mis-reading the schema but does the then statement mean that there must be a link object in the links list that has "rel": "render" - in which case does the example above needs updating to include a link with "rel": "render"?

"properties": {
"stac_extensions": {
"contains": {
"type": "string",
"pattern": "https:\/\/stac-extensions\\.github\\.io\/web-map-links\/.*"
}
}
}
},
"then": {
"properties": {
"links": {
"type": "array",
"contains": {
"type": "object",
"required": [
"rel",
"render"
],
"properties": {
"render": {
"type": "string"
}
}
}
}
}
}
}
]
},
Expand All @@ -60,8 +91,18 @@
{
"$comment": "This validates the fields in Collection Assets, but does not require them.",
"anyOf": [
{"type": "object", "required": ["assets"]},
{"type": "object", "required": ["item_assets"]}
{
"type": "object",
"required": [
"assets"
]
},
{
"type": "object",
"required": [
"item_assets"
]
}
],
"properties": {
"renders": {
Expand Down Expand Up @@ -104,17 +145,72 @@
"require_any_field": {
"$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.",
"anyOf": [
{"type": "object", "required": ["assets"]},
{"type": "object", "required": ["title"]},
{"type": "object", "required": ["rescale"]},
{"type": "object", "required": ["nodata"]},
{"type": "object", "required": ["colormap_name"]},
{"type": "object", "required": ["colormap"]},
{"type": "object", "required": ["color_formula"]},
{"type": "object", "required": ["resampling"]},
{"type": "object", "required": ["expression"]},
{"type": "object", "required": ["minmax_zoom"]},
{"type": "object", "required": ["bidx"]}
{
"type": "object",
"required": [
"assets"
]
},
{
"type": "object",
"required": [
"title"
]
},
{
"type": "object",
"required": [
"rescale"
]
},
{
"type": "object",
"required": [
"nodata"
]
},
{
"type": "object",
"required": [
"colormap_name"
]
},
{
"type": "object",
"required": [
"colormap"
]
},
{
"type": "object",
"required": [
"color_formula"
]
},
{
"type": "object",
"required": [
"resampling"
]
},
{
"type": "object",
"required": [
"expression"
]
},
{
"type": "object",
"required": [
"minmax_zoom"
]
},
{
"type": "object",
"required": [
"bidx"
]
}
]
},
"fields": {
Expand Down Expand Up @@ -143,7 +239,10 @@
}
},
"nodata": {
"type": ["number","string"]
"type": [
"number",
"string"
]
},
"colormap_name": {
"type": "string"
Expand Down
Loading