Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/core/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ pub struct Asset {
#[serde(skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,

/// A list of extension identifiers the `Asset` implements.
#[serde(rename = "stac_extensions")]
#[serde(skip_serializing_if = "Vec::is_empty")]
#[serde(default)]
pub extensions: Vec<String>,

/// Additional fields on the asset.
#[serde(flatten)]
pub additional_fields: Map<String, Value>,
Expand Down Expand Up @@ -146,6 +152,7 @@ impl Asset {
nodata: None,
statistics: None,
unit: None,
extensions: Vec::new(),
additional_fields: Map::new(),
}
}
Expand Down
7 changes: 7 additions & 0 deletions crates/core/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ pub struct Link {
#[serde(skip_serializing_if = "Option::is_none")]
pub merge: Option<bool>,

/// A list of extension identifiers the `Link` implements.
#[serde(rename = "stac_extensions")]
#[serde(skip_serializing_if = "Vec::is_empty")]
#[serde(default)]
pub extensions: Vec<String>,

/// Additional fields on the link.
#[serde(flatten)]
pub additional_fields: Map<String, Value>,
Expand Down Expand Up @@ -301,6 +307,7 @@ impl Link {
headers: None,
body: None,
merge: None,
extensions: Vec::new(),
additional_fields: Map::new(),
}
}
Expand Down
29 changes: 29 additions & 0 deletions crates/extensions/data/file/catalog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"id": "examples",
"stac_extensions": [
"https://stac-extensions.github.io/file/v2.1.0/schema.json"
],
"type": "Catalog",
"title": "Example Catalog",
"stac_version": "1.0.0",
"description": "This catalog is a simple demonstration of an example catalog that is used to organize a hierarchy of collections and their items.",
"links": [
{
"rel": "root",
"href": "./catalog.json",
"type": "application/json"
},
{
"rel": "item",
"href": "./some-item.json",
"type": "application/json",
"title": "Some item",
"file:size": 8675309
},
{
"rel": "self",
"href": "https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/catalog.json",
"type": "application/json"
}
]
}
50 changes: 50 additions & 0 deletions crates/extensions/data/file/collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/file/v2.1.0/schema.json"
],
"id": "example",
"type": "Collection",
"title": "File Example",
"description": "This examples shows how to use the file extension for collection assets.",
"extent": {
"spatial": {
"bbox": [
[
-180,
-90,
180,
90
]
]
},
"temporal": {
"interval": [
[
"2012-01-15T12:00:00Z",
"2014-12-15T12:00:00Z"
]
]
}
},
"license": "Apache-2.0",
"links": [
{
"href": "https://example.com",
"type": "text/html",
"rel": "about"
}
],
"assets": {
"thumbnail": {
"href": "logo.png",
"title": "A preview image for visualization.",
"type": "image/png",
"roles": [
"thumbnail"
],
"file:checksum": "90e4021044a8995dd50b6657a037a7839304535b",
"file:size": 153600
}
}
}
102 changes: 102 additions & 0 deletions crates/extensions/data/file/item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"id": "S1A_EW_GRDM_1SSH_20181103T235855_20181103T235955_024430_02AD5D_5616",
"type": "Feature",
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/file/v2.1.0/schema.json"
],
"bbox": [
-70.275032,
-64.72924,
-65.087479,
-51.105831
],
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-67.071648,
-64.72924
],
[
-65.087479,
-56.674374
],
[
-68.033211,
-51.105831
],
[
-70.275032,
-59.805672
],
[
-67.071648,
-64.72924
]
]
]
},
"properties": {
"datetime": "2018-11-03T23:58:55Z"
},
"assets": {
"noises": {
"href": "./annotation/calibration/noise-s1a-ew-grd-hh-20181103t235855-20181103t235955-024430-02ad5d-001.xml",
"title": "Noise Schema",
"type": "text/xml",
"file:checksum": "90e40210a30d1711e81a4b11ef67b28744321659",
"file:local_path": "S1A_EW_GRDM_1SSH_20181103T235855_20181103T235955_024430_02AD5D_5616.SAFE/annotation/calibration/noise-s1a-ew-grd-hh-20181103t235855-20181103t235955-024430-02ad5d-001.xml"
},
"calibrations": {
"href": "./annotation/calibration/calibration-s1a-ew-grd-hh-20181103t235855-20181103t235955-024430-02ad5d-001.xml",
"title": "Calibration Schema",
"type": "text/xml",
"file:checksum": "90e402104fc5351af67db0b8f1746efe421a05e4",
"file:local_path": "S1A_EW_GRDM_1SSH_20181103T235855_20181103T235955_024430_02AD5D_5616.SAFE/annotation/calibration/calibration-s1a-ew-grd-hh-20181103t235855-20181103t235955-024430-02ad5d-001.xml"
},
"products": {
"href": "./annotation/s1a-ew-grd-hh-20181103t235855-20181103t235955-024430-02ad5d-001.xml",
"title": "Product Schema",
"type": "text/xml",
"file:checksum": "90e402107a7f2588a85362b9beea2a12d4514d45"
},
"measurement": {
"href": "./measurement/s1a-ew-grd-hh-20181103t235855-20181103t235955-024430-02ad5d-001.tiff",
"title": "Measurements",
"type": "image/tiff",
"sar:polarizations": [
"HH"
],
"file:byte_order": "little-endian",
"file:size": 209715200,
"file:header_size": 4096,
"file:checksum": "90e40210163700a8a6501eccd00b6d3b44ddaed0"
},
"thumbnail": {
"href": "./preview/quick-look.png",
"title": "Thumbnail",
"type": "image/png",
"file:byte_order": "big-endian",
"file:size": 146484,
"file:checksum": "90e40210f52acd32b09769d3b1871b420789456c"
}
},
"links": [
{
"rel": "self",
"href": "https://example.com/collections/sentinel-1/items/S1A_EW_GRDM_1SSH_20181103T235855_20181103T235955_024430_02AD5D_5616"
},
{
"rel": "parent",
"href": "https://example.com/collections/sentinel-1",
"file:checksum": "11146d97123fd2c02dec9a1b6d3b13136dbe600cf966"
},
{
"rel": "root",
"href": "https://example.com/collections",
"file:checksum": "1114fa4b9d69fdddc7c1be7bed9440621400b383b43f"
}
]
}
Loading
Loading