Skip to content

Commit

Permalink
Merge branch 'dev' into json-schema-summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
cholmes authored Apr 26, 2021
2 parents b74d5b8 + ee2ca2e commit 7d3a94a
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 71 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added

- Summaries are allowed to specify JSON Schema in addition to ranges and sets of values. ([#1045](https://github.com/radiantearth/stac-spec/issues/1045))
- Added `preview` relation type for interoperable thumbnails to best practices. ([#1090](https://github.com/radiantearth/stac-spec/issues/1090))

### Changed

- The first extent in a Collection is always the overall extent, followed by more specific extents. ([#1064](https://github.com/radiantearth/stac-spec/issues/1064), [opengeospatial/ogcapi-features#520](https://github.com/opengeospatial/ogcapi-features/pull/520))
- Updated examples for automatic collection creation from code and validation ([#1080](https://github.com/radiantearth/stac-spec/pull/1080)
- Clarified that stac_extensions should also list extensions that are used in Collection summaries. ([#1077](https://github.com/radiantearth/stac-spec/issues/1077))
- The Stats Object for Summaries has been renamed to Range Object (no functional change).
- `changed`, `created` (common metadata) and temporal extents (collections): Timestamps must be always in UTC ([#1095](https://github.com/radiantearth/stac-spec/issues/1095))

## [v1.0.0-rc.2] - 2021-03-30

Expand Down
40 changes: 23 additions & 17 deletions best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- [Keep catalogs in sync with cloud notification and queue services](#keep-catalogs-in-sync-with-cloud-notification-and-queue-services)
- [How to Differentiate STAC Files](#how-to-differentiate-stac-files)


This document makes a number of recommendations for creating real world SpatioTemporal Asset Catalogs. None of them
are required to meet the core specification, but following these practices will make life easier for client tooling
and for users. They come about from practical experience of implementors and introduce a bit more 'constraint' for
Expand All @@ -71,8 +72,8 @@ So to enable all the great web tools (like [stacindex.org](http://stacindex.org)
[Google Cloud Storage](https://cloud.google.com/storage/docs/cross-origin), or [Apache Server](https://enable-cors.org/server_apache.html).
Many more are listed on [enable-cors.org](https://enable-cors.org/server.html). We recommend enabling CORS for all requests ('\*'),
so that diverse online tools can access your data. If you aren't sure if your server has CORS enabled you can use
[test-cors.org](https://www.test-cors.org/). Enter the URL of your STAC root [Catalog](catalog-spec/catalog-spec.md) JSON
and make sure it gets a response.
[test-cors.org](https://www.test-cors.org/). Enter the URL of your STAC root [Catalog](catalog-spec/catalog-spec.md) or
[Collection](collection-spec/collection-spec.md) JSON and make sure it gets a response.

### STAC on the Web

Expand All @@ -81,7 +82,7 @@ surprised that there is nothing about HTML in the entire specification. This is
should be on web pages without ending up with very bad looking pages. But the importance of having web-accessible versions
of every STAC Item is paramount.

The main recommendation is to have an HTML page for every single STAC Item and Catalog. They should be visually pleasing,
The main recommendation is to have an HTML page for every single STAC Item, Catalog and Collection. They should be visually pleasing,
crawlable by search engines and ideally interactive. The current best practice is to use a tool in the STAC ecosystem called
[STAC Browser](https://github.com/radiantearth/stac-browser/). It can crawl most any valid STAC implementation and generate unique web
pages for each Item and Catalog (or Collection). While it has a default look and feel, the design can easily be
Expand Down Expand Up @@ -293,7 +294,7 @@ following table lists some of the most common ones you may encounter or use.
| `image/png` | Visual PNGs (e.g. thumbnails) |
| `image/jpeg` | Visual JPEGs (e.g. thumbnails, oblique) |
| `text/xml` or `application/xml` | XML metadata [RFC 7303](https://www.ietf.org/rfc/rfc7303.txt) |
| `application/json` | A JSON file (often metadata, or [labels](https://github.com/radiantearth/stac-spec/tree/master/extensions/label#labels-required)) |
| `application/json` | A JSON file (often metadata, or [labels](https://github.com/radiantearth/stac-spec/tree/master/extensions/label#labels-required)) |
| `text/plain` | Plain text (often metadata) |
| `application/geo+json` | [GeoJSON](https://geojson.org/) |
| `application/geopackage+sqlite3` | [GeoPackage](https://www.geopackage.org/) |
Expand Down Expand Up @@ -393,6 +394,10 @@ file that just has the bands needed for display

## Catalog & Collection Practices

*Note: This section uses the term 'Catalog' (with an uppercase C) to refer to the JSON entity specified in the
[Catalog spec](catalog-spec/catalog-spec.md), and 'catalog' (with a lowercase c) to refer to any full STAC implementation,
which can be any mix of Catalogs Collections and Items.*

### Static and Dynamic Catalogs

As mentioned in the main [overview](overview.md), there are two main types of catalogs - static
Expand Down Expand Up @@ -446,7 +451,7 @@ providers, and users could browse down to both. The leaf Items should just be li

### Catalog Layout

Creating a catalog involves a number of decisions as to what folder structure to use to represent sub-catalogs, items
Creating a catalog involves a number of decisions as to what folder structure to use to represent sub-catalogs, Items
and assets, and how to name them. The specification leaves this totally open, and you can link things as you want. But
it is recommended to be thoughtful about the organization of sub-catalogs, putting them into a structure that a person
might reasonably browse (since they likely will with [STAC on the Web](#stac-on-the-web) recommendations). For example
Expand All @@ -463,14 +468,14 @@ if you follow these recommendations.
1. Root documents (Catalogs / Collections) should be at the root of a directory tree containing the static catalog.
2. Catalogs should be named `catalog.json` and Collections should be named `collection.json`.
3. Items should be named `<id>.json`.
4. Sub-Catalogs should be stored in subdirectories of their parent
4. Sub-Catalogs or sub-Collections should be stored in subdirectories of their parent
(and only 1 subdirectory deeper than a document's parent, e.g. `.../sample/sub1/catalog.json`).
5. Items should be stored in subdirectories of their parent Catalog.
This means that each Item and its assets are contained in a unique subdirectory.
6. Limit the number of Items in a Catalog or sub-Catalog, grouping / partitioning as relevant to the dataset.
5. Items should be stored in subdirectories of their parent Catalog or Collection.
This means that each Item and its assets are contained in a unique subdirectory.
6. Limit the number of Items in a Catalog or Collection, grouping / partitioning as relevant to the dataset.
7. Use structural elements (Catalog and Collection) consistently across each 'level' of your hierarchy.
For example, if levels 2 and 4 of the hierarchy only contain Collections,
don't add a Catalog at levels 2 and 4.
don't add a Catalog at levels 2 and 4.

#### Dynamic Catalog Layout

Expand All @@ -483,7 +488,7 @@ different sub-catalog organization structures. For example one catalog could div
by providers, and users could browse down to both. The leaf Items should just be linked to in a single canonical location
(or at least use a rel link that indicates the location of the canonical one). It is recommended that dynamic catalogs
provide multiple 'views' to allow users to navigate in a way that makes sense to them, providing multiple 'sub-catalogs'
from the root Catalog that enable different paths to browse (country/state, date/time, constellation/satellite, etc). But the
from the root that enable different paths to browse (country/state, date/time, constellation/satellite, etc). But the
canonical 'rel' link should be used to designate the primary location of the Item to search engine crawlers.

#### Mixing STAC Versions
Expand Down Expand Up @@ -608,9 +613,9 @@ implement it.
#### Relative Published Catalog

This is a self-contained catalog as described above, except it includes an absolute `self` link at
the root catalog, to identify its online location. This is designed so that a self-contained catalog (of either type, with its
the root to identify its online location. This is designed so that a self-contained catalog (of either type, with its
assets or just metadata) can be 'published' online
by just adding one field (the self link) to its root catalog. All the other links should remain the same. The resulting catalog
by just adding one field (the self link) to its root (Catalog or Collection). All the other links should remain the same. The resulting catalog
is no longer compliant with the self-contained catalog recommendations, but instead transforms into a 'relative published catalog'.
With this, a client may resolve Item and sub-catalog self links by traversing parent and root links, but requires reading
multiple sources to achieve this.
Expand All @@ -627,13 +632,14 @@ with the `type` field) to communicate the structure and content of related entit
Types](https://www.iana.org/assignments/link-relations/link-relations.xhtml) as much as possible. The following table describes
a number of the common official relations that are used in production STAC implementations.

| Type | Description |
| ------------ | ------------------------------------------------------------ |
| Type | Description |
| --------- | ------------------------------------------------------------ |
| alternate | It is recommended that STAC Items are also available as HTML, and should use this rel with `"type" : "text/html"` to tell clients where they can get a version of the Item or Collection to view in a browser. See [STAC on the Web in Best Practices](#stac-on-the-web) for more information. |
| canonical | The URL of the [canonical](https://en.wikipedia.org/wiki/Canonical_link_element) version of the Item or Collection. API responses and copies of catalogs should use this to inform users that they are direct copy of another STAC Item, using the canonical rel to refer back to the primary location. |
| via | The URL of the source metadata that this STAC Item or Collection is created from. Used similarly to canonical, but refers back to a non-STAC record (Landsat MTL, Sentinel tileInfo.json, etc) |
| prev | Indicates that the link's context is a part of a series, and that the previous in the series is the link target. Typically used in STAC by API's, to return smaller groups of Items or Catalogs. |
| next | Indicates that the link's context is a part of a series, and that the next in the series is the link target. Typically used in STAC by API's, to return smaller groups of Items or Catalogs. |
| prev | Indicates that the link's context is a part of a series, and that the previous in the series is the link target. Typically used in STAC by API's, to return smaller groups of Items or Catalogs/Collections. |
| next | Indicates that the link's context is a part of a series, and that the next in the series is the link target. Typically used in STAC by API's, to return smaller groups of Items or Catalogs/Collections. |
| preview | Refers to a resource that serves as a preview (see [RFC 6903, sec. 3](https://tools.ietf.org/html/rfc6903#section-3)), usually a lower resolution thumbnail. In STAC this would usually be the same URL as the [thumbnail](#thumbnail) asset, but adding it as a link in addition enables OGC API clients that can't read assets to make use of it. It also adds support for thumbnails to STAC Catalogs as they can't list assets. |

### Versioning for Catalogs

Expand Down
11 changes: 6 additions & 5 deletions catalog-spec/catalog-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ and fields to be compliant.
This Catalog specification primarily defines a structure for information to be discoverable. Any use
that is publishing a set of related spatiotemporal assets is strongly recommended to also use the
STAC Collection specification to provide additional information about the set of Items
contained in a Catalog, in order to give contextual information to aid in discovery. Every STAC Collection is
also a valid STAC Catalog.
contained in a Catalog, in order to give contextual information to aid in discovery.
STAC Collections all have the same fields as STAC Catalogs, but with different allowed
values for `type` and `stac_extensions`.

## Catalog fields

Expand Down Expand Up @@ -89,11 +90,11 @@ The following types are commonly used as `rel` types in the Link Object of a STA
| ------- | ----------- |
| self | STRONGLY RECOMMENDED. *Absolute* URL to the location that the Catalog file can be found online, if available. This is particularly useful when in a download package that includes metadata, so that the downstream user can know where the data has come from. |
| root | STRONGLY RECOMMENDED. URL to the root STAC Catalog or [Collection](../collection-spec/README.md). Catalogs should include a link to their root, even if it's the root and points to itself. |
| parent | URL to the parent STAC Catalog or Collection. Non-root Catalogs should include a link to their parent. |
| child | URL to a child STAC Catalog or Collection. |
| parent | URL to the parent STAC entity (Catalog or Collection). Non-root Catalogs should include a link to their parent. |
| child | URL to a child STAC entity (Catalog or Collection). |
| item | URL to a STAC Item. |

**Note:** A link to at least one `item` or `child` Catalog is **REQUIRED**.
**Note:** A link to at least one `item` or `child` (Catalog or Collection) is **REQUIRED**.

There are additional `rel` types in the [Using Relation Types](../best-practices.md#using-relation-types) best practice, but as
they are more typically used in Collections, as Catalogs tend to just be used to structure STAC organization, so tend to just use
Expand Down
8 changes: 4 additions & 4 deletions collection-spec/collection-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Clients only interested in the overall extent will only need to access the first
It is recommended to only use multiple temporal extents if a union of them would then include a large
uncovered time span (e.g. only having data for the years 2000, 2010 and 2020).

Each inner array consists of exactly two dates and times.
Each inner array consists of exactly two dates and times, each in UTC.
Each date and time MUST be formatted according to [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6).
The temporal reference system is the Gregorian calendar.

Expand Down Expand Up @@ -253,9 +253,9 @@ This is done where there is not a clear official option, or where STAC uses an o
| Type | Description |
| ------- | ------------------------------------------------------------ |
| self | STRONGLY RECOMMENDED. *Absolute* URL to the location that the Collection file can be found online, if available. This is particularly useful when in a download package that includes metadata, so that the downstream user can know where the data has come from. |
| root | URL to the root STAC Catalog or Collection. Collections should include a link to their root, even if it's the root and points to itself. |
| parent | URL to the parent STAC Catalog or Collection. Non-root Collections should include a link to their parent. |
| child | URL to a child STAC Catalog or Collection. |
| root | URL to the root STAC entity (Catalog or Collection). Collections should include a link to their root, even if it's the root and points to itself. |
| parent | URL to the parent STAC entity (Catalog or Collection). Non-root Collections should include a link to their parent. |
| child | URL to a child STAC entity (Catalog or Collection). |
| item | URL to a STAC Item. All Items linked from a Collection MUST refer back to its Collection with the [`collection` relation type](../item-spec/item-spec.md#relation-types). |
| license | The license URL(s) for the Collection SHOULD be specified if the `license` field is set to `proprietary` or `various`. If there is no public license URL available, it is RECOMMENDED to put the license text in a separate file and link to this file. |
| derived_from | URL to a STAC Collection that was used as input data in the creation of this Collection. See the note in [STAC Item](../item-spec/item-spec.md#derived_from) for more info. |
Expand Down
3 changes: 2 additions & 1 deletion collection-spec/json-schema/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
"string",
"null"
],
"format": "date-time"
"format": "date-time",
"pattern": "(\\+00:00|Z)$"
}
}
}
Expand Down
Loading

0 comments on commit 7d3a94a

Please sign in to comment.