Simple kml generation in node
Not recommended for use outside of urban-sky yet. This package is highly subject to change and very early stage.
Install
$ npm install kmlify
Usage
const KMLify = require('kmlify');
const kml = new KMLify({name: 'Seagull Flight Path'})
kml.placemark({
name: 'Seagull1',
coordinates: [
[-102.0000492, 41.07128125, 20062],
[-101.9940706, 41.07336908, 19669]
]
})
const output = t.context.kml.export(true)
Ouput
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Seagull Flight Path.kml</name>
...
<Placemark>
<name>Seagull1</name>
<styleUrl>#msn_ylw-pushpin0</styleUrl>
<LineString>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>absolute</altitudeMode>
<coordinates>
-102.0000492,41.07128125,20062 -101.9940706,41.07336908,19669
</coordinates>
</LineString>
</Placemark>
</Document>
</kml>
License
MIT