From d717d26924c74520f7e4dc1f311a81455b9df9de Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 6 Nov 2015 11:38:32 -0800 Subject: [PATCH 1/4] upgrade to upcoming tilelive-bridge refs mapbox/tilelive-bridge#66 --- package.json | 2 +- test/source.test.js | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d75233cb..322285a7 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "mapnik-reference": "~8.5.1", "carto": "0.15.3", "tilelive": "~5.9.0", - "tilelive-bridge": "~2.1.0", + "tilelive-bridge": "https://github.com/mapbox/tilelive-bridge/tarball/master", "tilelive-vector": "~3.5.0", "mapnik-omnivore": "~6.3.0", "gdal": "0.7.0", diff --git a/test/source.test.js b/test/source.test.js index ce5a854f..1f4ad5db 100644 --- a/test/source.test.js +++ b/test/source.test.js @@ -7,6 +7,7 @@ var assert = require('assert'); var upload = require('mapbox-upload'); var tm = require('../lib/tm'); var source = require('../lib/source'); +var mkdirp = require('mkdirp'); var tilelive = require('tilelive'); var testutil = require('./util'); var mockOauth = require('../lib/mapbox-mock')(require('express')()); @@ -352,14 +353,33 @@ test('local: saves source to disk', function(t) { }); test('local: save as tmp => perm', function(t) { - var tmpid = 'tmpsource://' + tm.join(__dirname, '/fixtures-local source'); + var source_dir = tm.join(__dirname, '/fixtures-local source'); + var tmpid = 'tmpsource://' + source_dir; source.info(tmpid, function(err, data) { t.ifError(err); var permid = path.join(tmp, 'source-saveas-' + Math.random().toString(36).split('.').pop()); + mkdirp.sync(permid); + [ + '10m-900913-bounding-box.dbf', + '10m-900913-bounding-box.shx', + '10m-900913-bounding-box.index', + '10m-900913-bounding-box.shp', + '10m_lakes_historic.dbf', + '10m_lakes_historic.shx', + '10m_lakes_historic.index', + '10m_lakes_historic.shp' + ].forEach(function(f) { + //fs.writeFileSync(path.join(permid,f),fs.readFileSync(path.join(source_dir,f))); + }); source.save(_({_tmp:tmpid, id:permid}).defaults(data), function(err, source) { t.ifError(err); t.ok(source); - t.equal(source.data._tmp, false); + if (source) { + t.ok(source.data); + if (source.data) { + t.equal(source.data._tmp, false); + } + } var tmpdir = tm.parse(permid).dirname; t.ok(fs.existsSync(tm.join(tmpdir,'data.yml'))); t.ok(fs.existsSync(tm.join(tmpdir,'data.xml'))); From f69a7724a8c45f996093cefff2a9a547111b2bf8 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 6 Nov 2015 11:42:25 -0800 Subject: [PATCH 2/4] Actually fix test --- test/source.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/source.test.js b/test/source.test.js index 1f4ad5db..f2b6fbc9 100644 --- a/test/source.test.js +++ b/test/source.test.js @@ -369,7 +369,7 @@ test('local: save as tmp => perm', function(t) { '10m_lakes_historic.index', '10m_lakes_historic.shp' ].forEach(function(f) { - //fs.writeFileSync(path.join(permid,f),fs.readFileSync(path.join(source_dir,f))); + fs.writeFileSync(path.join(permid,f),fs.readFileSync(path.join(source_dir,f))); }); source.save(_({_tmp:tmpid, id:permid}).defaults(data), function(err, source) { t.ifError(err); From fcb4c253f2d11572754a6e990912d10366b0a497 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 6 Nov 2015 12:34:27 -0800 Subject: [PATCH 3/4] update expected output for mbtiles size --- test/source.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/source.test.js b/test/source.test.js index f2b6fbc9..0f6a9c58 100644 --- a/test/source.test.js +++ b/test/source.test.js @@ -483,7 +483,7 @@ test('source.mbtilesExport: verify export', function(t) { src._db.get('select count(1) as count, sum(length(tile_data)) as size from tiles;', function(err, row) { t.ifError(err); t.equal(row.count, 5461); - t.equal(row.size, 377696); + t.equal(row.size, 377704); check([ [0,0,0], [1,0,0], From 143e9fcc24d24f1ef42e327684842ec9fa7f35f5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 10 Nov 2015 16:19:09 -0800 Subject: [PATCH 4/4] upgrade tl-bridge and mapnik-om to latest --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 322285a7..2647eff1 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ "mapnik-reference": "~8.5.1", "carto": "0.15.3", "tilelive": "~5.9.0", - "tilelive-bridge": "https://github.com/mapbox/tilelive-bridge/tarball/master", + "tilelive-bridge": "~2.2.1", "tilelive-vector": "~3.5.0", - "mapnik-omnivore": "~6.3.0", + "mapnik-omnivore": "~6.3.2", "gdal": "0.7.0", "abaculus": "1.2.1", "mapbox-machine-styles": "2.3.1",