A dependency-free JavaScript library for converting KML, GPX, and TCX files to GeoJSON format.
togeojson is a JavaScript library that converts KML, GPX, and TCX files into GeoJSON format. It solves the problem of interoperability between different geographic data formats by providing a simple, dependency-free tool to transform data for use in modern web mapping and GIS applications.
Developers and GIS professionals working with geographic data who need to convert between KML, GPX, or TCX formats and GeoJSON for web mapping, data analysis, or application integration.
Developers choose togeojson because it's a maintained, lightweight, and tested library with zero dependencies, support for style preservation, and efficient generator-based conversion for large files, unlike older alternatives.
convert KML, TCX, and GPX to GeoJSON, without the fuss
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library has zero external dependencies, making integration straightforward without bloating projects, as emphasized in the README.
Preserves visual styles like colors and opacity from KML and GPX, and emits coordinate properties such as time, ensuring data fidelity in conversions.
Uses generators for conversion, allowing efficient processing of large files without memory overhead, which is highlighted as a key feature.
Unlike the older mapbox/togeojson fork, this version is regularly updated and tested, with high coverage and support from placemark.io.
Intentionally omits KML NetworkLinks, making it unsuitable for files that rely on linked external content without preprocessing, as admitted in the FAQ.
In Node.js, requires installing xmldom separately for XML parsing, adding an extra setup step not bundled with the library.
Does not fully convert all GPX metadata like 'author' and 'copyright' tags, potentially losing information for some use cases.