@mapbox/kml-split

0.0.1 • Public • Published

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.

Usage

Install

# package.json
npm install kml-split --save

# globally
npm install kml-split -g

kmlSplit(file, options, callback)

Example

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 <file> -l/--layers -o/--output

Example

kml-split my-awesome.kml -l 15 -o ../../output/files

Test

npm test

/@mapbox/kml-split/

    Package Sidebar

    Install

    npm i @mapbox/kml-split

    Weekly Downloads

    6

    Version

    0.0.1

    License

    ISC

    Last publish

    Collaborators

    • mbx-npm-ci-production
    • mbx-npm-ci-staging
    • mbx-npm-advanced-actions-production
    • mbx-npm-advanced-actions-staging
    • mbx-npm-09-production
    • mbx-npm-08-production
    • mbx-npm-07-production
    • mbx-npm-06-production
    • mbx-npm-05-production
    • mbx-npm-04-production
    • mbx-npm-03-production
    • mbx-npm-02-production
    • mbx-npm-01-production
    • mbx-npm-02-staging
    • mapbox-npm-01
    • mapbox-npm-02
    • mapbox-npm-07
    • mapbox-npm-03
    • mapbox-npm-04
    • mapbox-npm-09
    • mapbox-npm-05
    • mapbox-npm-06
    • mapbox-npm-08
    • mapbox-npm-advanced-actions
    • mapbox-npm-ci
    • mapbox-npm
    • mapbox-admin
    • mapbox-machine-user