ST_ValidateOSGB checks the integrity of an OSGB oblique photography dataset stored in Object Storage Service (OSS), reporting any missing or error files. Run this function before importing data with ST_ImportOSGB to confirm data integrity, or after a failed import to identify the problem files.
Syntax
record ST_ValidateOSGB(cstring url, cstring options default '{}', out valid boolean, out reason text);Parameters
| Parameter | Description |
|---|---|
url | The OSS path to the oblique photography project directory. |
options | Validation options as a JSON string. Defaults to '{}'. See Options. |
Return values
| Field | Type | Description |
|---|---|---|
valid | boolean | true if the OSGB dataset is intact; false if any files are missing or contain errors. |
reason | text | A description of the missing or error files. Returns NULL if valid is true. |
Options
| Option | Type | Default | Description |
|---|---|---|---|
parallel | Integer | 1 | The degree of parallelism (DOP) for validation. Higher values speed up validation but use more memory. Set to a value below 16. Values below 1 are ignored. |
exclude | String | — | Skips OSGB files whose file paths contain this string. For example, Tile_A excludes all files with Tile_A in their path. |
include | String | — | Validates only OSGB files whose file paths contain this string. For example, Tile_B validates only files with Tile_B in their path. |
Usage notes
ST_ValidateOSGB scans the OSGB dataset in OSS and identifies two categories of issues:
Missing files: OSGB files that no longer exist in OSS.
File errors: OSGB files that exist but are unreadable or contain errors.
Use this function in two situations:
Before import: Run validation to confirm data integrity before calling
ST_ImportOSGB. Missing or error files are a common cause of import failures, and validating first lets you resolve them before they block the import.After a failed import: When
ST_ImportOSGBreports errors, runST_ValidateOSGBfirst to pinpoint the problem files before retrying.
Examples
Basic validation
SELECT ST_ValidateOSGB('OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_oblique_project/');Example output when validation fails:
f | Missing or error file(s): +
| /Data/Tile_+006_+004/Tile_+006_+004_L19_000000t3.osgb +
| /Data/Tile_+006_+004/Tile_+006_+004_L20_0000130t3.osgb+
| /Data/Tile_+006_+004/Tile_+006_+004_L21_00001110.osgb +Validation with parallel processing
Set parallel to speed up validation of large datasets.
SELECT ST_ValidateOSGB('OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_oblique_project/', '{"parallel": 4}');Example output when validation fails:
f | Missing or error file(s): +
| /Data/Tile_+006_+004/Tile_+006_+004_L19_000000t3.osgb +
| /Data/Tile_+006_+004/Tile_+006_+004_L20_0000130t3.osgb+
| /Data/Tile_+006_+004/Tile_+006_+004_L21_00001110.osgb +What's next
After the dataset passes validation, import it into your database with ST_ImportOSGB.