CartoDB-SQL-API/app/models/formats/ogr/kml.js

23 lines
705 B
JavaScript
Raw Normal View History

var ogr = require('./../ogr');
2013-05-16 17:24:52 +08:00
2014-08-03 02:27:05 +08:00
function KmlFormat() {}
2013-05-16 17:24:52 +08:00
2014-08-03 02:27:05 +08:00
KmlFormat.prototype = new ogr('kml');
2013-05-16 17:24:52 +08:00
2014-08-03 02:27:05 +08:00
KmlFormat.prototype._contentType = "application/kml; charset=utf-8";
KmlFormat.prototype._fileExtension = "kml";
// As of GDAL 1.10.1 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
// 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
2014-08-03 02:27:05 +08:00
KmlFormat.prototype.generate = function(options, callback) {
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;