Skip to content

Commit

Permalink
added best practice to include title, updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cholmes committed May 24, 2021
1 parent 7363844 commit 24ec4a2
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 26 deletions.
5 changes: 5 additions & 0 deletions best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ if you follow these recommendations.
For example, if levels 2 and 4 of the hierarchy only contain Collections,
don't add a Catalog at levels 2 and 4.

One further recommendation to help tools is to always include the 'title' field when including a link, especially in the
`item`, `child`, `parent` and `root` links, even if it repeats several times. This should be the same as the 'title' in the
link destination. Having this enables clients to display a nice human readable name of the link without having to open the
link destination.

#### Dynamic Catalog Layout

While these recommendations were primarily written for [static catalogs](#static-catalogs), they apply
Expand Down
1 change: 1 addition & 0 deletions examples/catalog.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"id": "examples",
"type": "Catalog",
"title": "Example Catalog",
"stac_version": "1.0.0-rc.4",
"description": "This catalog is a simple demonstration of an example catalog that is used to organize a hierarchy of collections and their items.",
"links": [
Expand Down
8 changes: 6 additions & 2 deletions examples/collection-only/collection-with-schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@
"links": [
{
"rel": "parent",
"href": "../catalog.json"
"href": "../catalog.json",
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "root",
"href": "../catalog.json"
"href": "../catalog.json",
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "license",
Expand Down
8 changes: 6 additions & 2 deletions examples/collection-only/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,15 @@
"links": [
{
"rel": "parent",
"href": "../catalog.json"
"href": "../catalog.json",
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "root",
"href": "../catalog.json"
"href": "../catalog.json",
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "license",
Expand Down
3 changes: 2 additions & 1 deletion examples/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
{
"rel": "root",
"href": "./collection.json",
"type": "application/json"
"type": "application/json",
"title": "Simple Example Collection"
},
{
"rel": "item",
Expand Down
12 changes: 8 additions & 4 deletions examples/collectionless-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,26 @@
{
"rel": "root",
"href": "./catalog.json",
"type": "application/json"
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "parent",
"href": "./catalog.json",
"type": "application/json"
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "alternate",
"type": "text/html",
"href": "http://cool-sat.com/catalog/CS3-20160503_132130_04/CS3-20160503_132130_04.html"
"href": "http://cool-sat.com/catalog/CS3-20160503_132130_04/CS3-20160503_132130_04.html",
"title": "HTML representation of this STAC Item"
},
{
"rel": "license",
"type": "text/html",
"href": "http://remotedata.io/license.html"
"href": "http://remotedata.io/license.html",
"title": "Data License for Remote Data, Inc."
}
],
"assets": {
Expand Down
9 changes: 6 additions & 3 deletions examples/core-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,20 @@
{
"rel": "root",
"href": "./collection.json",
"type": "application/json"
"type": "application/json",
"title": "Simple Example Collection"
},
{
"rel": "parent",
"href": "./collection.json",
"type": "application/json"
"type": "application/json",
"title": "Simple Example Collection"
},
{
"rel": "alternate",
"type": "text/html",
"href": "http://remotedata.io/catalog/20201211_223832_CS2/index.html"
"href": "http://remotedata.io/catalog/20201211_223832_CS2/index.html",
"title": "HTML version of this STAC Item"
}
],
"assets": {
Expand Down
9 changes: 6 additions & 3 deletions examples/extended-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,20 @@
{
"rel": "root",
"href": "./collection.json",
"type": "application/json"
"type": "application/json",
"title": "Simple Example Collection"
},
{
"rel": "parent",
"href": "./collection.json",
"type": "application/json"
"type": "application/json",
"title": "Simple Example Collection"
},
{
"rel": "alternate",
"type": "text/html",
"href": "http://remotedata.io/catalog/20201211_223832_CS2/index.html"
"href": "http://remotedata.io/catalog/20201211_223832_CS2/index.html",
"title": "HTML version of this STAC Item"
}
],
"assets": {
Expand Down
14 changes: 8 additions & 6 deletions examples/extensions-collection/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
"stac_version": "1.0.0-rc.4",
"description": "A heterogenous collection containing deeper examples of various extensions",
"links": [
{
"rel": "parent",
"href": "../catalog.json",
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "root",
"href": "../catalog.json",
"type": "application/json"
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "item",
Expand All @@ -18,11 +25,6 @@
"rel": "license",
"href": "https://remotedata.io/license.html",
"title": "Remote Data License Terms"
},
{
"rel": "parent",
"href": "../catalog.json",
"type": "application/json"
}
],
"stac_extensions": [],
Expand Down
9 changes: 6 additions & 3 deletions examples/extensions-collection/proj-example/proj-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,20 @@
{
"rel": "root",
"href": "../../catalog.json",
"type": "application/json"
"type": "application/json",
"title": "Example Catalog"
},
{
"rel": "parent",
"href": "../collection.json",
"type": "application/json"
"type": "application/json",
"title": "Collection of Extension Items"
},
{
"rel": "collection",
"href": "../collection.json",
"type": "application/json"
"type": "application/json",
"title": "Collection of Extension Items"
}
],
"assets": {
Expand Down
6 changes: 4 additions & 2 deletions examples/simple-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@
{
"rel": "root",
"href": "./collection.json",
"type": "application/json"
"type": "application/json",
"title": "Simple Example Collection"
},
{
"rel": "parent",
"href": "./collection.json",
"type": "application/json"
"type": "application/json",
"title": "Simple Example Collection"
}
],
"assets": {
Expand Down

0 comments on commit 24ec4a2

Please sign in to comment.