Skip to content

Commit 34315f0

Browse files
Merge pull request #342 from jbants/validator_readme
Updated validation readme with python validator
2 parents d1cdd72 + e45a889 commit 34315f0

File tree

2 files changed

+47
-4
lines changed

2 files changed

+47
-4
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
python ~/stac-validator/stac_validator.py item-spec/examples/planet-sample.json
3636
python ~/stac-validator/stac_validator.py item-spec/examples/landsat8-sample.json
3737
python ~/stac-validator/stac_validator.py item-spec/examples/digitalglobe-sample.json
38-
python ~/stac-validator/stac_validator.py item-spec/examples/CBERS_4_MUX_20170528_090_084_L2.json
38+
python ~/stac-validator/stac_validator.py item-spec/examples/CBERS_4_MUX_20181029_177_106_L4.json

validation/README.md

+46-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,53 @@
11
# STAC Schema Validation
22

3+
34
Any JSON Schema validation tool can be used, just run the JSON data to test against the various STAC schema, and be sure to include any remote schema like the geojson.json schema in the testing.
45

5-
This directory includes installation instructions for a JavaScript validator, the following shows how to use it.
6+
This directory includes installation instructions for a Python validator and a JavaScript validator. The python validator is more complete and the recommnded tool for validation. The Javascript validator has been deprecated and will be removed in the next release.
7+
8+
## Python Validator
9+
Install the validator from the [stac-validator](https://github.com/sparkgeo/stac-validator) repository and follow the instructions.
10+
11+
The validator can be run as a command line tool and will report on nested catalogs as well as single items. There is no need to specifically identify
12+
13+
```
14+
stac_validator.py --help
15+
16+
Description: Validate a STAC item or catalog against the STAC specification.
17+
18+
Usage:
19+
stac_validator.py <stac_file> [-version] [--verbose] [--timer]
20+
21+
Arguments:
22+
stac_file Fully qualified path or url to a STAC file.
23+
24+
Options:
25+
-v, --version STAC_VERSION Version to validate against. [default: master]
26+
-h, --help Show this screen.
27+
--verbose Verbose output. [default: False]
28+
--timer Reports time to validate the STAC (seconds)
29+
30+
31+
stac_validator.py https://earth-stac.s3.amazonaws.com/eo/landsat-8-l1/catalog.json -v latest
32+
33+
{
34+
"catalogs": {
35+
"valid": 1,
36+
"invalid": 0
37+
},
38+
"collections": {
39+
"valid": 0,
40+
"invalid": 0
41+
},
42+
"items": {
43+
"valid": 0,
44+
"invalid": 0
45+
}
46+
}
47+
```
648

7-
## Initialization
49+
## JavaScript Validator
50+
### Initialization
851

952
In this directory run:
1053

@@ -14,7 +57,7 @@ npm install
1457

1558
This installs node.js validation modules, in a node_modules directory created in this directory.
1659

17-
## Validation
60+
### Validation
1861

1962
In the following chapter there are commands to run a validation of any STAC against the JSON Schema.
2063

0 commit comments

Comments
 (0)