Merge pull request #404 from CartoDB/avoid-gpkg-fid-column

Avoid gpkg fid column
This commit is contained in:
Raul Ochoa 2017-01-12 12:02:28 +01:00 committed by GitHub
commit efd818838e
3 changed files with 8 additions and 6 deletions

View File

@ -162,7 +162,7 @@ OgrFormat.prototype.toOGR = function(options, out_format, out_filename, callback
} }
if (options.cmd_params){ if (options.cmd_params){
ogrargs.concat(options.cmd_params); ogrargs = ogrargs.concat(options.cmd_params);
} }
ogrargs.push('-nln', out_layername); ogrargs.push('-nln', out_layername);

View File

@ -16,6 +16,7 @@ GeoPackageFormat.prototype._fileExtension = "gpkg";
GeoPackageFormat.prototype._needSRS = true; GeoPackageFormat.prototype._needSRS = true;
GeoPackageFormat.prototype.generate = function(options, callback) { GeoPackageFormat.prototype.generate = function(options, callback) {
options.cmd_params = ['-lco', 'FID=cartodb_id'];
this.toOGR_SingleFile(options, 'GPKG', callback); this.toOGR_SingleFile(options, 'GPKG', callback);
}; };

View File

@ -68,6 +68,7 @@ describe('geopackage query', function(){
assert.equal(err, null); assert.equal(err, null);
assert.equal(row.cartodb_id, 1); assert.equal(row.cartodb_id, 1);
assert.equal(row.name, 'Hawai'); assert.equal(row.name, 'Hawai');
assert.equal(row.fid, undefined);
done(); done();
}); });
assert.notEqual(dqr, undefined); assert.notEqual(dqr, undefined);