# kml-split **Repository Path**: mirrors_mapbox/kml-split ## Basic Information - **Project Name**: kml-split - **Description**: Split KML files with many layers into separate files. - **Primary Language**: Unknown - **License**: ISC - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2025-09-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # kml-split Split KML files with many layers into separate files. Go from `1 KML file with 20 layers` to `4 KML files with 5 layers`. Uses Node GDAL to read KML sources and create KML sinks. [![Build Status](https://travis-ci.com/mapbox/kml-split.svg?branch=master)](https://travis-ci.com/mapbox/kml-split) # Usage ### Install ``` # package.json npm install @mapbox/kml-split --save # globally npm install @mapbox/kml-split -g ``` ### `kmlSplit(file, options, callback)` Example ```javascript var kmlSplit = require('@mapbox/kml-split'); kmlSplit('./path/to/file.kml', {maxLayers: 5}, function(err, res) { if (err) throw err; console.log(res); // => array of file paths for newly created files }); ``` Options * `maxLayers`: the maximum number of layers per file (default: `15`) * `outDir`: output directory for the newly created files (defaults to the current directory) ### CLI ``` kml-split -l/--layers -o/--output ``` Example ``` kml-split my-awesome.kml -l 15 -o ../../output/files ``` # Test ``` npm test ```