From d52ba2d7000c619c05e80b57c787a2ddea462cd8 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 2 Mar 2021 15:21:07 +0100 Subject: [PATCH 01/24] Initial commit --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 + 2 files changed, 203 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6f64be8 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# template +A template repository for new extensions. It enables CI for schema publishing and proposes some core structures. From 4a97ad12bd26d06e11c6401381dedbc1916531a4 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 2 Mar 2021 17:55:29 +0100 Subject: [PATCH 02/24] Add template --- .github/remark.yaml | 42 +++++++++++++ .github/workflows/publish.yaml | 17 +++++ .github/workflows/test.yaml | 14 +++++ .gitignore | 2 + README.md | 49 ++++++++++++++- examples/collection.json | 53 ++++++++++++++++ examples/item.json | 65 +++++++++++++++++++ json-schema/schema.json | 110 +++++++++++++++++++++++++++++++++ package.json | 20 ++++++ 9 files changed, 370 insertions(+), 2 deletions(-) create mode 100644 .github/remark.yaml create mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/test.yaml create mode 100644 .gitignore create mode 100644 examples/collection.json create mode 100644 examples/item.json create mode 100644 json-schema/schema.json create mode 100644 package.json diff --git a/.github/remark.yaml b/.github/remark.yaml new file mode 100644 index 0000000..d9a432a --- /dev/null +++ b/.github/remark.yaml @@ -0,0 +1,42 @@ +plugins: +# Check links + - validate-links +# Apply some recommended defaults for consistency + - remark-preset-lint-consistent + - remark-preset-lint-recommended + - lint-no-html +# General formatting + - - remark-lint-emphasis-marker + - '*' + - remark-lint-hard-break-spaces + - remark-lint-blockquote-indentation + - remark-lint-no-consecutive-blank-lines + - - remark-lint-maximum-line-length + - 150 +# Code + - remark-lint-fenced-code-flag + - remark-lint-fenced-code-marker + - remark-lint-no-shell-dollars + - - remark-lint-code-block-style + - 'fenced' +# Headings + - remark-lint-heading-increment + - remark-lint-no-duplicate-headings + - remark-lint-no-multiple-toplevel-headings + - remark-lint-no-heading-punctuation + - - remark-lint-maximum-heading-length + - 70 + - - remark-lint-heading-style + - atx +# Lists + - remark-lint-list-item-bullet-indent + - remark-lint-ordered-list-marker-style + - remark-lint-ordered-list-marker-value + - remark-lint-checkbox-character-style + - - remark-lint-unordered-list-marker-style + - '-' + - - remark-lint-list-item-indent + - space +# Tables + - remark-lint-table-pipes + - remark-lint-no-literal-urls \ No newline at end of file diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..9cba42f --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,17 @@ +name: Publish JSON Schema +on: + release: + types: [published] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Inject env variables + uses: rlespinasse/github-slug-action@v3.x + - uses: actions/checkout@v2 + - name: deploy JSON Schema for version ${{ env.GITHUB_REF_SLUG }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: json-schema + destination_dir: ${{ env.GITHUB_REF_SLUG }} \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..87f33a5 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,14 @@ +name: Check Markdown and Examples +on: [push, pull_request] +jobs: + deploy: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x] + steps: + - uses: actions/setup-node@v1 + - uses: actions/checkout@v2 + - run: | + npm install + npm test \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b68addb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/package-lock.json +/node_modules \ No newline at end of file diff --git a/README.md b/README.md index 6f64be8..c11f03d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,47 @@ -# template -A template repository for new extensions. It enables CI for schema publishing and proposes some core structures. +# Template Extension Specification + +- **Title:** Template +- **Identifier:** +- **Field Name Prefix:** template +- **Scope:** Item, Collection +- **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Proposal +- **Owner**: @your-gh-handles @person2 + +This is the place to add a short introduction. + +- 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 +- [JSON Schema](json-schema/schema.json) + +## Item Properties and Collection Fields + +| Field Name | Type | Description | +| ----------- | ------------------------- | ----------- | +| new_field | [XYZ Object](#xyz-object) | **REQUIRED**. Describe the required field... | +| another_one | \[number] | Describe the field... | + +### Additional Field Information + +#### new_field + +This is a much more detailed description of the field `new_field`... + +### XYZ Object + +This is the introduction for the purpose and the content of the XYZ Object... + +| Field Name | Type | Description | +| ----------- | ------ | ----------- | +| x | number | **REQUIRED**. Describe the required field... | +| y | number | **REQUIRED**. Describe the required field... | +| z | number | **REQUIRED**. Describe the required field... | + +## Relation types + +The following types should be used as applicable `rel` types in the +[Link Object](https://github.com/radiantearth/stac-spec/tree/master/item-spec/item-spec.md#link-object). + +| Type | Description | +| ------------------- | ----------- | +| fancy-rel-type | This link points to a fancy resource. | diff --git a/examples/collection.json b/examples/collection.json new file mode 100644 index 0000000..1605bf0 --- /dev/null +++ b/examples/collection.json @@ -0,0 +1,53 @@ +{ + "stac_version": "1.0.0-rc.1", + "stac_extensions": [ + "https://stac-extensions.github.io/template/v1.0.0/schema.json" + ], + "type": "Collection", + "id": "collection", + "title": "A title", + "description": "A description", + "license": "Apache-2.0", + "extent": { + "spatial": { + "bbox": [ + [ + 172.9, + 1.3, + 173, + 1.4 + ] + ] + }, + "temporal": { + "interval": [ + [ + "2015-06-23T00:00:00Z", + null + ] + ] + } + }, + "new_field": { + "x": 1, + "y": 2, + "z": 3 + }, + "another_one": [ + 1, + 2, + 3 + ], + "summaries": { + "datetime": { + "minimum": "2015-06-23T00:00:00Z", + "maximum": "2019-07-10T13:44:56Z" + } + }, + "links": [ + { + "href": "https://example.com/examples/collection.json", + "rel": "self" + } + ] +} \ No newline at end of file diff --git a/examples/item.json b/examples/item.json new file mode 100644 index 0000000..f1531c2 --- /dev/null +++ b/examples/item.json @@ -0,0 +1,65 @@ +{ + "stac_version": "1.0.0-rc.1", + "stac_extensions": [ + "https://stac-extensions.github.io/template/v1.0.0/schema.json" + ], + "type": "Feature", + "id": "item", + "bbox": [ + 172.9, + 1.3, + 173, + 1.4 + ], + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 172.9, + 1.3 + ], + [ + 173, + 1.3 + ], + [ + 173, + 1.4 + ], + [ + 172.9, + 1.4 + ], + [ + 172.9, + 1.3 + ] + ] + ] + }, + "properties": { + "datetime": "2020-12-11T22:38:32Z", + "new_field": { + "x": 1, + "y": 2, + "z": 3 + }, + "another_one": [ + 1, + 2, + 3 + ] + }, + "links": [ + { + "href": "https://example.com/examples/item.json", + "rel": "self" + } + ], + "assets": { + "data": { + "href": "https://example.com/examples/file.xyz" + } + } +} \ No newline at end of file diff --git a/json-schema/schema.json b/json-schema/schema.json new file mode 100644 index 0000000..3bb0d15 --- /dev/null +++ b/json-schema/schema.json @@ -0,0 +1,110 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://stac-extensions.github.io/template/v1.0.0/schema.json#", + "title": "Template Extension", + "description": "STAC Template Extension for STAC Items and STAC Collections.", + "oneOf": [ + { + "allOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "const": "Feature" + } + } + }, + { + "$ref": "#/definitions/stac_extensions" + }, + { + "type": "object", + "required": [ + "properties" + ], + "properties": { + "properties": { + "$ref": "#/definitions/template" + } + } + } + ] + }, + { + "allOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "const": "Collection" + } + } + }, + { + "$ref": "#/definitions/stac_extensions" + }, + { + "$ref": "#/definitions/template" + } + ] + } + ], + "definitions": { + "stac_extensions": { + "type": "object", + "required": [ + "stac_extensions" + ], + "properties": { + "stac_extensions": { + "type": "array", + "contains": { + "const": "https://stac-extensions.github.io/template/v1.0.0/schema.json" + } + } + } + }, + "template": { + "type": "object", + "required": [ + "new_field" + ], + "properties": { + "new_field": { + "$ref": "#/definitions/xyz_object" + }, + "another_one": { + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "xyz_object": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + } + } + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..46d280a --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "stac-extensions", + "version": "1.0.0", + "scripts": { + "test": "npm run check-markdown && npm run check-examples", + "check-markdown": "remark . -f -r .github/remark.yaml", + "check-examples": "stac-node-validator . --lint --verbose --schemaMap https://stac-extensions.github.io/template/v1.0.0/schema.json=./json-schema/schema.json", + "format-examples": "stac-node-validator . --format --schemaMap https://stac-extensions.github.io/template/v1.0.0/schema.json=./json-schema/schema.json" + }, + "dependencies": { + "remark-cli": "^8.0.0", + "remark-lint": "^7.0.0", + "remark-lint-no-html": "^2.0.0", + "remark-preset-lint-consistent": "^3.0.0", + "remark-preset-lint-markdown-style-guide": "^3.0.0", + "remark-preset-lint-recommended": "^4.0.0", + "remark-validate-links": "^10.0.0", + "stac-node-validator": "^1.0.0" + } +} From 34f3174e067211f42e40feb00fd6426181de8c47 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 2 Mar 2021 21:15:56 +0100 Subject: [PATCH 03/24] Validate fields in item assets, item assets defintion and collection assets; add link back to stac-spec --- README.md | 4 +- examples/collection.json | 20 ++++++++- examples/item.json | 6 ++- json-schema/schema.json | 95 ++++++++++++++++++++++++---------------- 4 files changed, 84 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index c11f03d..e9caff7 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ - **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Proposal - **Owner**: @your-gh-handles @person2 +This document explains the Template Extension to the [SpatioTemporal Asset Catalog](https://github.com/radiantearth/stac-spec) (STAC) specification. This is the place to add a short introduction. - Examples: @@ -18,7 +19,8 @@ This is the place to add a short introduction. | Field Name | Type | Description | | ----------- | ------------------------- | ----------- | -| new_field | [XYZ Object](#xyz-object) | **REQUIRED**. Describe the required field... | +| new_field | string | **REQUIRED**. Describe the required field... | +| xyz | [XYZ Object](#xyz-object) | Describe the field... | | another_one | \[number] | Describe the field... | ### Additional Field Information diff --git a/examples/collection.json b/examples/collection.json index 1605bf0..b15c31b 100644 --- a/examples/collection.json +++ b/examples/collection.json @@ -1,6 +1,8 @@ { "stac_version": "1.0.0-rc.1", "stac_extensions": [ + "collection-assets", + "item-assets", "https://stac-extensions.github.io/template/v1.0.0/schema.json" ], "type": "Collection", @@ -28,7 +30,8 @@ ] } }, - "new_field": { + "new_field": "test", + "xyz": { "x": 1, "y": 2, "z": 3 @@ -38,6 +41,17 @@ 2, 3 ], + "assets": { + "example": { + "href": "https://example.com/examples/file.xyz", + "new_field": "test" + } + }, + "item_assets": { + "data": { + "new_field": "test" + } + }, "summaries": { "datetime": { "minimum": "2015-06-23T00:00:00Z", @@ -48,6 +62,10 @@ { "href": "https://example.com/examples/collection.json", "rel": "self" + }, + { + "href": "https://example.com/examples/item.json", + "rel": "item" } ] } \ No newline at end of file diff --git a/examples/item.json b/examples/item.json index f1531c2..66d2d27 100644 --- a/examples/item.json +++ b/examples/item.json @@ -40,7 +40,8 @@ }, "properties": { "datetime": "2020-12-11T22:38:32Z", - "new_field": { + "new_field": "test", + "xyz": { "x": 1, "y": 2, "z": 3 @@ -59,7 +60,8 @@ ], "assets": { "data": { - "href": "https://example.com/examples/file.xyz" + "href": "https://example.com/examples/file.xyz", + "new_field": "test" } } } \ No newline at end of file diff --git a/json-schema/schema.json b/json-schema/schema.json index 3bb0d15..fc6089f 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -5,35 +5,46 @@ "description": "STAC Template Extension for STAC Items and STAC Collections.", "oneOf": [ { + "$comment": "This is the schema for STAC Items.", "allOf": [ { "type": "object", "required": [ - "type" + "type", + "properties", + "assets" ], "properties": { "type": { "const": "Feature" + }, + "properties": { + "allOf": [ + { + "required": [ + "new_field" + ] + }, + { + "$ref": "#/definitions/fields" + } + ] + }, + "assets": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/fields" + } } } }, { "$ref": "#/definitions/stac_extensions" - }, - { - "type": "object", - "required": [ - "properties" - ], - "properties": { - "properties": { - "$ref": "#/definitions/template" - } - } } ] }, { + "$comment": "This is the schema for STAC Collections.", "allOf": [ { "type": "object", @@ -43,6 +54,18 @@ "properties": { "type": { "const": "Collection" + }, + "assets": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/fields" + } + }, + "item_assets": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/fields" + } } } }, @@ -50,7 +73,7 @@ "$ref": "#/definitions/stac_extensions" }, { - "$ref": "#/definitions/template" + "$ref": "#/definitions/fields" } ] } @@ -70,14 +93,31 @@ } } }, - "template": { + "fields": { + "$comment": "Add your new fields here. Don't require them here, do that above in the item schema.", "type": "object", - "required": [ - "new_field" - ], "properties": { "new_field": { - "$ref": "#/definitions/xyz_object" + "type": "string" + }, + "xyz": { + "type": "object", + "required": [ + "x", + "y", + "z" + ], + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + } }, "another_one": { "type": "array", @@ -86,25 +126,6 @@ } } } - }, - "xyz_object": { - "type": "object", - "required": [ - "x", - "y", - "z" - ], - "properties": { - "x": { - "type": "number" - }, - "y": { - "type": "number" - }, - "z": { - "type": "number" - } - } } } } \ No newline at end of file From b6739b5fc7ef25322a2dff38cdf6459ecbc72176 Mon Sep 17 00:00:00 2001 From: James Santucci Date: Tue, 2 Mar 2021 14:01:29 -0700 Subject: [PATCH 04/24] Add empty changelog (#1) --- .github/remark.yaml | 4 +++- CHANGELOG.md | 19 +++++++++++++++++++ README.md | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/.github/remark.yaml b/.github/remark.yaml index d9a432a..1fa7dd8 100644 --- a/.github/remark.yaml +++ b/.github/remark.yaml @@ -28,6 +28,8 @@ plugins: - 70 - - remark-lint-heading-style - atx + - - remark-lint-no-shortcut-reference-link + - false # Lists - remark-lint-list-item-bullet-indent - remark-lint-ordered-list-marker-style @@ -39,4 +41,4 @@ plugins: - space # Tables - remark-lint-table-pipes - - remark-lint-no-literal-urls \ No newline at end of file + - remark-lint-no-literal-urls diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..dd0fd2f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +### Deprecated + +### Removed + +### Fixed + +[Unreleased]: diff --git a/README.md b/README.md index e9caff7..28f3ebf 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ This is the place to add a short introduction. - [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 - [JSON Schema](json-schema/schema.json) +- [Changelog](./CHANGELOG.md) ## Item Properties and Collection Fields From 6d3ba9a320cb7ca12a5aefb19cd5e089229219ad Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 2 Mar 2021 22:46:37 +0100 Subject: [PATCH 05/24] Add template prefix, make schema more strict (https://github.com/radiantearth/stac-spec/issues/901) and add more comments to schema --- README.md | 14 +++++++------- examples/collection.json | 10 +++++----- examples/item.json | 8 ++++---- json-schema/schema.json | 17 ++++++++++++----- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 28f3ebf..e7188d6 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,17 @@ This is the place to add a short introduction. ## Item Properties and Collection Fields -| Field Name | Type | Description | -| ----------- | ------------------------- | ----------- | -| new_field | string | **REQUIRED**. Describe the required field... | -| xyz | [XYZ Object](#xyz-object) | Describe the field... | -| another_one | \[number] | Describe the field... | +| Field Name | Type | Description | +| -------------------- | ------------------------- | ----------- | +| template:new_field | string | **REQUIRED**. Describe the required field... | +| template:xyz | [XYZ Object](#xyz-object) | Describe the field... | +| template:another_one | \[number] | Describe the field... | ### Additional Field Information -#### new_field +#### template:new_field -This is a much more detailed description of the field `new_field`... +This is a much more detailed description of the field `template:new_field`... ### XYZ Object diff --git a/examples/collection.json b/examples/collection.json index b15c31b..67cdc43 100644 --- a/examples/collection.json +++ b/examples/collection.json @@ -30,13 +30,13 @@ ] } }, - "new_field": "test", - "xyz": { + "template:new_field": "test", + "template:xyz": { "x": 1, "y": 2, "z": 3 }, - "another_one": [ + "template:another_one": [ 1, 2, 3 @@ -44,12 +44,12 @@ "assets": { "example": { "href": "https://example.com/examples/file.xyz", - "new_field": "test" + "template:new_field": "test" } }, "item_assets": { "data": { - "new_field": "test" + "template:new_field": "test" } }, "summaries": { diff --git a/examples/item.json b/examples/item.json index 66d2d27..06905fd 100644 --- a/examples/item.json +++ b/examples/item.json @@ -40,13 +40,13 @@ }, "properties": { "datetime": "2020-12-11T22:38:32Z", - "new_field": "test", - "xyz": { + "template:new_field": "test", + "template:xyz": { "x": 1, "y": 2, "z": 3 }, - "another_one": [ + "template:another_one": [ 1, 2, 3 @@ -61,7 +61,7 @@ "assets": { "data": { "href": "https://example.com/examples/file.xyz", - "new_field": "test" + "template:new_field": "test" } } } \ No newline at end of file diff --git a/json-schema/schema.json b/json-schema/schema.json index fc6089f..7c9c235 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -21,8 +21,9 @@ "properties": { "allOf": [ { + "$comment": "Require fields here for item properties.", "required": [ - "new_field" + "template:new_field" ] }, { @@ -97,10 +98,10 @@ "$comment": "Add your new fields here. Don't require them here, do that above in the item schema.", "type": "object", "properties": { - "new_field": { + "template:new_field": { "type": "string" }, - "xyz": { + "template:xyz": { "type": "object", "required": [ "x", @@ -119,13 +120,19 @@ } } }, - "another_one": { + "template:another_one": { "type": "array", "items": { "type": "number" } } - } + }, + "patternProperties": { + "^(?!template:)": { + "$comment": "Above, change `template` to the prefix of this extension", + } + }, + "additionalProperties": false } } } \ No newline at end of file From 6f7e8a7a9ae17de3527982083491da1a2fd272ee Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 3 Mar 2021 21:36:28 +0100 Subject: [PATCH 06/24] Clarify/Fix JSON Schema --- json-schema/schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/json-schema/schema.json b/json-schema/schema.json index 7c9c235..2a1783f 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -71,6 +71,7 @@ } }, { + "$comment": "Remove this and the following object if this is not an extension to a Collection.", "$ref": "#/definitions/stac_extensions" }, { @@ -129,7 +130,7 @@ }, "patternProperties": { "^(?!template:)": { - "$comment": "Above, change `template` to the prefix of this extension", + "$comment": "Above, change `template` to the prefix of this extension" } }, "additionalProperties": false From 1ad51bab68c4d18076f4825e0bdc9174238d9ad8 Mon Sep 17 00:00:00 2001 From: matthewhanson Date: Tue, 23 Mar 2021 21:49:43 -0400 Subject: [PATCH 07/24] add .remarkignore file to ignore CHANGELOG in markdown checks --- .remarkignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .remarkignore diff --git a/.remarkignore b/.remarkignore new file mode 100644 index 0000000..20b126a --- /dev/null +++ b/.remarkignore @@ -0,0 +1 @@ +/CHANGELOG.md From ff150b08d58fed145c86b96efe75e80bd0218f0f Mon Sep 17 00:00:00 2001 From: James Santucci Date: Tue, 30 Mar 2021 05:01:43 -0500 Subject: [PATCH 08/24] Add testing instructions and contributing links (#2) * Add contributing and CoC * Add CONTRIBUTING.md * line length * refer to remote contributing guide, borrow test instructions * Un-artisinally craft contributing link --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/README.md b/README.md index e7188d6..796a0b2 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,51 @@ The following types should be used as applicable `rel` types in the | Type | Description | | ------------------- | ----------- | | fancy-rel-type | This link points to a fancy resource. | + +## Contributing + +All contributions are subject to the +[STAC Specification Code of Conduct](https://github.com/radiantearth/stac-spec/blob/master/CODE_OF_CONDUCT.md). +For contributions, please follow the +[STAC specification contributing guide](https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md) Instructions +for running tests are copied here for convenience. + +### Running tests + +The same check-markdown and check-examples programs that runs as a check on PR's is part of the repo and can be run locally. +To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/). +Alternatively, you can also use [`yarn`](https://yarnpkg.com/) instead of `npm`. +In this case replace all occurrences of `npm` with `yarn` below. + +First you'll need to install everything with npm once. Just navigate to the root of this repository and on +your command line run: + +```bash +npm install +``` + +Then to check markdown formatting and test the examples against the JSON schema, you can run: + +```bash +npm run test +``` + +This will spit out the same texts that you see online, and you can then go and fix your markdown or examples. + +To just check the markdown run: + +```bash +npm run check-markdown +``` + +To just check the examples run: + +```bash +npm run check-examples +``` + +If the tests reveal formatting problems with the examples, you can fix them with: + +```bash +npm run format-examples +``` From 699c8a8cedccb3f9cd709a6c0c3c3adc9959a599 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 30 Mar 2021 12:10:53 +0200 Subject: [PATCH 09/24] Fixed CI issues, made test chapter a bit more comprehensive --- .github/remark.yaml | 1 - .remarkignore | 1 - README.md | 21 ++------------------- examples/collection.json | 6 ++++-- 4 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 .remarkignore diff --git a/.github/remark.yaml b/.github/remark.yaml index 1fa7dd8..9d1b95c 100644 --- a/.github/remark.yaml +++ b/.github/remark.yaml @@ -21,7 +21,6 @@ plugins: - 'fenced' # Headings - remark-lint-heading-increment - - remark-lint-no-duplicate-headings - remark-lint-no-multiple-toplevel-headings - remark-lint-no-heading-punctuation - - remark-lint-maximum-heading-length diff --git a/.remarkignore b/.remarkignore deleted file mode 100644 index 20b126a..0000000 --- a/.remarkignore +++ /dev/null @@ -1 +0,0 @@ -/CHANGELOG.md diff --git a/README.md b/README.md index 796a0b2..f5b33b2 100644 --- a/README.md +++ b/README.md @@ -59,40 +59,23 @@ for running tests are copied here for convenience. ### Running tests -The same check-markdown and check-examples programs that runs as a check on PR's is part of the repo and can be run locally. +The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid. To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/). -Alternatively, you can also use [`yarn`](https://yarnpkg.com/) instead of `npm`. -In this case replace all occurrences of `npm` with `yarn` below. First you'll need to install everything with npm once. Just navigate to the root of this repository and on your command line run: - ```bash npm install ``` Then to check markdown formatting and test the examples against the JSON schema, you can run: - ```bash -npm run test +npm test ``` This will spit out the same texts that you see online, and you can then go and fix your markdown or examples. -To just check the markdown run: - -```bash -npm run check-markdown -``` - -To just check the examples run: - -```bash -npm run check-examples -``` - If the tests reveal formatting problems with the examples, you can fix them with: - ```bash npm run format-examples ``` diff --git a/examples/collection.json b/examples/collection.json index 67cdc43..0e36c98 100644 --- a/examples/collection.json +++ b/examples/collection.json @@ -1,8 +1,7 @@ { "stac_version": "1.0.0-rc.1", "stac_extensions": [ - "collection-assets", - "item-assets", + "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json", "https://stac-extensions.github.io/template/v1.0.0/schema.json" ], "type": "Collection", @@ -49,6 +48,9 @@ }, "item_assets": { "data": { + "roles": [ + "data" + ], "template:new_field": "test" } }, From b4ce5e08617cf76c2506ecffd9532b6f9c749571 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 30 Mar 2021 16:02:22 +0200 Subject: [PATCH 10/24] Clarify schema --- json-schema/schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/json-schema/schema.json b/json-schema/schema.json index 2a1783f..51860e2 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -5,7 +5,7 @@ "description": "STAC Template Extension for STAC Items and STAC Collections.", "oneOf": [ { - "$comment": "This is the schema for STAC Items.", + "$comment": "This is the schema for STAC Items. Remove this object if this extension only applies to Collections.", "allOf": [ { "type": "object", @@ -45,7 +45,7 @@ ] }, { - "$comment": "This is the schema for STAC Collections.", + "$comment": "This is the schema for STAC Collections. Remove this object if this extension does not define top-level fields for Collections AND can't be used in collection assets or item asset defintions.", "allOf": [ { "type": "object", @@ -71,10 +71,10 @@ } }, { - "$comment": "Remove this and the following object if this is not an extension to a Collection.", "$ref": "#/definitions/stac_extensions" }, { + "$comment": "Remove this object if this extension does not define top-level fields for Collections.", "$ref": "#/definitions/fields" } ] From dd675fa52c8529ba0cbec87484f7b7fe060e273c Mon Sep 17 00:00:00 2001 From: Fabian Schindler Date: Thu, 1 Apr 2021 00:01:25 +0200 Subject: [PATCH 11/24] Updating files from template --- .github/remark.yaml | 3 +- README.md | 112 ++++++++++++++++++++++++++++---------------- 2 files changed, 73 insertions(+), 42 deletions(-) diff --git a/.github/remark.yaml b/.github/remark.yaml index 1fa7dd8..564baf8 100644 --- a/.github/remark.yaml +++ b/.github/remark.yaml @@ -21,7 +21,6 @@ plugins: - 'fenced' # Headings - remark-lint-heading-increment - - remark-lint-no-duplicate-headings - remark-lint-no-multiple-toplevel-headings - remark-lint-no-heading-punctuation - - remark-lint-maximum-heading-length @@ -38,7 +37,7 @@ plugins: - - remark-lint-unordered-list-marker-style - '-' - - remark-lint-list-item-indent - - space + - space # Tables - remark-lint-table-pipes - remark-lint-no-literal-urls diff --git a/README.md b/README.md index e171533..85f3d45 100644 --- a/README.md +++ b/README.md @@ -7,32 +7,32 @@ - **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Proposal - **Owner**: @constantinius -This document explains the Tiled Assets Extension to the +This document explains the Tiled Assets Extension to the [SpatioTemporal Asset Catalog](https://github.com/radiantearth/stac-spec) (STAC) specification. -Some data products are too big to be handled in a single file or a small set of enumerated -files and are thus split into tiles. For example, Sentinel-2 datastrips are tiled into -overlapping granules, in some cases in even more than one coordinate reference system. -Other very big datasets, such as continental or global mosaics can also only be handled in -a tiled fashion. Usually, they go one step further and provide multiple layers of -resolution to allow a quick inspection of larger areas but also retain the possibility to +Some data products are too big to be handled in a single file or a small set of enumerated +files and are thus split into tiles. For example, Sentinel-2 datastrips are tiled into +overlapping granules, in some cases in even more than one coordinate reference system. +Other very big datasets, such as continental or global mosaics can also only be handled in +a tiled fashion. Usually, they go one step further and provide multiple layers of +resolution to allow a quick inspection of larger areas but also retain the possibility to get to the full resolution data. When a very large dataset is split into many tiles it is very impractical to list all possible files with the `assets` property. -This extension allows the specification of tiled assets within STAC Items. With this -extension it is possible to allow the description of assets using template references and -rules to construct those in order to get the tiles the user is interested in. The new -`asset_templates` property allows to specify template URLs where components can be replaced +This extension allows the specification of tiled assets within STAC Items. With this +extension it is possible to allow the description of assets using template references and +rules to construct those in order to get the tiles the user is interested in. The new +`asset_templates` property allows to specify template URLs where components can be replaced to get the final URLs to the actual files. -This extension is modelled in close alignment to the -[OGC Two Dimensional Tile Matrix Set](http://docs.opengeospatial.org/is/17-083r2/17-083r2.html). -The main access approach and the templating mechanism used is defined in +This extension is modelled in close alignment to the +[OGC Two Dimensional Tile Matrix Set](http://docs.opengeospatial.org/is/17-083r2/17-083r2.html). +The main access approach and the templating mechanism used is defined in the [OGC WMTS Simple Profile](http://docs.opengeospatial.org/is/13-082r2/13-082r2.html). - Examples: - - [Tiled](examples/example-tiled-assets-tiled.json) + - [Tiled](examples/example-tiled-assets-tiled.json) - [Dimension](examples/example-tiled-assets-dimension.json) - [JSON Schema](json-schema/schema.json) - [Changelog](./CHANGELOG.md) @@ -51,8 +51,8 @@ These fields can be applied to Item Properties, Collection, or Catalog objects. ### Tile Matrix Set Object -Tile matrix sets can be directly embedded in a Collection, Catalog or Item. -Such directly embedded tile matrix set objects must conform to the +Tile matrix sets can be directly embedded in a Collection, Catalog or Item. +Such directly embedded tile matrix set objects must conform to the [OGC Two Dimensional Tile Matrix Set JSON schema](http://schemas.opengis.net/tms/1.0/json/tms-schema.json). ## Item Properties fields @@ -62,12 +62,12 @@ Such directly embedded tile matrix set objects must conform to the | tiles:tile_matrix_set_links | Map | A mapping of tile matrix set identifier to a tile matrix set link object. | The keys of the `tiles:tile_matrix_set_links` mapping can be used as a substitution of - the `{TileMatrixSet}` template parameters for the `href` field of + the `{TileMatrixSet}` template parameters for the `href` field of the [Asset Object](https://github.com/radiantearth/stac-spec/tree/v1.0.0-rc.1/item-spec/item-spec.md#asset-object) used as `asset_template`. ### Tile Matrix Set Link Object -This object allows to reference a tile matrix set. This concept is modelled after the +This object allows to reference a tile matrix set. This concept is modelled after the [TileMatrixSetLink2D requirement class](http://docs.opengeospatial.org/is/17-083r2/17-083r2.html#18). | Field Name | Type | Description | @@ -79,11 +79,11 @@ This object allows to reference a tile matrix set. This concept is modelled afte **url**/**well_known_scale_set**: Either one of these parameters must be present. -**url**: The URL must refer to a valid tile matrix set definition as defined in the +**url**: The URL must refer to a valid tile matrix set definition as defined in the Two-dimensional tile matrix set specification in any encoding (JSON, JSON-LD, or XML). -It is also possible, to have the tile matrix set embedded in the Item's Collection, -Catalog or even in the Item's file itself using the `tiles:tile_matrix_sets` property. -When referring to an embedded tile matrix set definition, the name of the map key +It is also possible, to have the tile matrix set embedded in the Item's Collection, +Catalog or even in the Item's file itself using the `tiles:tile_matrix_sets` property. +When referring to an embedded tile matrix set definition, the name of the map key of that tile matrix set definition must be used as a URL fragment. Example reference to an external tile matrix definition: @@ -104,18 +104,18 @@ Example reference to an embedded definition in the same Item: "url": "#WebMercatorQuad" ``` -**limits**: The keys of the map are the identifiers of the tile matrices in their +**limits**: The keys of the map are the identifiers of the tile matrices in their respective tile matrix set. When present, only the referenced tile matrices are used -for the assets. When the `limits` are not present, the tile matrix set in full is +for the assets. When the `limits` are not present, the tile matrix set in full is referenced. -**pixel_buffer**: For each tile matrix in a tile matrix set, a pixel buffer can be -specified. Similarly to the `limits` property, the key of the mapping must be the +**pixel_buffer**: For each tile matrix in a tile matrix set, a pixel buffer can be +specified. Similarly to the `limits` property, the key of the mapping must be the identifier of one tile matrix. ### Tile Matrix Limits Object -This object allows to specify subset region of the source tileset. This concept is modelled +This object allows to specify subset region of the source tileset. This concept is modelled after the [TileMatrixSetLimits2D requirement class](http://docs.opengeospatial.org/is/17-083r2/17-083r2.html#17). | Field Name | Type | Description | @@ -127,8 +127,8 @@ after the [TileMatrixSetLimits2D requirement class](http://docs.opengeospatial.o ### Pixel Buffer Object -Pixel buffer objects allow the definition of image boundaries, so that the internal tiles -may overlap. When using this information, the clients may be able to reduce the number of +Pixel buffer objects allow the definition of image boundaries, so that the internal tiles +may overlap. When using this information, the clients may be able to reduce the number of requests. | Field Name | Type | Description | @@ -148,16 +148,16 @@ requests. | ------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | | asset_templates | Map | **REQUIRED.** An map key to Asset objects that use template parameters for later substitution | -**asset_templates**: The `href` field can make use of template parameters that can be -replaced with values to generate references to actual files. The available template -parameters are `{TileMatrixSet}`, `{TileMatrix}`, `{TileRow}`, and `{TileCol}`. The -templating mechanism is detailed in the +**asset_templates**: The `href` field can make use of template parameters that can be +replaced with values to generate references to actual files. The available template +parameters are `{TileMatrixSet}`, `{TileMatrix}`, `{TileRow}`, and `{TileCol}`. The +templating mechanism is detailed in the [OGC WMTS Simple Profile](http://docs.opengeospatial.org/is/13-082r2/13-082r2.html#17). -Additional template substitution parameters may be present, see the next section for +Additional template substitution parameters may be present, see the next section for more details. -Also: it is not mandatory, that all template parameters are present. If, for example, -the data is only available in one specific tile matrix, then that parameter can be omitted. +Also: it is not mandatory, that all template parameters are present. If, for example, +the data is only available in one specific tile matrix, then that parameter can be omitted. It is possible, for whatever reason, to have the same template parameter more than once in the same template string. @@ -173,13 +173,45 @@ This list is not exhaustive, other useful template substitutions may exist. ### Template examples - Plain: - + `http://example.com/data/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg` - Using `eo:bands`: - + `http://example.com/data/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{eo:bands}.jpeg` - Using `cube:dimensions`: - + `http://example.com/data/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{cube:dimensions:elevation}.jpeg` + + +## Contributing + +All contributions are subject to the +[STAC Specification Code of Conduct](https://github.com/radiantearth/stac-spec/blob/master/CODE_OF_CONDUCT.md). +For contributions, please follow the +[STAC specification contributing guide](https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md) Instructions +for running tests are copied here for convenience. + +### Running tests + +The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid. +To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/). + +First you'll need to install everything with npm once. Just navigate to the root of this repository and on +your command line run: +```bash +npm install +``` + +Then to check markdown formatting and test the examples against the JSON schema, you can run: +```bash +npm test +``` + +This will spit out the same texts that you see online, and you can then go and fix your markdown or examples. + +If the tests reveal formatting problems with the examples, you can fix them with: +```bash +npm run format-examples +``` From 8d2ff8d9faa48efdba3d6139f16cf79c5fdbe2ec Mon Sep 17 00:00:00 2001 From: Fabian Schindler Date: Thu, 1 Apr 2021 00:02:04 +0200 Subject: [PATCH 12/24] Deleting remarkignore --- .remarkignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .remarkignore diff --git a/.remarkignore b/.remarkignore deleted file mode 100644 index 20b126a..0000000 --- a/.remarkignore +++ /dev/null @@ -1 +0,0 @@ -/CHANGELOG.md From ce23671966c027bad3d3938bb393ed2f4685b827 Mon Sep 17 00:00:00 2001 From: Fabian Schindler Date: Thu, 1 Apr 2021 00:09:44 +0200 Subject: [PATCH 13/24] Fixing remark linting --- CHANGELOG.md | 5 ----- README.md | 1 - 2 files changed, 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d26cec..dd0fd2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed [Unreleased]: - -## [v1.0.0-beta.1] - 2020-05-29 - -### Added -- [Tiled Assets extension](extensions/tiled-assets/README.md), for representing data that has been split into tiles \ No newline at end of file diff --git a/README.md b/README.md index 85f3d45..79ca970 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,6 @@ This list is not exhaustive, other useful template substitutions may exist. `http://example.com/data/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{cube:dimensions:elevation}.jpeg` - ## Contributing All contributions are subject to the From c0f506b769cd8fea6c2dc34b8705d0e9033e4daa Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 26 Jul 2021 15:17:28 +0200 Subject: [PATCH 14/24] Improve schema to better validate assets, item assets, summaries. Don't fail validation when a collection has a top-level required field, but only assets are given etc. #6 --- json-schema/schema.json | 104 +++++++++++++++++++++++++++++++++------- 1 file changed, 87 insertions(+), 17 deletions(-) diff --git a/json-schema/schema.json b/json-schema/schema.json index 51860e2..d972109 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -7,6 +7,9 @@ { "$comment": "This is the schema for STAC Items. Remove this object if this extension only applies to Collections.", "allOf": [ + { + "$ref": "#/definitions/stac_extensions" + }, { "type": "object", "required": [ @@ -21,7 +24,7 @@ "properties": { "allOf": [ { - "$comment": "Require fields here for item properties.", + "$comment": "Require fields here for Item Properties.", "required": [ "template:new_field" ] @@ -32,50 +35,109 @@ ] }, "assets": { + "$comment": "This validates the fields in Item Assets, but does not require them.", "type": "object", "additionalProperties": { "$ref": "#/definitions/fields" } } } - }, - { - "$ref": "#/definitions/stac_extensions" } ] }, { - "$comment": "This is the schema for STAC Collections. Remove this object if this extension does not define top-level fields for Collections AND can't be used in collection assets or item asset defintions.", + "$comment": "This is the schema for STAC Collections.", + "type": "object", "allOf": [ { - "type": "object", "required": [ "type" ], "properties": { "type": { "const": "Collection" + } + } + }, + { + "$ref": "#/definitions/stac_extensions" + } + ], + "anyOf": [ + { + "$comment": "This is the schema for the top-level fields in a Collection. Remove this if this extension does not define top-level fields for Collections.", + "allOf": [ + { + "$comment": "Require fields here for Collections (top-level).", + "required": [ + "template:new_field" + ] }, + { + "$ref": "#/definitions/fields" + } + ] + }, + { + "$comment": "This validates the fields in Collection Assets, but does not require them.", + "required": [ + "assets" + ], + "properties": { "assets": { "type": "object", - "additionalProperties": { - "$ref": "#/definitions/fields" + "not": { + "additionalProperties": { + "not": { + "allOf": [ + { + "$ref": "#/definitions/require_any_field" + }, + { + "$ref": "#/definitions/fields" + } + ] + } + } } - }, + } + } + }, + { + "$comment": "This is the schema for the fields in Item Asset Definitions. It doesn't require any fields.", + "required": [ + "item_assets" + ], + "properties": { "item_assets": { "type": "object", - "additionalProperties": { - "$ref": "#/definitions/fields" + "not": { + "additionalProperties": { + "not": { + "allOf": [ + { + "$ref": "#/definitions/require_any_field" + }, + { + "$ref": "#/definitions/fields" + } + ] + } + } } } } }, { - "$ref": "#/definitions/stac_extensions" - }, - { - "$comment": "Remove this object if this extension does not define top-level fields for Collections.", - "$ref": "#/definitions/fields" + "$comment": "This is the schema for the fields in Summaries. By default, only checks the existance of the properties, but not the schema of the summaries.", + "required": [ + "summaries" + ], + "properties": { + "summaries": { + "$ref": "#/definitions/require_any_field" + } + } } ] } @@ -95,8 +157,16 @@ } } }, + "require_any_field": { + "$comment": "Please list all fields here so that we can force the existance of one of them in other parts of the schemas.", + "anyOf": [ + {"required": ["template:new_field"]}, + {"required": ["template:xyz"]}, + {"required": ["template:another_one"]} + ] + }, "fields": { - "$comment": "Add your new fields here. Don't require them here, do that above in the item schema.", + "$comment": "Add your new fields here. Don't require them here, do that above in the corresponding schema.", "type": "object", "properties": { "template:new_field": { From 4b774f83116386d643fd9e22159b557a31a7852d Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Sat, 27 Nov 2021 12:10:00 +0000 Subject: [PATCH 15/24] chore: Fix whitespace (#19) --- .github/remark.yaml | 2 +- .github/workflows/publish.yaml | 2 +- .github/workflows/test.yaml | 2 +- examples/collection.json | 2 +- examples/item.json | 2 +- json-schema/schema.json | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/remark.yaml b/.github/remark.yaml index 9d1b95c..564baf8 100644 --- a/.github/remark.yaml +++ b/.github/remark.yaml @@ -37,7 +37,7 @@ plugins: - - remark-lint-unordered-list-marker-style - '-' - - remark-lint-list-item-indent - - space + - space # Tables - remark-lint-table-pipes - remark-lint-no-literal-urls diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9cba42f..53220f9 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,4 +14,4 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: json-schema - destination_dir: ${{ env.GITHUB_REF_SLUG }} \ No newline at end of file + destination_dir: ${{ env.GITHUB_REF_SLUG }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 87f33a5..d44317b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,4 +11,4 @@ jobs: - uses: actions/checkout@v2 - run: | npm install - npm test \ No newline at end of file + npm test diff --git a/examples/collection.json b/examples/collection.json index 0e36c98..5e7ce59 100644 --- a/examples/collection.json +++ b/examples/collection.json @@ -70,4 +70,4 @@ "rel": "item" } ] -} \ No newline at end of file +} diff --git a/examples/item.json b/examples/item.json index 06905fd..42f9ee9 100644 --- a/examples/item.json +++ b/examples/item.json @@ -64,4 +64,4 @@ "template:new_field": "test" } } -} \ No newline at end of file +} diff --git a/json-schema/schema.json b/json-schema/schema.json index d972109..5920353 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -190,9 +190,9 @@ "type": "number" } } - }, + }, "template:another_one": { - "type": "array", + "type": "array", "items": { "type": "number" } @@ -206,4 +206,4 @@ "additionalProperties": false } } -} \ No newline at end of file +} From 64afb5b2f3b509e4e051a312288a2162ab8924ce Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Mon, 29 Nov 2021 21:49:17 +0000 Subject: [PATCH 16/24] chore: Ignore Editor configurations (#15) * chore: Add newline at EOF * chore: Order gitignores * chore: Mark node_modules as directory * chore: Ignore IDEA configuration * chore: Ignore more common files Co-authored-by: Matthias Mohr --- .gitignore | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b68addb..3ec698f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,12 @@ +# OS files +.DS_Store +Thumbs.db + +# Editors +/.idea/ +/.vscode/ + +# Node / npm +.npm +/node_modules/ /package-lock.json -/node_modules \ No newline at end of file From ed66517660a438379bea7e96d5533c810b78cd37 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Sat, 11 Dec 2021 15:59:30 +0100 Subject: [PATCH 17/24] Update Node version in CI tests --- .github/workflows/test.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d44317b..dbe73cf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,11 +3,10 @@ on: [push, pull_request] jobs: deploy: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] steps: - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 + with: + node-version: 'lts/*' - uses: actions/checkout@v2 - run: | npm install From 7dfc84fd70c4cf15d6035968323c0baf8da06dd8 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 8 Feb 2022 15:28:56 +0100 Subject: [PATCH 18/24] Update version number in examples to 1.0.0 --- examples/collection.json | 2 +- examples/item.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/collection.json b/examples/collection.json index 5e7ce59..2472ecc 100644 --- a/examples/collection.json +++ b/examples/collection.json @@ -1,5 +1,5 @@ { - "stac_version": "1.0.0-rc.1", + "stac_version": "1.0.0", "stac_extensions": [ "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json", "https://stac-extensions.github.io/template/v1.0.0/schema.json" diff --git a/examples/item.json b/examples/item.json index 42f9ee9..cf19370 100644 --- a/examples/item.json +++ b/examples/item.json @@ -1,5 +1,5 @@ { - "stac_version": "1.0.0-rc.1", + "stac_version": "1.0.0", "stac_extensions": [ "https://stac-extensions.github.io/template/v1.0.0/schema.json" ], From 019f348b871eb3ce0b13100dbd7d46af217aeeae Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 1 Aug 2022 13:12:13 -0600 Subject: [PATCH 19/24] Spelling correction (#22) --- json-schema/schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/json-schema/schema.json b/json-schema/schema.json index 5920353..8eae23b 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -129,7 +129,7 @@ } }, { - "$comment": "This is the schema for the fields in Summaries. By default, only checks the existance of the properties, but not the schema of the summaries.", + "$comment": "This is the schema for the fields in Summaries. By default, only checks the existence of the properties, but not the schema of the summaries.", "required": [ "summaries" ], @@ -158,7 +158,7 @@ } }, "require_any_field": { - "$comment": "Please list all fields here so that we can force the existance of one of them in other parts of the schemas.", + "$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.", "anyOf": [ {"required": ["template:new_field"]}, {"required": ["template:xyz"]}, From 12f9873e9f311ee77142a60bbb16e233c569a897 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 31 Aug 2022 16:43:16 +0200 Subject: [PATCH 20/24] Clearly state where the fields can be used #21 (#23) --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f5b33b2..06ba529 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,14 @@ This is the place to add a short introduction. - [JSON Schema](json-schema/schema.json) - [Changelog](./CHANGELOG.md) -## Item Properties and Collection Fields +## Fields + +The fields in the table below can be used in these parts of STAC documents: +- [ ] Catalogs +- [x] Collections +- [x] Item Properties (incl. Summaries in Collections) +- [x] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections) +- [ ] Links | Field Name | Type | Description | | -------------------- | ------------------------- | ----------- | From 82c71bf6fc8f905064786fe295a4051c105f5e6b Mon Sep 17 00:00:00 2001 From: Phil Varner Date: Mon, 2 Oct 2023 09:34:13 -0400 Subject: [PATCH 21/24] update github ci and npm package versions (#26) * update github ci and npm package versions * add gfm remark plugin --------- Co-authored-by: Matthias Mohr --- .github/remark.yaml | 3 +++ .github/workflows/publish.yaml | 6 +++--- .github/workflows/test.yaml | 4 ++-- .gitignore | 2 +- README.md | 25 +++++++++++++------------ package.json | 19 ++++++++++--------- 6 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.github/remark.yaml b/.github/remark.yaml index 564baf8..70dddb2 100644 --- a/.github/remark.yaml +++ b/.github/remark.yaml @@ -1,4 +1,6 @@ plugins: +# GitHub Flavored Markdown + - remark-gfm # Check links - validate-links # Apply some recommended defaults for consistency @@ -8,6 +10,7 @@ plugins: # General formatting - - remark-lint-emphasis-marker - '*' + - remark-lint-no-undefined-references - remark-lint-hard-break-spaces - remark-lint-blockquote-indentation - remark-lint-no-consecutive-blank-lines diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 53220f9..029974a 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Inject env variables - uses: rlespinasse/github-slug-action@v3.x - - uses: actions/checkout@v2 + uses: rlespinasse/github-slug-action@v4.4.1 + - uses: actions/checkout@v4 - name: deploy JSON Schema for version ${{ env.GITHUB_REF_SLUG }} - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v3.9.3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: json-schema diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dbe73cf..0b7a055 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,10 +4,10 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: 'lts/*' - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: | npm install npm test diff --git a/.gitignore b/.gitignore index 3ec698f..8ab09c2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ Thumbs.db # Node / npm .npm /node_modules/ -/package-lock.json +package-lock.json \ No newline at end of file diff --git a/README.md b/README.md index 06ba529..bf65d0e 100644 --- a/README.md +++ b/README.md @@ -19,17 +19,18 @@ This is the place to add a short introduction. ## Fields The fields in the table below can be used in these parts of STAC documents: + - [ ] Catalogs - [x] Collections - [x] Item Properties (incl. Summaries in Collections) - [x] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections) - [ ] Links -| Field Name | Type | Description | -| -------------------- | ------------------------- | ----------- | +| Field Name | Type | Description | +| -------------------- | ------------------------- | -------------------------------------------- | | template:new_field | string | **REQUIRED**. Describe the required field... | -| template:xyz | [XYZ Object](#xyz-object) | Describe the field... | -| template:another_one | \[number] | Describe the field... | +| template:xyz | [XYZ Object](#xyz-object) | Describe the field... | +| template:another_one | \[number] | Describe the field... | ### Additional Field Information @@ -41,20 +42,20 @@ This is a much more detailed description of the field `template:new_field`... This is the introduction for the purpose and the content of the XYZ Object... -| Field Name | Type | Description | -| ----------- | ------ | ----------- | -| x | number | **REQUIRED**. Describe the required field... | -| y | number | **REQUIRED**. Describe the required field... | -| z | number | **REQUIRED**. Describe the required field... | +| Field Name | Type | Description | +| ---------- | ------ | -------------------------------------------- | +| x | number | **REQUIRED**. Describe the required field... | +| y | number | **REQUIRED**. Describe the required field... | +| z | number | **REQUIRED**. Describe the required field... | ## Relation types The following types should be used as applicable `rel` types in the [Link Object](https://github.com/radiantearth/stac-spec/tree/master/item-spec/item-spec.md#link-object). -| Type | Description | -| ------------------- | ----------- | -| fancy-rel-type | This link points to a fancy resource. | +| Type | Description | +| -------------- | ------------------------------------- | +| fancy-rel-type | This link points to a fancy resource. | ## Contributing diff --git a/package.json b/package.json index 46d280a..c8eee26 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "stac-extensions", + "name": "stac-extension-template", "version": "1.0.0", "scripts": { "test": "npm run check-markdown && npm run check-examples", @@ -8,13 +8,14 @@ "format-examples": "stac-node-validator . --format --schemaMap https://stac-extensions.github.io/template/v1.0.0/schema.json=./json-schema/schema.json" }, "dependencies": { - "remark-cli": "^8.0.0", - "remark-lint": "^7.0.0", - "remark-lint-no-html": "^2.0.0", - "remark-preset-lint-consistent": "^3.0.0", - "remark-preset-lint-markdown-style-guide": "^3.0.0", - "remark-preset-lint-recommended": "^4.0.0", - "remark-validate-links": "^10.0.0", - "stac-node-validator": "^1.0.0" + "remark-cli": "^12.0.0", + "remark-gfm": "^4.0.0", + "remark-lint": "^9.1.2", + "remark-lint-no-html": "^3.1.2", + "remark-preset-lint-consistent": "^5.1.2", + "remark-preset-lint-markdown-style-guide": "^5.1.3", + "remark-preset-lint-recommended": "^6.1.3", + "remark-validate-links": "^13.0.0", + "stac-node-validator": "^1.3.0" } } From 73a530ffa8390bc96de166ffa8e3ac3fdfa14b7d Mon Sep 17 00:00:00 2001 From: Fabian Schindler Date: Fri, 23 Aug 2024 11:32:32 +0200 Subject: [PATCH 22/24] Fixing markdown lint issues --- .github/pull_request_template.md | 13 ------------- CHANGELOG.md | 2 +- README.md | 32 ++++++++++++++++---------------- 3 files changed, 17 insertions(+), 30 deletions(-) delete mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 3e4e0b0..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,13 +0,0 @@ -**Related Issue(s):** # - - -**Proposed Changes:** - -1. -2. - -**PR Checklist:** - -- [ ] This PR is made against the `dev` branch (all proposed changes except releases should be against `dev`, not main). -- [ ] This PR has **no** breaking changes. -- [ ] I have added my changes to the CHANGELOG **or** a CHANGELOG entry is not required. diff --git a/CHANGELOG.md b/CHANGELOG.md index 21fd7cb..93959de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,4 +20,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -[Unreleased]: +[v1.0.0]: diff --git a/README.md b/README.md index 79ca970..6c482d8 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ These fields can be applied to Item Properties, Collection, or Catalog objects. | Field Name | Type | Description | | ------------------------ | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| tiles:tile_matrix_sets | Map | **REQUIRED for Collections and Catalogs.** A mapping of tile matrix set identifier to a tile matrix set link object. | +| tiles:tile_matrix_sets | Map | **REQUIRED for Collections and Catalogs.** A mapping of tile matrix set identifier to a tile matrix set link object. | ### Tile Matrix Set Object @@ -59,7 +59,7 @@ Such directly embedded tile matrix set objects must conform to the | Field Name | Type | Description | | --------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| tiles:tile_matrix_set_links | Map | A mapping of tile matrix set identifier to a tile matrix set link object. | +| tiles:tile_matrix_set_links | Map | A mapping of tile matrix set identifier to a tile matrix set link object. | The keys of the `tiles:tile_matrix_set_links` mapping can be used as a substitution of the `{TileMatrixSet}` template parameters for the `href` field of @@ -75,7 +75,7 @@ This object allows to reference a tile matrix set. This concept is modelled afte | url | string | The URL reference to the actual tile matrix definition. | | well_known_scale_set | string | If the tile matrix set completely aligns with a well known scale set can be referenced. | | limits | Map | Optional limits for each tile matrix. | -| pixel_buffer | Map | An optional pixel buffer description object per tile matrix. By default, no pixel buffers are used. | +| pixel_buffer | Map | An optional pixel buffer description object per tile matrix. By default, no pixel buffers are used. | **url**/**well_known_scale_set**: Either one of these parameters must be present. @@ -118,12 +118,12 @@ identifier of one tile matrix. This object allows to specify subset region of the source tileset. This concept is modelled after the [TileMatrixSetLimits2D requirement class](http://docs.opengeospatial.org/is/17-083r2/17-083r2.html#17). -| Field Name | Type | Description | -| ------------- | ------- | --------------------------------------------------------------------------------------------------------------------- | -| min_tile_row | number | Minimum tile row index valid for this layer. If not specified it uses the the one from the referenced tile matrix. | -| max_tile_row | number | Maximum tile row index valid for this layer. If not specified it uses the the one from the referenced tile matrix. | -| min_tile_col | number | Minimum tile column index valid for this layer. If not specified it uses the the one from the referenced tile matrix. | -| max_tile_col | number | Maximum tile column index valid for this layer. If not specified it uses the the one from the referenced tile matrix. | +| Field Name | Type | Description | +| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------- | +| min_tile_row | number | Minimum tile row index valid for this layer. If not specified it uses the the one from the referenced tile matrix. | +| max_tile_row | number | Maximum tile row index valid for this layer. If not specified it uses the the one from the referenced tile matrix. | +| min_tile_col | number | Minimum tile column index valid for this layer. If not specified it uses the the one from the referenced tile matrix. | +| max_tile_col | number | Maximum tile column index valid for this layer. If not specified it uses the the one from the referenced tile matrix. | ### Pixel Buffer Object @@ -144,9 +144,9 @@ requests. ## Item fields -| Field Name | Type | Description | -| ------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| asset_templates | Map | **REQUIRED.** An map key to Asset objects that use template parameters for later substitution | +| Field Name | Type | Description | +| --------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| asset_templates | Map | **REQUIRED.** An map key to Asset objects that use template parameters for later substitution | **asset_templates**: The `href` field can make use of template parameters that can be replaced with values to generate references to actual files. The available template @@ -163,10 +163,10 @@ It is possible, for whatever reason, to have the same template parameter more th ### Template Parameters from other extensions -| Extension | Property | Template parameter | Mapping description | -| ------------- | ---------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| eo | bands | `{eo:band}` | Each bands name can be used as a substitution value for this bands parameter. | -| datacube | dimensions | `{cube:dimensions:}` | The template parameter must specify which dimension it refers to by replacing the ``. Any value that is representable via a `dimension` can be used as a substitution. | +| Extension | Property | Template parameter | Mapping description | +| --------- | ---------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| eo | bands | `{eo:band}` | Each bands name can be used as a substitution value for this bands parameter. | +| datacube | dimensions | `{cube:dimensions:}` | The template parameter must specify which dimension it refers to by replacing the ``. Any value that is representable via a `dimension` can be used as a substitution. | This list is not exhaustive, other useful template substitutions may exist. From 78004cdbab3f4af837db0fc64d94eff5153e97b3 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 23 Aug 2024 12:07:20 +0200 Subject: [PATCH 23/24] Update version numbers --- README.md | 4 ++-- examples/example-tiled-assets-dimension.json | 2 +- examples/example-tiled-assets-tiled.json | 2 +- json-schema/schema.json | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6c482d8..ea236ed 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Such directly embedded tile matrix set objects must conform to the The keys of the `tiles:tile_matrix_set_links` mapping can be used as a substitution of the `{TileMatrixSet}` template parameters for the `href` field of - the [Asset Object](https://github.com/radiantearth/stac-spec/tree/v1.0.0-rc.1/item-spec/item-spec.md#asset-object) used as `asset_template`. + the [Asset Object](https://github.com/radiantearth/stac-spec/tree/v1.0.0/item-spec/item-spec.md#asset-object) used as `asset_template`. ### Tile Matrix Set Link Object @@ -146,7 +146,7 @@ requests. | Field Name | Type | Description | | --------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| asset_templates | Map | **REQUIRED.** An map key to Asset objects that use template parameters for later substitution | +| asset_templates | Map | **REQUIRED.** An map key to Asset objects that use template parameters for later substitution | **asset_templates**: The `href` field can make use of template parameters that can be replaced with values to generate references to actual files. The available template diff --git a/examples/example-tiled-assets-dimension.json b/examples/example-tiled-assets-dimension.json index a25ff0b..cc1fc47 100644 --- a/examples/example-tiled-assets-dimension.json +++ b/examples/example-tiled-assets-dimension.json @@ -1,5 +1,5 @@ { - "stac_version": "1.0.0-rc.1", + "stac_version": "1.0.0", "stac_extensions": [ "https://stac-extensions.github.io/tiled-assets/v1.0.0/schema.json", "https://stac-extensions.github.io/eo/v1.0.0/schema.json" diff --git a/examples/example-tiled-assets-tiled.json b/examples/example-tiled-assets-tiled.json index afd85da..f220013 100644 --- a/examples/example-tiled-assets-tiled.json +++ b/examples/example-tiled-assets-tiled.json @@ -1,5 +1,5 @@ { - "stac_version": "1.0.0-rc.1", + "stac_version": "1.0.0", "stac_extensions": [ "https://stac-extensions.github.io/tiled-assets/v1.0.0/schema.json", "https://stac-extensions.github.io/eo/v1.0.0/schema.json" diff --git a/json-schema/schema.json b/json-schema/schema.json index ee220b2..950b324 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -7,7 +7,7 @@ { "allOf": [ { - "$ref": "https://schemas.stacspec.org/v1.0.0-rc.1/item-spec/json-schema/item.json" + "$ref": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json" }, { "$ref": "#/definitions/stac_extensions" @@ -20,7 +20,7 @@ { "allOf": [ { - "$ref": "https://schemas.stacspec.org/v1.0.0-rc.1/catalog-spec/json-schema/catalog.json" + "$ref": "https://schemas.stacspec.org/v1.0.0/catalog-spec/json-schema/catalog.json" }, { "$ref": "#/definitions/stac_extensions" @@ -33,7 +33,7 @@ { "allOf": [ { - "$ref": "https://schemas.stacspec.org/v1.0.0-rc.1/collection-spec/json-schema/collection.json" + "$ref": "https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json" }, { "$ref": "#/definitions/stac_extensions" @@ -102,7 +102,7 @@ "description": "Links to assets templates. These are regular assets that may have template arguments in their href property.", "type": "object", "additionalProperties": { - "$ref": "https://schemas.stacspec.org/v1.0.0-rc.1/item-spec/json-schema/item.json#/definitions/asset" + "$ref": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/asset" } } } From 1a454075ff1ac28304f3959e1a0e6bfc82906863 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 23 Aug 2024 12:16:56 +0200 Subject: [PATCH 24/24] Update schema --- json-schema/schema.json | 260 +++++++++++++++++++++++++++++++++++----- 1 file changed, 227 insertions(+), 33 deletions(-) diff --git a/json-schema/schema.json b/json-schema/schema.json index 950b324..b6ccd56 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -3,41 +3,62 @@ "$id": "https://stac-extensions.github.io/tiled-assets/v1.0.0/schema.json#", "title": "Tiled Assets Extension", "description": "STAC Tiled Assets Extension for STAC Items and STAC Collections.", + "type": "object", + "required": [ + "stac_extensions" + ], + "properties": { + "stac_extensions": { + "type": "array", + "contains": { + "const": "https://stac-extensions.github.io/tiled-assets/v1.0.0/schema.json" + } + } + }, "oneOf": [ { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "const": "Feature" + } + }, "allOf": [ - { - "$ref": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json" - }, - { - "$ref": "#/definitions/stac_extensions" - }, { "$ref": "#/definitions/item-tiles" } ] }, { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "const": "Catalog" + } + }, "allOf": [ - { - "$ref": "https://schemas.stacspec.org/v1.0.0/catalog-spec/json-schema/catalog.json" - }, - { - "$ref": "#/definitions/stac_extensions" - }, { "$ref": "#/definitions/catalog-collection-tiles" } ] }, { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "const": "Collection" + } + }, "allOf": [ - { - "$ref": "https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json" - }, - { - "$ref": "#/definitions/stac_extensions" - }, { "$ref": "#/definitions/catalog-collection-tiles" } @@ -45,20 +66,6 @@ } ], "definitions": { - "stac_extensions": { - "type": "object", - "required": [ - "stac_extensions" - ], - "properties": { - "stac_extensions": { - "type": "array", - "contains": { - "const": "https://stac-extensions.github.io/tiled-assets/v1.0.0/schema.json" - } - } - } - }, "catalog-collection-tiles": { "title": "Tile matrix additions to STAC Collections and Catalogs", "description": "Allows the definition of tile matrix sets on a Collection or Catalog.", @@ -108,7 +115,49 @@ } }, "tile_matrix_set": { - "$ref": "http://schemas.opengis.net/tms/1.0/json/tms-schema.json" + "$comment": "Should be a $ref to http://schemas.opengis.net/tms/1.0/json/tms-schema.json but it doesn't work", + "type": "object", + "required": ["type", "identifier", "supportedCRS", "tileMatrix"], + "properties": { + "type": { + "description": "Type of the Tile Matrix Set", + "enum": ["TileMatrixSetType"] + }, + "title": { + "description": "Title of this tile matrix set, normally used for display to a human", + "type": "string" + }, + "abstract": { + "description": "Brief narrative description of this tile matrix set, normally available for display to a human", + "type": "string" + }, + "keywords": { + "description": "Unordered list of one or more commonly used or formalized word(s) or phrase(s) used to describe this dataset", + "$ref": "#/definitions/keywords" + }, + "identifier": { + "description": "Tile matrix set identifier", + "type": "string" + }, + "boundingBox": { + "description": "Minimum bounding rectangle surrounding the tile matrix set, in the supported CRS", + "$ref": "#/definitions/boundingBox" + }, + "supportedCRS": { + "description": "Reference to one coordinate reference system (CRS)", + "type": "string", + "format": "uri" + }, + "wellKnownScaleSet": { + "description": "Reference to a well-known scale set", + "type": "string", + "format": "uri" + }, + "tileMatrix": { + "description": "Describes a scale level and its tile matrix", + "$ref": "#/definitions/tileMatrix" + } + } }, "tile_matrix_link": { "type": "object", @@ -217,6 +266,151 @@ "description": "Whether or not the pixelbuffer is included images on the right border of the last tile row. Default is `true`." } } + }, + "keywords": { + "description": "Unordered list of one or more commonly used or formalised word(s) or phrase(s) used to describe this resource", + "type": "array", + "items": { + "type": "string" + } + }, + "boundingBox": { + "description": "Minimum bounding rectangle surrounding the tile matrix set, in the supported CRS", + "type": "object", + "required": ["type", "lowerCorner", "upperCorner"], + "properties": + { + "type": { + "description": "Type of the Bounding Bos", + "enum": ["BoundingBoxType"] + }, + "crs": { + "description": "", + "type": "string", + "format": "uri" + }, + "lowerCorner": { + "description": "", + "type": "array", + "items": { + "type": "number", + "minItems": 2, + "maxItems": 2 + } + }, + "upperCorner": { + "description": "", + "type": "array", + "items": { + "type": "number", + "minItems": 2, + "maxItems": 2 + } + } + } + }, + "tileMatrix": { + "type": "array", + "items": { + "type": "object", + "required": ["type", "identifier", "scaleDenominator", "topLeftCorner", "tileWidth", "tileHeight", "matrixWidth", "matrixHeight"], + "properties": { + "type": { + "description": "Type of the Tile Matrix", + "enum": ["TileMatrixType"] + }, + "title": { + "description": "Title of this tile matrix set, normally used for display to a human", + "type": "string" + }, + "abstract": { + "description": "Brief narrative description of this tile matrix set, normally available for display to a human", + "type": "string" + }, + "keywords": { + "description": "Unordered list of one or more commonly used or formalized word(s) or phrase(s) used to describe this dataset", + "$ref": "#/definitions/keywords" + }, + "identifier": { + "description": "Tile matrix identifier", + "type": "string" + }, + "scaleDenominator": { + "description": "Scale denominator level of this tile matrix", + "type": "number" + }, + "topLeftCorner": { + "description": "Position in CRS coordinates of the top-left corner of this tile matrix", + "type": "array", + "items": { + "type": "number", + "minItems": 2, + "maxItems": 2 + } + }, + "tileWidth": { + "description": "Width of each tile of this tile matrix in pixels", + "type": "number", + "minimum": 1, + "multipleOf" : 1 + }, + "tileHeight": { + "description": "Height of each tile of this tile matrix in pixels", + "type": "number", + "minimum": 1, + "multipleOf" : 1 + }, + "matrixWidth": { + "description": "Width of the matrix (number of tiles in width)", + "type": "number", + "minimum": 1, + "multipleOf" : 1 + }, + "matrixHeight": { + "description": "Height of the matrix (number of tiles in height)", + "type": "number", + "minimum": 1, + "multipleOf" : 1 + }, + "variableMatrixWidth": { + "description": "Describes the rows that has variable matix width", + "$ref": "#/definitions/variableMatrixWidth" + } + } + } + }, + "variableMatrixWidth": { + "description": "List of data structures defining the tiles rows that was variable width", + "type": "array", + "items": { + "description": "Variable Matrix Width data structure", + "type": "object", + "required": ["type", "coalesce", "minTileRow", "maxTileRow"], + "properties": { + "type": { + "description": "Type of the Variable Matrix Width", + "enum": ["VariableMatrixWidthType"] + }, + "coalesce" : { + "description": "Coalescence factor", + "type": "number", + "minimum": 2, + "multipleOf" : 1 + }, + "minTileRow": { + "description": "Minimum tile row index valid for this layer", + "type": "number", + "minimum": 0, + "multipleOf" : 1 + }, + "maxTileRow": { + "description": "Maximim tile row index valid for this layer", + "type": "number", + "minimum": 0, + "multipleOf" : 1 + } + } + } } } } \ No newline at end of file