1.0.2 • Published 5 years ago

map-tiles-crawler v1.0.2

Weekly downloads
14
License
BSD-2-Clause
Repository
github
Last release
5 years ago

Map Tiles Crawler

Memory efficient and synchronous downloader of map tiles. Allows for a fast and easy approach to make map tiles (from a WMS) available offline.

Install

npm i map-tiles-crawler (-g for global install)

Usage from CLI

mtc --url http://maps.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg \
    --target ./.tmp/ \
    --level 18 \
    --topLeft 47.46465597:11.91329956 \
    --bottomRight 47.46140645:11.9243288 \
    --wait 100

Usage (programmatic)

var crawler = require('map-tiles-crawler');
crawler.crawl({
    url: 'http://maps.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg' ,
    targetFolder: './.tmp' ,
    level : 18 ,
    topLeft: [47.46575119, 11.92384601] ,
    bottomRight: [47.46068834, 11.91423297] ,
    wait: 100 ,
    progress : (tile) => { // callback after tile download } ,
    success : () => { // callback after all tiles are downloaded } ,
    error : (tile) => { // callback if a tile couldn't be downloaded }
});

Params

ParamDescription
urlthe url of the WMS endpoint with coordinates as placeholders in the url e.g.: http://maps.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg
targetFolderThe filesystem folder, where all files will be downloaded to
levelThe zoom level for the crawling
topLeftthe top-left geo-coordinate of the area to crawl as array
bottomRightthe bottom-right geo-coordinate of the area to crawl as array
waitwaiting time after each tile download, this allows for throttling the downloads
progresscallback after each tile download
successcallback after all tiles were downloaded successfully
errorcallback after a error happened
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

7 years ago