From aa5f688407a72d6fe0c0fe13d934b7eecf70069b Mon Sep 17 00:00:00 2001 From: Will White Date: Sat, 13 Dec 2014 11:13:13 -0500 Subject: [PATCH] Query from `map` table with more than one index. mbtiles files often have two indexes on the map table. This doesn't impact our ability to do an optimized query against it for ZXYStream. --- lib/zxystream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zxystream.js b/lib/zxystream.js index 011ef14..4d1d44f 100644 --- a/lib/zxystream.js +++ b/lib/zxystream.js @@ -33,7 +33,7 @@ ZXYStream.prototype._read = function() { if (!stream.table) { return this.source._db.get("select count(1) as count from sqlite_master where type = 'index' and tbl_name = 'map';", function(err, row) { if (err) return stream.emit('error', err); - stream.table = row.count === 1 ? 'map' : 'tiles'; + stream.table = row.count >= 1 ? 'map' : 'tiles'; return stream._read(); }); }