Skip to content

Commit

Permalink
Validate label assets #4 and fix label:assets in examples #3
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Mar 30, 2021
1 parent 4b2cb1b commit 6df4842
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fixed invalid examples
- JSON Schema checks `label:assets` in links

## [v1.0.0] - 2021-03-8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
"rel": "source",
"href": "https://spacenet-dataset.s3.amazonaws.com/spacenet/SN2_buildings/train/AOI_2_Vegas/PS-RGB/SN2_buildings_train_AOI_2_Vegas_PS-RGB_img2636.tif",
"title": "The source imagery these building labels were derived from",
"label:assets": "OBJECTID_1"
"label:assets": [
"OBJECTID_1"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
"rel": "source",
"href": "https://spacenet-dataset.s3.amazonaws.com/spacenet/SN2_buildings/train/AOI_3_Paris/PS-RGB/SN2_buildings_train_AOI_3_Paris_PS-RGB_img1648.tif",
"title": "The source imagery these building labels were derived from",
"label:assets": "OBJECTID_1"
"label:assets": [
"OBJECTID_1"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
"rel": "source",
"href": "https://spacenet-dataset.s3.amazonaws.com/spacenet/SN2_buildings/train/AOI_4_Shanghai/PS-RGB/SN2_buildings_train_AOI_4_Shanghai_PS-RGB_img3344.tif",
"title": "The source imagery these building labels were derived from",
"label:assets": "OBJECTID_1"
"label:assets": [
"OBJECTID_1"
]
}
]
}
4 changes: 3 additions & 1 deletion examples/multidataset/zanzibar/znz001.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@
"rel": "source",
"href": "https://oin-hotosm.s3.amazonaws.com/5afeda152b6a08001185f11a/0/5afeda152b6a08001185f11b.tif",
"title": "The source imagery these building labels were derived from",
"label:assets": "building"
"label:assets": [
"building"
]
}
]
}
4 changes: 3 additions & 1 deletion examples/multidataset/zanzibar/znz029.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@
"rel": "source",
"href": "https://oin-hotosm.s3.amazonaws.com/5ae242fd0b093000130afd38/0/5ae242fd0b093000130afd39.tif",
"title": "The source imagery these building labels were derived from",
"label:assets": "building"
"label:assets": [
"building"
]
}
]
}
4 changes: 3 additions & 1 deletion examples/spacenet-roads/roads_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"href": "roads_source.json",
"rel": "source",
"title": "The source imagery these road labels were derived from",
"label:assets": "road_labels"
"label:assets": [
"road_labels"
]
}
],
"assets": {
Expand Down
30 changes: 23 additions & 7 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"required": [
"type",
"properties",
"links",
"assets"
],
"properties": {
Expand All @@ -33,6 +34,12 @@
}
]
},
"links": {
"type": "array",
"items": {
"$ref": "#/definitions/link_fields"
}
},
"assets": {
"type": "object",
"additionalProperties": {
Expand Down Expand Up @@ -73,11 +80,7 @@
}
},
{
"$comment": "Remove this and the following object if this is not an extension to a Collection.",
"$ref": "#/definitions/stac_extensions"
},
{
"$ref": "#/definitions/fields"
}
]
}
Expand All @@ -97,6 +100,21 @@
}
}
},
"link_fields": {
"type": "object",
"properties": {
"label:assets": {
"type": "array",
"items": {
"type": "string"
}
}
},
"patternProperties": {
"^(?!label:)": {}
},
"additionalProperties": false
},
"fields": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -223,9 +241,7 @@
}
},
"patternProperties": {
"^(?!label:)": {
"$comment": "Above, change `template` to the prefix of this extension"
}
"^(?!label:)": {}
},
"additionalProperties": false
}
Expand Down

0 comments on commit 6df4842

Please sign in to comment.