KML
Use this skill for practical KML and KMZ inspection, validation, and lightweight data extraction.
This skill is optimized for safe analysis of KML structure and coordinates. For deterministic reprojection, clipping, format conversion, or batch GIS processing on files, hand off to qgis.
What This Skill Does
- Inspect
.kml and .kmz files.
- Summarize document name, placemark count, geometry types, folder count, and bbox.
- Validate coordinate tuples and flag obvious longitude/latitude range problems.
- Extract placemark-level summaries for downstream review or cleanup.
- Explain common KML/KMZ issues such as missing
doc.kml, malformed XML, empty Placemark, or suspicious coordinate order.
Standard Workflow
- Confirm whether the input is a
.kml file or a .kmz archive.
- Parse the XML and detect the main KML document inside KMZ when needed.
- Count placemarks, geometry types, folders, overlays, and coordinates.
- Compute bbox from parsed coordinates when possible.
- Flag likely issues:
- malformed XML
- KMZ archive without a readable KML payload
- coordinate tuples outside lon/lat range
- empty placemarks without geometry
- If the user needs reprojection, clipping, or deterministic file conversion, switch to
qgis.
Practical Commands
Summarize a KML or KMZ file
python3 {baseDir}/scripts/kml_tool.py summary --file ./data/sample.kml
Validate a KML or KMZ file
python3 {baseDir}/scripts/kml_tool.py validate --file ./data/sample.kmz
List placemark summaries
python3 {baseDir}/scripts/kml_tool.py placemarks --file ./data/sample.kml
Decision Rules
- Treat KML coordinates as
lon,lat[,alt] unless the source explicitly says otherwise.
- KML is commonly used with WGS84-style geographic coordinates; if precision matters, confirm the source workflow instead of guessing.
- Do not silently rewrite malformed coordinates; report the exact problem.
- Prefer writing derived outputs to a new path when a later task requires edits or conversion.
- If the user wants GeoJSON, Shapefile, reprojection, clipping, or batch cleanup, route execution to
qgis.
What To Return
- Source type:
kml or kmz.
- Document name when present.
- Placemark count and geometry type counts.
- Folder and overlay counts.
- Bounding box when coordinates are present.
- Specific validation errors or suspicious patterns when found.
When Not To Use
- Reverse geocoding or coordinates-to-address lookup: use
geocode.
- WGS84-specific CRS reasoning: use
wgs84.
- Deterministic GIS conversion, reprojection, clipping, or raster/vector processing: use
qgis.
- Web map rendering logic: use
leaflet, mapbox, or cesium as appropriate.
OpenClaw + ClawHub Notes
- Keep examples generic and portable.
- Do not hardcode private datasets, machine paths, or secrets.
- For clawhub.ai publication, keep examples standards-based and version/changelog updates semver-driven.
Reference Docs In This Skill
- Read
{baseDir}/references/patterns.md for KML/KMZ structure notes, common failures, and escalation guidance.
1---2name: kml3description: Inspect, validate, summarize, and extract data from KML and KMZ files, including Placemark geometry counts, Folder structure, coordinate ranges, bbox generation, altitude tuples, Google Earth packaging issues, and conversion guidance. Use when the user asks about KML, KMZ, Google Earth placemarks, coordinate extraction, KML cleanup, KMZ debugging, or KML data processing. 中文触发:KML、KMZ、谷歌地球、地标、坐标提取、KML 校验、KMZ 解包、KML 数据处理。4---5
6# KML
7
8Use this skill for practical KML and KMZ inspection, validation, and lightweight data extraction.
9
10This skill is optimized for safe analysis of KML structure and coordinates. For deterministic reprojection, clipping, format conversion, or batch GIS processing on files, hand off to `qgis`.
11
12## What This Skill Does
13
14- Inspect `.kml` and `.kmz` files.
15- Summarize document name, placemark count, geometry types, folder count, and bbox.
16- Validate coordinate tuples and flag obvious longitude/latitude range problems.
17- Extract placemark-level summaries for downstream review or cleanup.
18- Explain common KML/KMZ issues such as missing `doc.kml`, malformed XML, empty `Placemark`, or suspicious coordinate order.
19
20## Standard Workflow
21
221. Confirm whether the input is a `.kml` file or a `.kmz` archive.
232. Parse the XML and detect the main KML document inside KMZ when needed.
243. Count placemarks, geometry types, folders, overlays, and coordinates.
254. Compute bbox from parsed coordinates when possible.
265. Flag likely issues:
27 - malformed XML
28 - KMZ archive without a readable KML payload
29 - coordinate tuples outside lon/lat range
30 - empty placemarks without geometry
316. If the user needs reprojection, clipping, or deterministic file conversion, switch to `qgis`.
32
33## Practical Commands
34
35### Summarize a KML or KMZ file
36
37```bash
38python3 {baseDir}/scripts/kml_tool.py summary --file ./data/sample.kml
39```
40
41### Validate a KML or KMZ file
42
43```bash
44python3 {baseDir}/scripts/kml_tool.py validate --file ./data/sample.kmz
45```
46
47### List placemark summaries
48
49```bash
50python3 {baseDir}/scripts/kml_tool.py placemarks --file ./data/sample.kml
51```
52
53## Decision Rules
54
55- Treat KML coordinates as `lon,lat[,alt]` unless the source explicitly says otherwise.
56- KML is commonly used with WGS84-style geographic coordinates; if precision matters, confirm the source workflow instead of guessing.
57- Do not silently rewrite malformed coordinates; report the exact problem.
58- Prefer writing derived outputs to a new path when a later task requires edits or conversion.
59- If the user wants GeoJSON, Shapefile, reprojection, clipping, or batch cleanup, route execution to `qgis`.
60
61## What To Return
62
63- Source type: `kml` or `kmz`.
64- Document name when present.
65- Placemark count and geometry type counts.
66- Folder and overlay counts.
67- Bounding box when coordinates are present.
68- Specific validation errors or suspicious patterns when found.
69
70## When Not To Use
71
72- Reverse geocoding or coordinates-to-address lookup: use `geocode`.
73- WGS84-specific CRS reasoning: use `wgs84`.
74- Deterministic GIS conversion, reprojection, clipping, or raster/vector processing: use `qgis`.
75- Web map rendering logic: use `leaflet`, `mapbox`, or `cesium` as appropriate.
76
77## OpenClaw + ClawHub Notes
78
79- Keep examples generic and portable.
80- Do not hardcode private datasets, machine paths, or secrets.
81- For clawhub.ai publication, keep examples standards-based and version/changelog updates semver-driven.
82
83## Reference Docs In This Skill
84
85- Read `{baseDir}/references/patterns.md` for KML/KMZ structure notes, common failures, and escalation guidance.