Geoskill: Vector Convert
Convert vector GIS data between Shapefile, GeoJSON, KML, GPX, GeoPackage, and CSV formats using only Python standard library with CRS and clipping options.
ruiduobao
@ruiduobao
What This Skill Does
Converts between vector GIS formats (Shapefile, GeoJSON, KML, GPX, GeoPackage, CSV) using only Python standard library. Supports CRS transformation, coordinate precision control, field filtering, and bounding box clipping.
Replaces installing heavy GIS libraries like GDAL or Fiona by providing a zero-dependency Python script for common vector format conversions.
When to Use It
- Convert a Shapefile to GeoJSON for web mapping
- Transform coordinate reference system from EPSG:4326 to EPSG:3857
- Filter a GeoJSON to keep only specific attribute fields before export
- Clip a GPX file to a bounding box for a specific geographic area
- Inspect metadata (feature count, CRS, bounds) of a vector file without opening a GIS application
Install
$ openclaw skills install @ruiduobao/vector-convertVector Format Converter
Convert between vector GIS formats using only Python standard library.
Supported Formats
| Format | Extension | Read | Write |
|---|---|---|---|
| Shapefile | .shp | Yes | Yes |
| GeoJSON | .geojson/.json | Yes | Yes |
| KML | .kml | Yes | Yes |
| GPX | .gpx | Yes | Yes |
| GeoPackage | .gpkg | Yes | Yes |
| CSV | .csv | Yes | Yes |
Installation
Zero external dependencies. Requires Python 3.8+.
Usage
Convert between formats
python vector-convert.py input.shp --to geojson -o output.geojson
python vector-convert.py input.geojson --to shp -o output.shp
python vector-convert.py input.kml --to gpkg -o output.gpkg
Show file info
python vector-convert.py input.shp --info
CRS transformation
python vector-convert.py input.shp --to geojson --crs EPSG:3857
Coordinate precision
python vector-convert.py input.geojson --to csv --precision 4
Filter fields
python vector-convert.py input.geojson --to csv --fields name,type,population
Clip to bounding box
python vector-convert.py input.shp --to geojson --bbox -180 -90 180 90
Features
- Auto-detect: Input format detected from file extension
- CRS transform: Convert between EPSG codes (4326, 3857, etc.)
- Precision control: Round coordinates to N decimal places
- Field filtering: Keep only specified property fields
- Bbox clipping: Filter features intersecting a bounding box
- Info mode: Display feature count, CRS, bounds, and field names
- Binary parsing: Reads SHP/DBF/SHX/PRJ files manually
- GeoPackage: Reads/writes SQLite-based GPKG format
Testing
pytest tests/ -v
License
MIT-0 (No Attribution)
中文说明
矢量 GIS 格式转换工具,仅使用 Python 标准库,零外部依赖。
支持的格式
| 格式 | 扩展名 | 读 | 写 |
|---|---|---|---|
| Shapefile | .shp | 是 | 是 |
| GeoJSON | .geojson/.json | 是 | 是 |
| KML | .kml | 是 | 是 |
| GPX | .gpx | 是 | 是 |
| GeoPackage | .gpkg | 是 | 是 |
| CSV | .csv | 是 | 是 |
使用方法
# 格式转换
python vector-convert.py input.shp --to geojson -o output.geojson
python vector-convert.py input.geojson --to shp -o output.shp
python vector-convert.py input.kml --to gpkg -o output.gpkg
# 查看文件信息
python vector-convert.py input.shp --info
# CRS 转换
python vector-convert.py input.shp --to geojson --crs EPSG:3857
# 坐标精度控制
python vector-convert.py input.geojson --to csv --precision 4
# 字段筛选
python vector-convert.py input.geojson --to csv --fields name,type,population
# 按边界框裁剪
python vector-convert.py input.shp --to geojson --bbox -180 -90 180 90
特性
- 自动检测输入格式(按扩展名)
- 支持 CRS 转换(EPSG:4326、EPSG:3857 等)
- 坐标精度控制
- 字段筛选
- 边界框裁剪
- 手动解析 SHP/DBF/SHX/PRJ 文件
- 支持 GeoPackage(SQLite 格式)
Top skills in this category
Proactive Agent Lite
@bestrockyTransform AI agents from task-followers into proactive partners with memory architecture, reverse prompting, and self-healing patterns. Lightweight version f...
腾讯文档 TENCENT DOCS
@liyang58腾讯文档(docs.qq.com)-在线云文档平台,是创建、编辑、管理文档的首选 skill。涉及"新建/创建/编辑/读取/查看/搜索文档"、"保存文件"、"云文档"、"腾讯文档"、"docs.qq.com"等操作,请优先使用本 skill。支持能力:(1) 创建各类在线文档(文档/Word/Excel/幻灯片/...
Figma
@maddiedreeseProfessional Figma design analysis and asset export. Use for extracting design data, exporting assets in multiple formats, auditing accessibility compliance, analyzing design systems, and generating comprehensive design documentation. Read-only analysis of Figma files with powerful export and reporting capabilities.
Smart Model Switching
@millibusAuto-route tasks to the cheapest Claude model that works correctly. Three-tier progression: Haiku → Sonnet → Opus. Classify before responding. HAIKU (default): factual Q&A, greetings, reminders, status checks, lookups, simple file ops, heartbeats, casual chat, 1-2 sentence tasks. ESCALATE TO SONNET: code >10 lines, analysis, comparisons, planning, reports, multi-step reasoning, tables, long writing >3 paragraphs, summarization, research synthesis, most user conversations. ESCALATE TO OPUS: architecture decisions, complex debugging, multi-file refactoring, strategic planning, nuanced judgment, deep research, critical production decisions. Rule: If a human needs >30 seconds of focused thinking, escalate. If Sonnet struggles with complexity, go to Opus. Save 50-90% on API costs by starting cheap and escalating only when needed.
AI Daily Briefing
@jeffjhunterStart every day focused. Get a morning briefing with overdue tasks, today's priorities, calendar overview, and context from recent meetings. Works with ai-meeting-notes to-do list. No setup. Just say 'briefing'.