2018-10-24 21:42:33 +08:00
|
|
|
'use strict';
|
|
|
|
|
2019-01-16 22:58:11 +08:00
|
|
|
var Ogr = require('./../ogr');
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2019-12-24 01:19:08 +08:00
|
|
|
function KmlFormat () {}
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2019-01-16 22:58:11 +08:00
|
|
|
KmlFormat.prototype = new Ogr('kml');
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2019-12-24 01:19:08 +08:00
|
|
|
KmlFormat.prototype._contentType = 'application/kml; charset=utf-8';
|
|
|
|
KmlFormat.prototype._fileExtension = 'kml';
|
2013-11-06 15:06:29 +08:00
|
|
|
// As of GDAL 1.10.1 SRID detection is bogus, so we use
|
2013-11-05 23:56:07 +08:00
|
|
|
// our own method. See:
|
|
|
|
// http://trac.osgeo.org/gdal/ticket/5131
|
|
|
|
// http://trac.osgeo.org/gdal/ticket/5287
|
|
|
|
// http://github.com/CartoDB/CartoDB-SQL-API/issues/110
|
|
|
|
// http://github.com/CartoDB/CartoDB-SQL-API/issues/116
|
2013-11-06 15:06:29 +08:00
|
|
|
// Bug was fixed in GDAL 1.10.2
|
2014-08-03 02:27:05 +08:00
|
|
|
KmlFormat.prototype._needSRS = true;
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2019-12-24 01:19:08 +08:00
|
|
|
KmlFormat.prototype.generate = function (options, callback) {
|
2013-11-15 20:24:48 +08:00
|
|
|
this.toOGR_SingleFile(options, 'KML', callback);
|
2013-05-16 17:24:52 +08:00
|
|
|
};
|
|
|
|
|
2014-08-03 02:27:05 +08:00
|
|
|
module.exports = KmlFormat;
|