检查矢量几何有效性、拓扑错误、属性完整性与 CRS 一致性,输出分级质量报告。Validate geometry validity, topology, attribute completeness and CRS consistency for vector data and emit a graded quality report.
Memory
Geoskill: Geospatial Data Quality Audit
Try itUnified geospatial data quality audit for GIS data packages. Checks raster, vector, table, NetCDF, and directory structure. Outputs JSON/HTML reports, issue layers, checksums, and machine-readable exit codes. Use when the user wants to validate data packages, check delivery quality, find CRS/nodata/ geometry issues, or generate QA reports.
What it does
Unified geospatial data quality audit for GIS data packages. Checks raster, vector, table, NetCDF, and directory structure. Outputs JSON/HTML reports, issue layers, checksums, and machine-readable exit codes. Use when the user wants to validate data packages, check delivery quality, find CRS/nodata/ geometry issues, or generate QA reports.
The skill document
Prerequisites / 先准备 X 文件
⚠️ 必读 — 本 skill 不属于即用型,需要先准备特定文件才能跑。
本 skill 不下载数据,只审计你给的 本地数据目录。
👉 完整教程见仓库根目录 PREREQUISITES.md 2.3 节。
先准备 X 文件:随便指一个 GIS 数据目录就能跑。
快速试跑命令:
python geospatial_data_quality_audit.py /path/to/your/data --html --issues-geojson
Geospatial Data Quality Audit
⚠️ 本 skill 不下载数据。它只审计本地
input_dir下的文件。--bbox/--aoi-file接口仅为上下文记录 (写到output-manifest.json),不会触发任何下载。
Unified QA tool for GIS data packages. Recursively discovers geospatial files, runs per-file and cross-file checks, and produces structured reports.
Trigger
Use when the user wants to:
- Check/validate a directory of spatial data
- Find CRS, nodata, geometry, encoding issues
- Generate QA reports (JSON/HTML) for data delivery
- Verify cross-file consistency (CRS, extent, resolution)
- Produce checksums or issue layers
Boundaries
- Read-only by default (
--fix-safenot implemented in this version) - Does not modify source data
- Does not download external data
- Compliance/certification conclusions require human review
CLI Usage
# Basic audit
python scripts/geospatial_data_quality_audit.py /path/to/data
# With HTML report and issues GeoJSON
python scripts/geospatial_data_quality_audit.py /path/to/data --html --issues-geojson
# Custom rules
python scripts/geospatial_data_quality_audit.py /path/to/data --rules rules.json
# Fail on warnings too
python scripts/geospatial_data_quality_audit.py /path/to/data --fail-on warning
# Non-recursive with checksums
python scripts/geospatial_data_quality_audit.py /path/to/data --no-recursive --checksums
Arguments
| Argument | Description |
|---|---|
input_dir | Directory to audit (required) |
--output-dir, -o | Output directory (default: /qa-output) |
--rules | Custom rules JSON file |
--no-recursive | Don't recurse into subdirectories |
--html | Generate HTML report |
--issues-geojson | Generate spatial issues GeoJSON |
--checksums | Generate MD5 checksums file |
--fail-on | Fail on error (default) or warning |
--sample-size | Max files to check (0=all) |
Output
| File | Description |
|---|---|
qa-report.json | Full JSON report with all findings |
qa-report.html | Human-readable HTML report (with --html) |
qa.json | Summary: score, error/warning counts |
spatial_issues.geojson | Point layer of spatial issues (with --issues-geojson) |
checksums.txt | MD5 checksums (with --checksums) |
output-manifest.json | Machine-readable manifest |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | All checks pass (or only warnings) |
| 2 | Argument error |
| 3 | Dependency missing |
| 6 | Data validation failure (errors found) |
| 7 | Processing failure |
QA Score
score = max(0, 100 - errors * 10 - warnings * 2)
Supported Formats
- Raster: GeoTIFF, IMG, ASC, GRD
- Vector: Shapefile, GeoJSON, KML, GML, GPKG, GPX
- Table: CSV, TSV, Parquet, Excel
- NetCDF: NC, NC4, HDF, HDF5
- LAS: LAS, LAZ (basic checks)
- Document: DOCX, PDF, MD (basic checks)
Rule Engine
Built-in rules cover file readability, CRS presence, nodata, geometry validity, encoding, companion files, and cross-file consistency. Custom rules via JSON config extend with size limits, required CRS, and forbidden extensions.
See references/rules.md for full rule catalog.
Workflow
- Recursively discover geospatial files (skip hidden/cache dirs)
- Detect file type from extension + content sniff
- Run per-file checks (type-specific)
- Run cross-file consistency checks
- Apply rule engine (built-in + custom)
- Generate reports and exit with appropriate code
Dependencies
- Pure Python stdlib for basic checks
rasterio(optional) for deep raster checksfiona(optional) for deep vector checksnetCDF4(optional) for deep NetCDF checks- Missing optional deps produce warnings, not errors
Related skills
解析 ISO 19115 / FGDC 格式 XML 元数据,验证必填项、受控词表与一致性规则,输出完整性评分与问题清单。Parse ISO 19115 / FGDC XML metadata, validate required fields and controlled vocabularies, and report a completeness score.
Automated quality inspection for UAV/drone survey deliverables including aerial images, orthomosaics, DSM/DEM, control points, and aerial triangulation reports. Generates coverage, clarity, seam, and accuracy QA.
Inspect, validate, summarize, and troubleshoot GeoJSON files and payloads, including FeatureCollection checks, geometry counting, bbox generation, coordinate...
对矢量数据做变更检测、版本快照与差异比较,支持 commit / diff / log 操作。Change detection, version snapshots and diff comparison for vector data with commit / diff / log operations.
Render reports (HTML/DOCX/PDF) from other skills' output-manifest.json. Auxiliary tool only — does not analyze data, does not download anything. Workflow: run another skill to produce output-manifest.json first, then hand the manifest (or its parent directory) to this skill to render the final report. Use when the user already has skill outputs and wants a formatted deliverable document.