├── .github ├── remark.yaml └── workflows │ ├── publish.yaml │ └── test.yaml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── examples ├── collection.json └── item.json ├── json-schema └── schema.json └── package.json /.github/remark.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | # Check links 3 | - validate-links 4 | # Apply some recommended defaults for consistency 5 | - remark-preset-lint-consistent 6 | - remark-preset-lint-recommended 7 | - lint-no-html 8 | # General formatting 9 | - - remark-lint-emphasis-marker 10 | - '*' 11 | - remark-lint-hard-break-spaces 12 | - remark-lint-blockquote-indentation 13 | - remark-lint-no-consecutive-blank-lines 14 | - - remark-lint-maximum-line-length 15 | - 150 16 | # Code 17 | - remark-lint-fenced-code-flag 18 | - remark-lint-fenced-code-marker 19 | - remark-lint-no-shell-dollars 20 | - - remark-lint-code-block-style 21 | - 'fenced' 22 | # Headings 23 | - remark-lint-heading-increment 24 | - remark-lint-no-multiple-toplevel-headings 25 | - remark-lint-no-heading-punctuation 26 | - - remark-lint-maximum-heading-length 27 | - 70 28 | - - remark-lint-heading-style 29 | - atx 30 | - - remark-lint-no-shortcut-reference-link 31 | - false 32 | # Lists 33 | - remark-lint-list-item-bullet-indent 34 | - remark-lint-ordered-list-marker-style 35 | - remark-lint-ordered-list-marker-value 36 | - remark-lint-checkbox-character-style 37 | - - remark-lint-unordered-list-marker-style 38 | - '-' 39 | - - remark-lint-list-item-indent 40 | - space 41 | # Tables 42 | - remark-lint-table-pipes 43 | - remark-lint-no-literal-urls 44 | -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | name: Publish JSON Schema 2 | on: 3 | release: 4 | types: [published] 5 | jobs: 6 | deploy: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Inject env variables 10 | uses: rlespinasse/github-slug-action@v3.x 11 | - uses: actions/checkout@v2 12 | - name: deploy JSON Schema for version ${{ env.GITHUB_REF_SLUG }} 13 | uses: peaceiris/actions-gh-pages@v3 14 | with: 15 | github_token: ${{ secrets.GITHUB_TOKEN }} 16 | publish_dir: json-schema 17 | destination_dir: ${{ env.GITHUB_REF_SLUG }} -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: Check Markdown and Examples 2 | on: [push, pull_request] 3 | jobs: 4 | deploy: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/setup-node@v2 8 | with: 9 | node-version: 'lts/*' 10 | - uses: actions/checkout@v2 11 | - run: | 12 | npm install 13 | npm test 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /package-lock.json 2 | /node_modules -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [Unreleased] 8 | 9 | ### Added 10 | 11 | ### Changed 12 | 13 | ### Deprecated 14 | 15 | ### Removed 16 | 17 | ### Fixed 18 | 19 | [Unreleased]: 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xarray Assets Extension Specification 2 | 3 | - **Title:** xarray Assets 4 | - **Identifier:** 5 | - **Field Name Prefix:** xarray 6 | - **Scope:** Asset 7 | - **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Deprecated 8 | - **Owner**: @TomAugspurger 9 | 10 | 11 | # Deprecation Notice 12 | 13 | This extension has been deprecated. While useful, it ended up being to specific to xarray and Python. 14 | Instead of this extension, we recommend the following extensions and libraries to enable opening 15 | xarray Datasets from a STAC item / asset: 16 | 17 | 1. A yet to create `zarr` extension to capture metadata about a Zarr hierarchy, like whether it is `consolidated`. Proposals are welcome. 18 | 2. The [`storage` extension](https://github.com/stac-extensions/storage) for additional storage-specific information 19 | 3. The [xpystac](https://github.com/stac-utils/xpystac) library for opening xarray datasets from STAC metadata, rather than manually extracting information and calling `xarray.open_dataset` directly. 20 | 21 | # Description 22 | 23 | This document explains the xarray Assets Extension to the 24 | [SpatioTemporal Asset Catalog](https://github.com/radiantearth/stac-spec) (STAC) specification. 25 | 26 | This extension helps users open STAC Assets with [xarray](https://xarray.pydata.org/en/stable/). It gives a place 27 | for catalog maintainers to specify various required or recommended options. Without this extension, 28 | users would somehow need to know which options are required in order to load the dataset. 29 | See [Python Example](#python-example) for an example of how consumers of this extension can use it to simplify data loading. 30 | 31 | See also [xpystac](https://github.com/stac-utils/xpystac), which enables opening a variety of STAC assets with xarray. 32 | 33 | - Examples: 34 | - [Item example](examples/item.json): Shows the basic usage of the extension in a STAC Item 35 | - [Collection example](examples/collection.json): Shows the basic usage of the extension in a STAC Collection 36 | - [JSON Schema](json-schema/schema.json) 37 | - [Changelog](./CHANGELOG.md) 38 | 39 | ## Item Properties and Collection Fields 40 | 41 | | Field Name | Type | Description | 42 | | ------------------------ | ------------------------- | ----------------------------------------------------- | 43 | | xarray:open_kwargs | Map | Keyword arguments to provide to the xarray opener | 44 | | xarray:storage_options | Map | Additional keywords to provide to `fsspec.filesystem` | 45 | 46 | ### Additional Field Information 47 | 48 | #### xarray:open_kwargs 49 | 50 | Keyword arguments to provide to the xarray opener, for example [`xarray.open_zarr`](https://xarray.pydata.org/en/stable/generated/xarray.open_zarr.html). 51 | The opener should be determined by the media type of the asset. 52 | 53 | The are in addition to the positional argument, for example the `store`, which is obtained from the Assets `href`. For example, to specify [consolidated metadata](https://zarr.readthedocs.io/en/stable/tutorial.html): 54 | 55 | ```json 56 | { 57 | "xarray:open_kwargs": { 58 | "consolidated": true 59 | } 60 | } 61 | ``` 62 | 63 | #### xarray:storage_options 64 | 65 | [`fsspec.filesystem`](https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.filesystem) enables opening a filesystem from URI (e.g. `abfs://path/to/blob`, `https://path/to/file`, `s3://path/to/file`). The various filesystems support and require backend-specific keyword arguments, which can be provided as `**storage_options`. 66 | 67 | ## Python Example 68 | 69 | This example demonstrates how consumers of this extension can use the data to simplify the process of loading 70 | an asset from STAC into an xarray Dataset. 71 | 72 | ```python 73 | >>> import pystac, planetary_computer, xarray as xr 74 | 75 | >>> collection = planetary_computer.sign( 76 | ... pystac.read_file("https://planetarycomputer.microsoft.com/api/stac/v1/collections/terraclimate") 77 | ... ) 78 | >>> asset = collection.assets["zarr-abfs"] 79 | >>> asset.media_type 80 | 81 | >>> ds = xr.open_dataset( 82 | ... asset.href, 83 | ... **asset.extra_fields["xarray:open_kwargs"] 84 | ... ) 85 | >>> ds 86 | Size: 2TB 87 | Dimensions: (time: 768, lat: 4320, lon: 8640, crs: 1) 88 | Coordinates: 89 | * crs (crs) int16 2B 3 90 | * lat (lat) float64 35kB 89.98 89.94 89.9 89.85 ... -89.9 -89.94 -89.98 91 | * lon (lon) float64 69kB -180.0 -179.9 -179.9 ... 179.9 179.9 180.0 92 | * time (time) datetime64[ns] 6kB 1958-01-01 1958-02-01 ... 2021-12-01 93 | Data variables: (12/14) 94 | aet (time, lat, lon) float32 115GB dask.array 95 | def (time, lat, lon) float32 115GB dask.array 96 | pdsi (time, lat, lon) float32 115GB dask.array 97 | pet (time, lat, lon) float32 115GB dask.array 98 | ppt (time, lat, lon) float64 229GB dask.array 99 | q (time, lat, lon) float64 229GB dask.array 100 | ... ... 101 | swe (time, lat, lon) float64 229GB dask.array 102 | tmax (time, lat, lon) float32 115GB dask.array 103 | tmin (time, lat, lon) float32 115GB dask.array 104 | vap (time, lat, lon) float32 115GB dask.array 105 | vpd (time, lat, lon) float32 115GB dask.array 106 | ws (time, lat, lon) float32 115GB dask.array 107 | Attributes: (12/52) 108 | Conventions: CF-1.6 109 | acknowledgment: Please cite the references included here... 110 | cdm_data_type: GRID 111 | contributor_email: khegewisch@ucmerced.edu 112 | contributor_name: Katherine Hegewisch 113 | contributor_role: Postdoctoral Fellow 114 | ... ... 115 | time_coverage_duration: P1Y 116 | time_coverage_end: 1958-12-01T00:0 117 | time_coverage_resolution: P1M 118 | time_coverage_start: 1958-01-01T00:0 119 | title: TerraClimate: monthly climate and climat... 120 | version: v1.0 121 | ``` 122 | 123 | ## Contributing 124 | 125 | All contributions are subject to the 126 | [STAC Specification Code of Conduct](https://github.com/radiantearth/stac-spec/blob/master/CODE_OF_CONDUCT.md). 127 | For contributions, please follow the 128 | [STAC specification contributing guide](https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md) Instructions 129 | for running tests are copied here for convenience. 130 | 131 | ### Running tests 132 | 133 | 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. 134 | To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/). 135 | 136 | First you'll need to install everything with npm once. Just navigate to the root of this repository and on 137 | your command line run: 138 | ```bash 139 | npm install 140 | ``` 141 | 142 | Then to check markdown formatting and test the examples against the JSON schema, you can run: 143 | ```bash 144 | npm test 145 | ``` 146 | 147 | This will spit out the same texts that you see online, and you can then go and fix your markdown or examples. 148 | 149 | If the tests reveal formatting problems with the examples, you can fix them with: 150 | ```bash 151 | npm run format-examples 152 | ``` 153 | -------------------------------------------------------------------------------- /examples/collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "stac_version": "1.0.0-rc.1", 3 | "stac_extensions": [ 4 | "https://stac-extensions.github.io/xarray-assets/v1.0.0/schema.json" 5 | ], 6 | "type": "Collection", 7 | "id": "collection", 8 | "title": "A title", 9 | "description": "A description", 10 | "license": "Apache-2.0", 11 | "extent": { 12 | "spatial": { 13 | "bbox": [ 14 | [ 15 | 172.9, 16 | 1.3, 17 | 173, 18 | 1.4 19 | ] 20 | ] 21 | }, 22 | "temporal": { 23 | "interval": [ 24 | [ 25 | "2015-06-23T00:00:00Z", 26 | null 27 | ] 28 | ] 29 | } 30 | }, 31 | "assets": { 32 | "example": { 33 | "href": "abfs://cpdata/raw/terraclimate/4000m/raster.zarr", 34 | "type": "application/vnd+zarr", 35 | "xarray:storage_options": { 36 | "account_name": "cpdataeuwest" 37 | }, 38 | "xarray:open_kwargs": { 39 | "consolidated": true 40 | } 41 | } 42 | }, 43 | "summaries": { 44 | "datetime": { 45 | "minimum": "2015-06-23T00:00:00Z", 46 | "maximum": "2019-07-10T13:44:56Z" 47 | } 48 | }, 49 | "links": [ 50 | { 51 | "href": "https://example.com/examples/collection.json", 52 | "rel": "self" 53 | }, 54 | { 55 | "href": "https://example.com/examples/item.json", 56 | "rel": "item" 57 | } 58 | ] 59 | } -------------------------------------------------------------------------------- /examples/item.json: -------------------------------------------------------------------------------- 1 | { 2 | "stac_version": "1.0.0-rc.1", 3 | "stac_extensions": [ 4 | "https://stac-extensions.github.io/xarray-assets/v1.0.0/schema.json" 5 | ], 6 | "type": "Feature", 7 | "id": "item", 8 | "bbox": [ 9 | 172.9, 10 | 1.3, 11 | 173, 12 | 1.4 13 | ], 14 | "geometry": { 15 | "type": "Polygon", 16 | "coordinates": [ 17 | [ 18 | [ 19 | 172.9, 20 | 1.3 21 | ], 22 | [ 23 | 173, 24 | 1.3 25 | ], 26 | [ 27 | 173, 28 | 1.4 29 | ], 30 | [ 31 | 172.9, 32 | 1.4 33 | ], 34 | [ 35 | 172.9, 36 | 1.3 37 | ] 38 | ] 39 | ] 40 | }, 41 | "properties": { 42 | "datetime": "2020-12-11T22:38:32Z" 43 | }, 44 | "links": [ 45 | { 46 | "href": "https://example.com/examples/item.json", 47 | "rel": "self" 48 | } 49 | ], 50 | "assets": { 51 | "data": { 52 | "href": "abfs://example.com/examples/file.zarr", 53 | "xarray:storage_options": { 54 | "account_name": "test-account" 55 | }, 56 | "xarray:open_kwargs": { 57 | "consolidated": true 58 | } 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /json-schema/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$id": "https://stac-extensions.github.io/xarray-assets/v1.0.0/schema.json#", 4 | "title": "xarray Assets Extension", 5 | "description": "xarray Assets Extension for STAC Items and STAC Collections.", 6 | "oneOf": [ 7 | { 8 | "$comment": "This is the schema for STAC Items. Remove this object if this extension only applies to Collections.", 9 | "allOf": [ 10 | { 11 | "type": "object", 12 | "required": [ 13 | "type", 14 | "properties", 15 | "assets" 16 | ], 17 | "properties": { 18 | "type": { 19 | "const": "Feature" 20 | }, 21 | "properties": { 22 | "allOf": [ 23 | { 24 | "$comment": "Require fields here for item properties." 25 | }, 26 | { 27 | "$ref": "#/definitions/fields" 28 | } 29 | ] 30 | }, 31 | "assets": { 32 | "type": "object", 33 | "additionalProperties": { 34 | "$ref": "#/definitions/fields" 35 | } 36 | } 37 | } 38 | }, 39 | { 40 | "$ref": "#/definitions/stac_extensions" 41 | } 42 | ] 43 | }, 44 | { 45 | "$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.", 46 | "allOf": [ 47 | { 48 | "type": "object", 49 | "required": [ 50 | "type" 51 | ], 52 | "properties": { 53 | "type": { 54 | "const": "Collection" 55 | }, 56 | "assets": { 57 | "type": "object", 58 | "additionalProperties": { 59 | "$ref": "#/definitions/fields" 60 | } 61 | }, 62 | "item_assets": { 63 | "type": "object", 64 | "additionalProperties": { 65 | "$ref": "#/definitions/fields" 66 | } 67 | } 68 | } 69 | }, 70 | { 71 | "$ref": "#/definitions/stac_extensions" 72 | }, 73 | { 74 | "$comment": "Remove this object if this extension does not define top-level fields for Collections.", 75 | "$ref": "#/definitions/fields" 76 | } 77 | ] 78 | } 79 | ], 80 | "definitions": { 81 | "stac_extensions": { 82 | "type": "object", 83 | "required": [ 84 | "stac_extensions" 85 | ], 86 | "properties": { 87 | "stac_extensions": { 88 | "type": "array", 89 | "contains": { 90 | "const": "https://stac-extensions.github.io/xarray-assets/v1.0.0/schema.json" 91 | } 92 | } 93 | } 94 | }, 95 | "fields": { 96 | "type": "object", 97 | "properties": { 98 | "xarray:open_kwargs": { 99 | "type": "object" 100 | }, 101 | "xarray:storage_options": { 102 | "type": "object" 103 | } 104 | }, 105 | "patternProperties": { 106 | "^(?!xarray:)": { 107 | "$comment": "" 108 | } 109 | }, 110 | "additionalProperties": false 111 | } 112 | } 113 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stac-extensions", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "npm run check-markdown && npm run check-examples", 6 | "check-markdown": "remark . -f -r .github/remark.yaml", 7 | "check-examples": "stac-node-validator . --lint --verbose --schemaMap https://stac-extensions.github.io/xarray-assets/v1.0.0/schema.json=./json-schema/schema.json", 8 | "format-examples": "stac-node-validator . --format --schemaMap https://stac-extensions.github.io/xarray-assets/v1.0.0/schema.json=./json-schema/schema.json" 9 | }, 10 | "dependencies": { 11 | "remark-cli": "^8.0.0", 12 | "remark-lint": "^7.0.0", 13 | "remark-lint-no-html": "^2.0.0", 14 | "remark-preset-lint-consistent": "^3.0.0", 15 | "remark-preset-lint-markdown-style-guide": "^3.0.0", 16 | "remark-preset-lint-recommended": "^4.0.0", 17 | "remark-validate-links": "^10.0.0", 18 | "stac-node-validator": "^1.0.0" 19 | } 20 | } 21 | --------------------------------------------------------------------------------