Skip to content

Commit

Permalink
Merge pull request #342 from jbants/validator_readme
Browse files Browse the repository at this point in the history
Updated validation readme with python validator
  • Loading branch information
matthewhanson committed Nov 7, 2018
2 parents d1cdd72 + e45a889 commit 34315f0
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
python ~/stac-validator/stac_validator.py item-spec/examples/planet-sample.json
python ~/stac-validator/stac_validator.py item-spec/examples/landsat8-sample.json
python ~/stac-validator/stac_validator.py item-spec/examples/digitalglobe-sample.json
python ~/stac-validator/stac_validator.py item-spec/examples/CBERS_4_MUX_20170528_090_084_L2.json
python ~/stac-validator/stac_validator.py item-spec/examples/CBERS_4_MUX_20181029_177_106_L4.json
49 changes: 46 additions & 3 deletions validation/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,53 @@
# STAC Schema Validation


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.

This directory includes installation instructions for a JavaScript validator, the following shows how to use it.
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.

## Python Validator
Install the validator from the [stac-validator](https://github.com/sparkgeo/stac-validator) repository and follow the instructions.

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

```
stac_validator.py --help
Description: Validate a STAC item or catalog against the STAC specification.
Usage:
stac_validator.py <stac_file> [-version] [--verbose] [--timer]
Arguments:
stac_file Fully qualified path or url to a STAC file.
Options:
-v, --version STAC_VERSION Version to validate against. [default: master]
-h, --help Show this screen.
--verbose Verbose output. [default: False]
--timer Reports time to validate the STAC (seconds)
stac_validator.py https://earth-stac.s3.amazonaws.com/eo/landsat-8-l1/catalog.json -v latest
{
"catalogs": {
"valid": 1,
"invalid": 0
},
"collections": {
"valid": 0,
"invalid": 0
},
"items": {
"valid": 0,
"invalid": 0
}
}
```

## Initialization
## JavaScript Validator
### Initialization

In this directory run:

Expand All @@ -14,7 +57,7 @@ npm install

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

## Validation
### Validation

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

Expand Down

0 comments on commit 34315f0

Please sign in to comment.