Skip to content

Commit 3be2ec0

Browse files
committed
update documentation
1 parent f90c797 commit 3be2ec0

3 files changed

Lines changed: 63 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
1010

1111
### Added
1212

13-
- Support for FastJSONSchema validation method ([#149](https://github.com/stac-utils/stac-check/pull/149))
13+
- Support for FastJSONSchema validation method with --fast flag to validate items, item collections ([#149](https://github.com/stac-utils/stac-check/pull/149))
1414

1515
### Updated
1616

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The intent of this project is to provide a validation tool that also follows the
3535
- [Link and Asset Validation](#link-and-asset-validation)
3636
- [Invalid STAC](#invalid-stac)
3737
- [Using HTTP Headers](#using-http-headers)
38+
- [Fast Validation](#fast-validation)
3839
- [STAC API Validation](#stac-api-validation)
3940
- [Development](#development)
4041
- [Building Documentation](#building-documentation)
@@ -94,6 +95,8 @@ Options:
9495
--pydantic Use stac-pydantic for enhanced validation with Pydantic models.
9596
--verbose Show verbose error messages.
9697
-o, --output FILE Save output to the specified file.
98+
--fast Use FastJSONSchema for high-speed validation. Skips best
99+
practices and geometry checks for maximum performance.
97100
--item-collection Validate item collection response. Can be combined with
98101
--pages. Defaults to one page.
99102
--collections Validate collections endpoint response. Can be combined with
@@ -421,6 +424,64 @@ No ASSET format errors!
421424
This object has 4 links
422425
</pre>
423426

427+
### Fast Validation
428+
429+
For large STAC collections or when you need maximum validation speed, use the `--fast` flag to enable FastJSONSchema validation. This mode skips best practices and geometry checks, focusing only on STAC spec compliance.
430+
431+
**Fast Validation of a Large Item Collection:**
432+
433+
```bash
434+
stac-check large_collection.json --fast
435+
```
436+
437+
<pre><b>stac-check: STAC spec validation and linting tool</b>
438+
439+
Validator: stac-valid 4.2.1
440+
441+
Validation method: FastJSONSchema
442+
443+
Validation Summary
444+
445+
✅ Passed: 998/1000
446+
❌ Failed: 2/1000
447+
448+
⚡ Timing Information:
449+
Total Validation Time: 245.67 ms
450+
Average per Object: 0.246 ms
451+
452+
Schemas checked:
453+
https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json
454+
https://stac-extensions.github.io/eo/v1.0.0/schema.json
455+
https://stac-extensions.github.io/projection/v1.0.0/schema.json
456+
457+
Validation Errors
458+
459+
❌ STAC Spec Violation: Missing {'rel': 'collection'} in links array.
460+
Affected Items: 2 | Examples: item_1, item_2
461+
</pre>
462+
463+
**Fast Validation with Verbose Output:**
464+
465+
You can combine `--fast` with `--verbose` to see detailed validation output for each item:
466+
467+
```bash
468+
stac-check large_collection.json --fast --verbose
469+
```
470+
471+
This will show detailed validation information for each item while still maintaining the speed benefits of FastJSONSchema.
472+
473+
**Performance Comparison:**
474+
475+
- **`--fast` mode**: ~0.25ms per item (skips best practices and geometry)
476+
- **Regular mode**: ~1-2ms per item (includes all checks)
477+
- **Speedup**: 4-8x faster for large collections
478+
479+
Use `--fast` when:
480+
- Validating large collections (100+ items)
481+
- You only need STAC spec compliance
482+
- You want to skip best practices checks
483+
- Performance is critical
484+
424485
### STAC API Validation
425486

426487
stac-check can validate STAC API endpoints, including item collections and collections endpoints. It supports pagination and can validate multiple pages of results.

stac_check/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def is_item_collection(file: str, headers: dict = None) -> bool:
115115
@click.option(
116116
"--fast",
117117
is_flag=True,
118-
help="Fast validation mode. Skips best practices checks and geometry validation, only validates core STAC schema.",
118+
help="Use FastJSONSchema for high-speed validation. Skips best practices and geometry checks for maximum performance.",
119119
)
120120
@click.command()
121121
@click.argument("file")

0 commit comments

Comments
 (0)