Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated validation readme with python validator #342

Merged
merged 4 commits into from
Nov 7, 2018
Merged
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
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