toGeoJSON

# toGeoJSON turns KML & GPX into GeoJSON

<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark> <name>Simple placemark</name> <description>Attached to the ground. Intelligently places itself at the height of the underlying terrain.</description> <Point> <coordinates>-122.0822035425683,37.42228990140251,0</coordinates> </Point> </Placemark> </kml>
GeoJSON
⬇ togeojson.js 3.9 KB
or clone & contribute on github

toGeoJSON is a simple way to use KML and GPX formats with modern web tools like Leaflet and MapBox. It's simple, written in plain, dependency-free JavaScript and designed to work across browsers and in node.js.

Use this page to test it out, or download it to integrate into your application.

### KML

- LineString, Polygon, MultiPolygon, MultiLineString, Point, MultiGeometry
- ExtendedData, SimpleData, name, description

### GPX

- Tracks, Routes, and Waypoints
- Standard metadata