validate¶
validate_layers
¶
validate_layers(path: str | Path, expected_srid: Optional[int] = None, layers: Optional[list[str]] = None) -> GpkgReport
Validate geometry health for layers in a GeoPackage.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
Path to the GeoPackage file.
TYPE:
|
expected_srid
|
Optional SRID to check against (e.g., 4326).
TYPE:
|
layers
|
Optional list of layer names to validate. None = all layers.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
GpkgReport
|
GpkgReport with per-layer validation results. |
Example
report = validate_layers("data.gpkg", expected_srid=4326) print(report.summary()) assert report.is_valid
Source code in geopkgtoolkit/validate.py
validate_layer
¶
Validate geometry health for a single layer.
| PARAMETER | DESCRIPTION |
|---|---|
con
|
SQLite connection with SpatiaLite loaded.
TYPE:
|
table
|
Layer/table name.
TYPE:
|
expected_srid
|
Optional SRID to check against (e.g., 4326).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LayerReport
|
LayerReport with validation results. |
Source code in geopkgtoolkit/validate.py
LayerReport
dataclass
¶
LayerReport(table_name: str, geometry_column: str, geometry_type: Optional[str], feature_count: int, srid: Optional[int], null_count: int = 0, empty_count: int = 0, invalid_count: int = 0, bbox: Optional[tuple] = None, warnings: list = list())
Validation report for a single layer.
Attributes¶
Functions¶
summary
¶
One-line summary string.