mapbox / node-mbtiles

mbtiles utility, renderer, and storage backend for tilelive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue while running using tilelive-copy and and MBTiles

carlos-mg89 opened this issue · comments

Hi,

Previously, I had a machine and I didn't have any troubles with node-mbtiles, however, now that I'm trying in a new machine I'm not getting through it successfully.

I've installed tilelive and node-mbtiles by running:
sudo npm install tilelive
npm install @mapbox/mbtiles

This is the output of both commands:

tilelive

sudo npm install tilelive
npm WARN deprecated tilelive@5.12.3: This module has moved: please install @mapbox/tilelive instead
npm WARN deprecated sphericalmercator@1.0.5: This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead
npm WARN deprecated queue-async@1.0.7: renamed to d3-queue
npm WARN saveError ENOENT: no such file or directory, open '/home/carlos/workspace/osm-pbf-generator/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/carlos/workspace/osm-pbf-generator/package.json'
npm WARN osm-pbf-generator No description
npm WARN osm-pbf-generator No repository field.
npm WARN osm-pbf-generator No README data
npm WARN osm-pbf-generator No license field.

+ tilelive@5.12.3
added 13 packages from 20 contributors and audited 861 packages in 1.401s
found 0 vulnerabilities

mapbox/mbtiles

npm install @mapbox/mbtiles

> sqlite3@4.0.6 install /home/carlos/workspace/osm-pbf-generator/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[sqlite3] Success: "/home/carlos/workspace/osm-pbf-generator/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node" is installed via remote
npm WARN saveError ENOENT: no such file or directory, open '/home/carlos/workspace/osm-pbf-generator/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/carlos/workspace/osm-pbf-generator/package.json'
npm WARN osm-pbf-generator No description
npm WARN osm-pbf-generator No repository field.
npm WARN osm-pbf-generator No README data
npm WARN osm-pbf-generator No license field.

+ @mapbox/mbtiles@0.10.0
added 117 packages from 113 contributors and audited 164 packages in 2.508s
found 0 vulnerabilities

I understand that the warnings aren't an issue here. So I've continued to use an script it worked fine in my previous setup. It's this one:

tilelive-copy --minzoom=0 --maxzoom=14 --bounds="$(perl poly2bb.pl countries/ES/348981.poly)" countries/ES/ES.mbtiles countries/ES/348981.mbtiles

And it throws an error which sounds like tilelive isn't aware of the recently installed node-mbtiles package:

/usr/local/lib/node_modules/tilelive/bin/tilelive-copy:100
        if (err) throw err;
                 ^

Error: Invalid tilesource protocol: mbtiles:
    at Object.tilelive.load (/usr/local/lib/node_modules/tilelive/lib/tilelive.js:95:25)
    at /usr/local/lib/node_modules/tilelive/lib/tilelive.js:336:18
    at pop (/usr/local/lib/node_modules/tilelive/node_modules/queue-async/queue.js:24:14)
    at Object.defer (/usr/local/lib/node_modules/tilelive/node_modules/queue-async/queue.js:55:11)
    at Object.tilelive.copy (/usr/local/lib/node_modules/tilelive/lib/tilelive.js:334:36)
    at copy (/usr/local/lib/node_modules/tilelive/bin/tilelive-copy:99:14)
    at Object.<anonymous> (/usr/local/lib/node_modules/tilelive/bin/tilelive-copy:69:1)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)

Could anyone help? I'm definitely lost and haven't found information on how to fix this.

Apparently, after this project was moved, the documentation doesn't seem to be reliable anymore. To make it work with tilelive-copy, I had to install it using npm install -g mbtiles as it's said in https://github.com/mojodna/tessera

After that, running tilelive-copy worked like a charm.