diff --git a/app/models/formats/ogr/csv.js b/app/models/formats/ogr/csv.js index 655ff289..74638d20 100644 --- a/app/models/formats/ogr/csv.js +++ b/app/models/formats/ogr/csv.js @@ -1,10 +1,10 @@ 'use strict'; -var ogr = require('./../ogr'); +var Ogr = require('./../ogr'); function CsvFormat() {} -CsvFormat.prototype = new ogr('csv'); +CsvFormat.prototype = new Ogr('csv'); CsvFormat.prototype._contentType = "text/csv; charset=utf-8; header=present"; CsvFormat.prototype._fileExtension = "csv"; diff --git a/app/models/formats/ogr/geopackage.js b/app/models/formats/ogr/geopackage.js index 0702b6b9..652158ff 100644 --- a/app/models/formats/ogr/geopackage.js +++ b/app/models/formats/ogr/geopackage.js @@ -1,10 +1,10 @@ 'use strict'; -var ogr = require('./../ogr'); +var Ogr = require('./../ogr'); function GeoPackageFormat() {} -GeoPackageFormat.prototype = new ogr('gpkg'); +GeoPackageFormat.prototype = new Ogr('gpkg'); GeoPackageFormat.prototype._contentType = "application/x-sqlite3; charset=utf-8"; GeoPackageFormat.prototype._fileExtension = "gpkg"; diff --git a/app/models/formats/ogr/kml.js b/app/models/formats/ogr/kml.js index d7a2929f..2bace95c 100644 --- a/app/models/formats/ogr/kml.js +++ b/app/models/formats/ogr/kml.js @@ -1,10 +1,10 @@ 'use strict'; -var ogr = require('./../ogr'); +var Ogr = require('./../ogr'); function KmlFormat() {} -KmlFormat.prototype = new ogr('kml'); +KmlFormat.prototype = new Ogr('kml'); KmlFormat.prototype._contentType = "application/kml; charset=utf-8"; KmlFormat.prototype._fileExtension = "kml"; diff --git a/app/models/formats/ogr/shp.js b/app/models/formats/ogr/shp.js index 64e5b622..68c30aa3 100644 --- a/app/models/formats/ogr/shp.js +++ b/app/models/formats/ogr/shp.js @@ -4,12 +4,12 @@ var step = require('step'); var fs = require('fs'); var spawn = require('child_process').spawn; -var ogr = require('./../ogr'); +var Ogr = require('./../ogr'); function ShpFormat() { } -ShpFormat.prototype = new ogr('shp'); +ShpFormat.prototype = new Ogr('shp'); ShpFormat.prototype._contentType = "application/zip; charset=utf-8"; ShpFormat.prototype._fileExtension = "zip"; diff --git a/app/models/formats/ogr/spatialite.js b/app/models/formats/ogr/spatialite.js index 89120829..34819b18 100644 --- a/app/models/formats/ogr/spatialite.js +++ b/app/models/formats/ogr/spatialite.js @@ -1,10 +1,10 @@ 'use strict'; -var ogr = require('./../ogr'); +var Ogr = require('./../ogr'); function SpatiaLiteFormat() {} -SpatiaLiteFormat.prototype = new ogr('spatialite'); +SpatiaLiteFormat.prototype = new Ogr('spatialite'); SpatiaLiteFormat.prototype._contentType = "application/x-sqlite3; charset=utf-8"; SpatiaLiteFormat.prototype._fileExtension = "sqlite"; diff --git a/app/models/formats/pg/arraybuffer.js b/app/models/formats/pg/arraybuffer.js index c4a947cc..d0976599 100644 --- a/app/models/formats/pg/arraybuffer.js +++ b/app/models/formats/pg/arraybuffer.js @@ -2,12 +2,12 @@ var _ = require('underscore'); -var pg = require('./../pg'); +var Pg = require('./../pg'); var ArrayBufferSer = require("../../bin_encoder"); function BinaryFormat() {} -BinaryFormat.prototype = new pg('arraybuffer'); +BinaryFormat.prototype = new Pg('arraybuffer'); BinaryFormat.prototype._contentType = "application/octet-stream"; @@ -40,6 +40,8 @@ BinaryFormat.prototype.transform = function(result, options, callback) { try { var i; + var r; + var n; var t; // get header types (and guess from name) for(i = 0; i < headersNames.length; ++i) { @@ -62,8 +64,8 @@ BinaryFormat.prototype.transform = function(result, options, callback) { var data = [header]; for(i = 0; i < headersNames.length; ++i) { var d = []; - var n = headersNames[i]; - for(var r = 0; r < total_rows; ++r) { + n = headersNames[i]; + for(r = 0; r < total_rows; ++r) { var row = rows[r][n]; if(headerTypes[i] > ArrayBufferSer.BUFFER) { row = new ArrayBufferSer(headerTypes[i] - ArrayBufferSer.BUFFER, row); diff --git a/app/models/formats/pg/geojson.js b/app/models/formats/pg/geojson.js index b5241f71..a6b49807 100644 --- a/app/models/formats/pg/geojson.js +++ b/app/models/formats/pg/geojson.js @@ -2,14 +2,14 @@ var _ = require('underscore'); -var pg = require('./../pg'); +var Pg = require('./../pg'); const errorHandlerFactory = require('../../../services/error_handler_factory'); function GeoJsonFormat() { this.buffer = ''; } -GeoJsonFormat.prototype = new pg('geojson'); +GeoJsonFormat.prototype = new Pg('geojson'); GeoJsonFormat.prototype._contentType = "application/json; charset=utf-8"; diff --git a/app/models/formats/pg/json.js b/app/models/formats/pg/json.js index d4dff9e5..77fd1a3d 100644 --- a/app/models/formats/pg/json.js +++ b/app/models/formats/pg/json.js @@ -2,7 +2,7 @@ var _ = require('underscore'); -var pg = require('./../pg'); +var Pg = require('./../pg'); const errorHandlerFactory = require('../../../services/error_handler_factory'); function JsonFormat() { @@ -10,7 +10,7 @@ function JsonFormat() { this.lastKnownResult = {}; } -JsonFormat.prototype = new pg('json'); +JsonFormat.prototype = new Pg('json'); JsonFormat.prototype._contentType = "application/json; charset=utf-8"; diff --git a/app/models/formats/pg/svg.js b/app/models/formats/pg/svg.js index 442c041a..6eaa8823 100644 --- a/app/models/formats/pg/svg.js +++ b/app/models/formats/pg/svg.js @@ -1,6 +1,6 @@ 'use strict'; -var pg = require('./../pg'); +var Pg = require('./../pg'); var svg_width = 1024.0; var svg_height = 768.0; @@ -24,7 +24,7 @@ function SvgFormat() { this._streamingStarted = false; } -SvgFormat.prototype = new pg('svg'); +SvgFormat.prototype = new Pg('svg'); SvgFormat.prototype._contentType = "image/svg+xml; charset=utf-8"; SvgFormat.prototype.getQuery = function(sql, options) { diff --git a/app/models/formats/pg/topojson.js b/app/models/formats/pg/topojson.js index 08e4f94b..f45f740c 100644 --- a/app/models/formats/pg/topojson.js +++ b/app/models/formats/pg/topojson.js @@ -1,6 +1,6 @@ 'use strict'; -var pg = require('./../pg'); +var Pg = require('./../pg'); var _ = require('underscore'); var geojson = require('./geojson'); var TopoJSON = require('topojson'); @@ -9,7 +9,7 @@ function TopoJsonFormat() { this.features = []; } -TopoJsonFormat.prototype = new pg('topojson'); +TopoJsonFormat.prototype = new Pg('topojson'); TopoJsonFormat.prototype.getQuery = function(sql, options) { return geojson.prototype.getQuery(sql, options) + ' where ' + options.gn + ' is not null';