home / skills / dkyazzentwatwa / chatgpt-skills / kml-geojson-converter
This skill converts geographic data between KML and GeoJSON, preserving features and enabling batch processing for mapping and GIS workflows.
npx playbooks add skill dkyazzentwatwa/chatgpt-skills --skill kml-geojson-converterReview the files below or copy the command above to add this skill to your agents.
---
name: kml-geojson-converter
description: Use when asked to convert between KML and GeoJSON formats, or convert geo data for mapping applications.
---
# KML/GeoJSON Converter
Convert geographic data between KML, GeoJSON, and other geo formats for mapping and GIS applications.
## Purpose
Geo format conversion for:
- Google Maps / Earth integration
- Web mapping applications (Leaflet, Mapbox)
- GIS data interchange
- Spatial data processing
- GPS track conversion
## Features
- **Bidirectional Conversion**: KML ↔ GeoJSON
- **Feature Preservation**: Maintain properties, styles, descriptions
- **Batch Processing**: Convert multiple files
- **Coordinate Systems**: WGS84, UTM support
- **Validation**: Verify output format validity
- **Simplification**: Reduce polygon complexity
## Quick Start
```python
from kml_geojson_converter import GeoConverter
# KML to GeoJSON
converter = GeoConverter()
converter.load_kml('input.kml')
converter.save_geojson('output.geojson')
# GeoJSON to KML
converter.load_geojson('input.geojson')
converter.save_kml('output.kml')
```
## CLI Usage
```bash
# Convert KML to GeoJSON
python kml_geojson_converter.py input.kml --to geojson --output output.geojson
# Convert GeoJSON to KML
python kml_geojson_converter.py input.geojson --to kml --output output.kml
```
This skill converts geographic data between KML and GeoJSON formats for mapping and GIS workflows. It preserves feature properties and styles, supports batch processing, and can validate and simplify geometry for efficient display. Use it to prepare data for Google Maps, Mapbox, Leaflet, or GIS analysis pipelines.
The converter loads KML or GeoJSON, parses features and their attributes, and maps geometry and property structures between formats. It preserves descriptions, styles, and metadata where possible, offers coordinate system handling (WGS84 and UTM), and can simplify polygons to reduce complexity. Validation checks confirm the output meets the target format schema before saving.
Will styles and descriptions always transfer between formats?
The converter preserves styles and descriptions where both formats support them, but some complex KML styling may not map exactly to GeoJSON styling conventions.
Can I automate bulk conversions?
Yes. The CLI and library both support batch processing so you can script conversions across many files.