2013-05-27 17:21:56 +08:00
|
|
|
var ogr = require('./ogr');
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2013-05-27 17:21:56 +08:00
|
|
|
function kml() {}
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2013-05-27 17:21:56 +08:00
|
|
|
kml.prototype = new ogr('kml');
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2013-05-27 17:21:56 +08:00
|
|
|
var p = kml.prototype;
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2013-05-27 17:21:56 +08:00
|
|
|
p._contentType = "application/kml; charset=utf-8";
|
|
|
|
p._fileExtension = "kml";
|
2013-11-05 23:56:07 +08:00
|
|
|
// As of GDAL 1.10 SRID detection is bogus, so we use
|
|
|
|
// 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
|
|
|
|
p._needSRS = true;
|
2013-05-16 17:24:52 +08:00
|
|
|
|
2013-05-27 17:21:56 +08:00
|
|
|
p.generate = function(options, callback) {
|
2013-05-16 17:24:52 +08:00
|
|
|
var o = options;
|
2013-11-06 00:29:02 +08:00
|
|
|
this.toOGR_SingleFile(o.database, o.user_id, o.gn, o.sql, o.skipfields, 'KML', 'kml', o.filename, callback);
|
2013-05-16 17:24:52 +08:00
|
|
|
};
|
|
|
|
|
2013-05-27 17:21:56 +08:00
|
|
|
module.exports = kml;
|