npm.io
1.0.13 • Published 3 years ago

kml-to-geojson

Licence
MIT
Version
1.0.13
Deps
1
Size
28 kB
Vulns
7
Weekly
0

kml-to-geojson

Convert KML content to GeoJSON, preserving style and folder data

Installation

npm install kml-to-geojson

This project was built in Typescript, so typing is supported out of the box

Usage

import { KmlToGeojson } from 'kml-to-geojson';
import * as fs from 'fs';

const kmlToGeojson = new KmlToGeojson();
const kmlContent = fs.readFileSync('./my-file.kml', 'utf-8');


const { folders, geojson } = kmlToGeojson.parse(kmlContent);