posm / OpenMapKitAndroid

http://openmapkit.org
BSD 3-Clause "New" or "Revised" License
128 stars 38 forks source link

wiki mbtiles instructions don't work #68

Closed danbjoseph closed 9 years ago

danbjoseph commented 9 years ago

with up to date modules, the following error is thrown

» tl copy -z 13 -Z 19 -b "90.375853 23.700965 90.437307 23.754632" 'http://c.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png' mbtiles://./dhaka.mbtiles
Coordinate placeholders missing; assuming http://c.tile.openstreetmap.fr/hot/%7Bz%7D/%7Bx%7D/%7By%7D.png is a TileJSON endpoint (tilejson+).
/usr/local/lib/node_modules/tl/lib/commands/copy.js:71
          throw err;
                ^
Error: Tileset does not exist
    at /usr/local/lib/node_modules/tilejson/lib/tilejson.js:64:37
    at done (/usr/local/lib/node_modules/tilejson/lib/tilejson.js:216:13)
    at error (/usr/local/lib/node_modules/tilejson/node_modules/get/lib/index.js:294:9)
    at Get.<anonymous> (/usr/local/lib/node_modules/tilejson/node_modules/get/lib/index.js:299:25)
    at Get.handleClientRequest (/usr/local/lib/node_modules/tilejson/node_modules/get/lib/index.js:153:29)
    at ClientRequest.g (events.js:199:16)
    at ClientRequest.emit (events.js:107:17)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:426:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23)
    at Socket.socketOnData (_http_client.js:317:20)
hallahan commented 9 years ago

There is a new version of tl out, maybe try updating?

sudo npm update -g tl

Looking at what you put, it should work... Could you try this?

tl copy -z 13 -Z 21 -b '90.415163 23.784402 90.425184 23.794848' 'http://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png' mbtiles://./hotel.mbtile
danbjoseph commented 9 years ago

same error. packages and versions as follows:

» npm -g list --depth=0
/usr/local/lib
├── bower@1.4.1
├── forever@0.14.2
├── learnyounode@2.5.2
├── mbtiles@0.8.0
├── node-gyp@2.0.1
├── npm@2.12.1
├── rebuild@0.1.2
├── tilejson@0.13.0
├── tilelive@5.8.2
├── tilelive-http@0.7.0
├── tl@0.4.0
├── topojson@1.6.19
├── turf@2.0.2
└── wiredep@2.2.2
danbjoseph commented 9 years ago

on the EC2 instance that can generate mbtiles

/usr/local/lib
├── mbtiles@0.8.0
├── npm@1.4.28
├── tilejson@0.13.0
├── tilelive@5.7.1
├── tilelive-http@0.7.0
└── tl@0.3.4
hallahan commented 9 years ago

Hmm... Any thoughts @mojodna?

mojodna commented 9 years ago

Bizarre. @danbjoseph what shell are you using? Try double quoting (or removing) the http://... string.

danbjoseph commented 9 years ago

zsh. double quoting the url string doesn't change anything. what do you mean by remove?

mojodna commented 9 years ago

Try without quoting http://c.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png

I think zsh is encoding the braces before passing them in as args.

mojodna commented 9 years ago

Alternately, try escaping the braces (\{, \})...

mojodna commented 9 years ago

Or even noglob tl copy -z 13 -Z 19 -b "90.375853 23.700965 90.437307 23.754632" 'http://c.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png' mbtiles://./dhaka.mbtiles

danbjoseph commented 9 years ago

the noglob one and all of these returned the same error:

tl copy -z 13 -Z 21 -b '90.415163 23.784402 90.425184 23.794848' http://a.tile.openstreetmap.fr/hot/\{z\}/\{x\}/\{y\}.png mbtiles://./hotel.mbtiles
tl copy -z 13 -Z 21 -b '90.415163 23.784402 90.425184 23.794848' http://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png mbtiles://./hotel.mbtiles
tl copy -z 13 -Z 21 -b '90.415163 23.784402 90.425184 23.794848' "http://a.tile.openstreetmap.fr/hot/\{z\}/\{x\}/\{y\}.png" mbtiles://./hotel.mbtiles
tl copy -z 13 -Z 21 -b '90.415163 23.784402 90.425184 23.794848' "http://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png" mbtiles://./hotel.mbtiles

also tried switching to bash instead of zsh same error

mojodna commented 9 years ago

Weird! I'll keep poking.

mojodna commented 9 years ago

@danbjoseph what version of Node on the one that isn't working?

danbjoseph commented 9 years ago

v0.12.6

mojodna commented 9 years ago

Great, that's the missing piece. I'm able to reproduce now.

mojodna commented 9 years ago

Underlying cause: https://github.com/joyent/node/issues/25636

danbjoseph commented 9 years ago

wizard

mojodna commented 9 years ago

@danbjoseph: updating tilelive-http to v0.8.0 should solve the problem (npm upgrade -g tilelive-http).

danbjoseph commented 9 years ago

:+1: thanks @mojodna