jawg / mbtiles-generator

Node.js mbtiles generator API/CLI to easily generate an MBTile using a remote tile-server
Other
40 stars 9 forks source link

Failing to download tiles from OpenTopoMap #1

Open mogensen opened 6 years ago

mogensen commented 6 years ago

Hi,

First of, great project! Very easy to use and awesome with the docker container!

I am trying to generate a mbtiles file for opentopomap for using when hiking. I beleve that the following command should work for this:

docker run -d -p 2999:2999 -e "APP_MODE=server" -e "TILESERVER_TYPE=osm" -e "TILESERVER_ENDPOINT=https://b.tile.opentopomap.org/{z}/{x}/{y}.png" -e "APP_TIMEOUT=300" -e "APP_MINZOOM=3" -e "APP_MAXZOOM=17" -e "APP_MAXAREA=16" mapsquare/mbtiles-generator-server

But what ever I do to try to generate the mbtiles files, they always end up being only 3kb, with no images in.

I think that the problem lies in that the opentopomap server demands https and not http as all the others servers I have used, that works.

I know that this is a fairly old project, but I would love to ba able to use it to create maps for hiking.

Thanks Frederik Mogensen

maratismailov commented 3 years ago

That is because the app uses http.get method in app/service/mbtiles-generator-service.js. Import https instead of http and use https.get(). Keep in mind that this can lead to violation of OSM usage policy (https://operations.osmfoundation.org/policies/tiles/) "Bulk downloading is strongly discouraged. Do not download tiles unnecessarily. In particular, downloading an area of over 250 tiles at zoom level 13 or higher for offline or later usage is forbidden". Nevertheless you can use alternative tiles provider or host your own.