contextily icon indicating copy to clipboard operation
contextily copied to clipboard

[ENH] Add support for local XYZ tiles and `.mbtiles` files

Open darribas opened this issue 5 years ago • 0 comments

It'd be great if the user could pass either:

  1. the path to a local folder storing tiles in the XYZ format (the one we currently support over the wire) and contextily was able to render them as well.
  2. the path to an .mbtiles file with raster tiles and this was supported.

From a technical point of view, I think 1. should be relatively straight forward, we'd have to catch whether the url is http (then send to requests) or local and, if the latter, read the files locally. The logic for querying and merging them should be exactly the same. For 2. we'd also need to translate the url into a SQL query to retrieve the files from the SQLite DB.

This has been proposed in the past in different variations, this might also help in those directions. I originally didn't realise how helpful this can be but, given QGIS provides an easy way to create XYZ tiles since 3.8, I could see how folks might want to create their own particular basemap and use it in several contexts serving it "locally".

What do people think? Whichever way, not to start implementing until #109 is done and dusted :)

darribas avatar Jan 24 '20 13:01 darribas