Inspect, explain, validate, and convert ESRI Shapefile datasets, including `.shp/.shx/.dbf/.prj` sidecar requirements, CRS detection, field-name/type limits,...
Data & analysis
shapefile
Try itInspect, explain, validate, and convert ESRI Shapefile datasets, including `.shp/.shx/.dbf/.prj` sidecar requirements, CRS detection, field-name/type limits,...
What it does
Inspect, explain, validate, and convert ESRI Shapefile datasets, including `.shp/.shx/.dbf/.prj` sidecar requirements, CRS detection, field-name/type limits,...
The skill document
Shapefile
Use this skill for practical Shapefile handling, debugging, and migration planning.
Workflow
- Confirm whether the task is inspection, repair, conversion, schema explanation, or batch cleanup.
- Identify which companion files are present:
.shp,.shx,.dbf,.prj, and optionally.cpg. - Check CRS, encoding, geometry type, and field-name limits before suggesting edits or conversions.
- Prefer writing outputs to a new path; avoid in-place mutation unless the user explicitly asks.
- If the dataset is large or the workflow is repeated, prefer a deterministic CLI path through
qgis.
Core Rules
- Treat a Shapefile as a multi-file dataset, not a single
.shpfile. - Missing
.shxor.dbfusually means the dataset is incomplete. - Missing
.prjmeans CRS is unknown, not automatically WGS84. - DBF field names are short and legacy-oriented; watch for truncation and type loss.
- Text encoding may depend on
.cpg; without it, non-ASCII text can decode incorrectly. - Shapefile is poor for long field names, rich types, large text, and modern metadata needs.
Common Failure Checks
- File opens but attributes are broken: verify
.dbfexists and encoding is correct. - Features draw in the wrong place: verify
.prjexists and the CRS was not guessed incorrectly. - Import succeeds but schema looks wrong: check field-name truncation and DBF type limitations.
- Multipart or invalid geometry surprises: inspect geometry type before conversion or editing.
- One file was copied alone: remind that the full sidecar set must travel together.
Preferred Outcomes
- For interchange with legacy systems, preserve the Shapefile but document its CRS and encoding explicitly.
- For ongoing editing or richer schema, migrate to
GPKG. - For lightweight web interchange, convert to
GeoJSONonly when the CRS and precision tradeoffs are acceptable. - For deterministic file conversion or batch fixes, hand off execution to
qgis.
Task Boundaries
- Use this skill for Shapefile structure, limitations, troubleshooting, and migration guidance.
- For general CRS selection, use
projectorwgs84. - For actual file-based conversion, reprojection, clipping, or repair commands, use
qgis. - For web map rendering or tiles, use
mapboxorcesiumas appropriate.
OpenClaw + ClawHub Notes
- Keep examples generic and portable.
- Do not hardcode private data paths, private datasets, or machine-specific environments.
- For clawhub.ai publication, keep the skill concise, reproducible, and semver-friendly; keep detailed patterns in references.
Reference Docs In This Skill
- Read
{baseDir}/references/patterns.mdwhen you need concrete Shapefile validation, packaging, or conversion guidance.
Related skills
Inspect, validate, summarize, and troubleshoot GeoJSON files and payloads, including FeatureCollection checks, geometry counting, bbox generation, coordinate...
基于 GDAL / OGR 批量转换栅格与矢量格式 (GeoTIFF / Shapefile / GeoPackage / GeoJSON) 并记录日志。Batch convert raster and vector formats (GeoTIFF / Shapefile / GeoPackage / GeoJSON) via GDAL / OGR with logging.
Download OpenStreetMap features via Overpass API. Query by bbox, tag filter, or administrative place name (e.g. 北京市朝阳区). Output GeoJSON and/or Shapefile (UTF-8 with .cpg). Supports roads, buildings, POIs, landuse, natural features, semantic presets (water/road/building/green), multi-format export, and an automatic QA summary.
检查矢量几何有效性、拓扑错误、属性完整性与 CRS 一致性,输出分级质量报告。Validate geometry validity, topology, attribute completeness and CRS consistency for vector data and emit a graded quality report.
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.