home / content / repos

repos: 335372050

This data as json

id node_id name full_name private owner html_url description fork created_at updated_at pushed_at homepage size stargazers_count watchers_count language has_issues has_projects has_downloads has_wiki has_pages forks_count archived disabled open_issues_count license topics forks open_issues watchers default_branch permissions temp_clone_token organization network_count subscribers_count readme readme_html allow_forking visibility is_template template_repository web_commit_signoff_required has_discussions
335372050 MDEwOlJlcG9zaXRvcnkzMzUzNzIwNTA= download-tiles simonw/download-tiles 0 9599 https://github.com/simonw/download-tiles Download map tiles and store them in an MBTiles database 0 2021-02-02T17:37:49Z 2021-05-29T07:22:58Z 2021-02-16T04:19:59Z https://datasette.io/tools/download-tiles 26 9 9 Python 1 1 1 1 0 0 0 0 0 apache-2.0 ["openstreetmap", "mbtiles", "datasette-io", "datasette-tool"] 0 0 9 main {"admin": false, "push": false, "pull": false}     0 1 # download-tiles [![PyPI](https://img.shields.io/pypi/v/download-tiles.svg)](https://pypi.org/project/download-tiles/) [![Changelog](https://img.shields.io/github/v/release/simonw/download-tiles?include_prereleases&label=changelog)](https://github.com/simonw/download-tiles/releases) [![Tests](https://github.com/simonw/download-tiles/workflows/Test/badge.svg)](https://github.com/simonw/download-tiles/actions?query=workflow%3ATest) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/download-tiles/blob/master/LICENSE) Download map tiles and store them in an MBTiles database ## Installation Install this tool using `pip`: $ pip install download-tiles ## Usage This tool downloads tiles from a specified [TMS (Tile Map Server)](https://wiki.openstreetmap.org/wiki/TMS) server for a specified bounding box and range of zoom levels and stores those tiles in a MBTiles SQLite database. It is a command-line wrapper around the [Landez](https://github.com/makinacorpus/landez) Python libary. **Please use this tool responsibly**. Consult the usage policies of the tile servers you are interacting with, for example the [OpenStreetMap Tile Usage Policy](https://operations.osmfoundation.org/policies/tiles/). Running the following will download zoom levels 0-3 of OpenStreetMap, 85 tiles total, and store them in a SQLite database called `world.mbtiles`: download-tiles world.mbtiles You can customize which tile and zoom levels are downloaded using command options: `--zoom-levels=0-3` or `-z=0-3` The different zoom levels to download. Specify a single number, e.g. `15`, or a range of numbers e.g. `0-4`. Be careful with this setting as you can easily go over the limits requested by the underlying tile server. `--bbox=3.9,-6.3,14.5,10.2` or `-b=3.9,-6.3,14.5,10.2` The bounding box to fetch. Should be specified as `min-lon,min-lat,max-lon,max-lat`. You can use [bboxfinder.com](http://bboxfinder.com/) to find these for different areas. `--city=london` or `--country=madagascar` These options can be used instead of `--bbox`. The city or country specified will be looked up using the [Nominatum API](https://nominatim.org/release-docs/latest/api/Search/) and used to derive a bounding box. `--show-bbox` Use this option to output the bounding box that was retrieved for the `--city` or `--country` without downloading any tiles. `--name=Name` A name for this tile collection, used for the `name` field in the `metadata` table. If not specified a UUID will be used, or if you used `--city` or `--country` the name will be set to the full name of that place. `--attribution="Attribution string"` Attribution string to bake into the `metadata` table. This will default to `© OpenStreetMap contributors` unless you use `--tiles-url` to specify an alternative tile server, in which case you should specify a custom attribution string. You can use the `--attribution=osm` shortcut to specify the `© OpenStreetMap contributors` value without having to type it out in full. `--tiles-url=https://...` The tile server URL to use. This should include `{z}` and `{x}` and `{y}` specifiers, and can optionally include `{s}` for subdomains. The default URL used here is for OpenStreetMap, `http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png` `--tiles-subdomains=a,b,c` A comma-separated list of subdomains to use for the `{s}` parameter. `--verbose` Use this option to turn on verbose logging. `--cache-dir=/tmp/tiles` Provide a directory to cache downloaded tiles between runs. This can be useful if you are worried you might not have used the correct options for the bounding box or zoom levels. ## Development To contribute to this tool, first checkout the code. Then create a new virtual environment: cd download-tiles python -mvenv venv source venv/bin/activate Or if you are using `pipenv`: pipenv shell Now install the dependencies and tests: pip install -e '.[test]' To run the tests: pytest <div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><h1><a id="user-content-download-tiles" class="anchor" aria-hidden="true" href="#user-content-download-tiles"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>download-tiles</h1> <p><a href="https://pypi.org/project/download-tiles/" rel="nofollow"><img src="https://camo.githubusercontent.com/82c46313526394b774727137f12ac6fbf6606364edbee19ebd99c951953b04b5/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f646f776e6c6f61642d74696c65732e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/download-tiles.svg" style="max-width:100%;"></a> <a href="https://github.com/simonw/download-tiles/releases"><img src="https://camo.githubusercontent.com/32d363e282d2f95ba1b135630d328b8b61459c3e97b2b4e2fe1ec629be13d80e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73696d6f6e772f646f776e6c6f61642d74696c65733f696e636c7564655f70726572656c6561736573266c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/simonw/download-tiles?include_prereleases&amp;label=changelog" style="max-width:100%;"></a> <a href="https://github.com/simonw/download-tiles/actions?query=workflow%3ATest"><img src="https://github.com/simonw/download-tiles/workflows/Test/badge.svg" alt="Tests" style="max-width:100%;"></a> <a href="https://github.com/simonw/download-tiles/blob/master/LICENSE"><img src="https://camo.githubusercontent.com/1698104e976c681143eb0841f9675c6f802bb7aa832afc0c7a4e719b1f3cf955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667" alt="License" data-canonical-src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" style="max-width:100%;"></a></p> <p>Download map tiles and store them in an MBTiles database</p> <h2><a id="user-content-installation" class="anchor" aria-hidden="true" href="#user-content-installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Installation</h2> <p>Install this tool using <code>pip</code>:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="$ pip install download-tiles "><pre><code>$ pip install download-tiles </code></pre></div> <h2><a id="user-content-usage" class="anchor" aria-hidden="true" href="#user-content-usage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Usage</h2> <p>This tool downloads tiles from a specified <a href="https://wiki.openstreetmap.org/wiki/TMS" rel="nofollow">TMS (Tile Map Server)</a> server for a specified bounding box and range of zoom levels and stores those tiles in a MBTiles SQLite database. It is a command-line wrapper around the <a href="https://github.com/makinacorpus/landez">Landez</a> Python libary.</p> <p><strong>Please use this tool responsibly</strong>. Consult the usage policies of the tile servers you are interacting with, for example the <a href="https://operations.osmfoundation.org/policies/tiles/" rel="nofollow">OpenStreetMap Tile Usage Policy</a>.</p> <p>Running the following will download zoom levels 0-3 of OpenStreetMap, 85 tiles total, and store them in a SQLite database called <code>world.mbtiles</code>:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="download-tiles world.mbtiles "><pre><code>download-tiles world.mbtiles </code></pre></div> <p>You can customize which tile and zoom levels are downloaded using command options:</p> <p><code>--zoom-levels=0-3</code> or <code>-z=0-3</code></p> <p>The different zoom levels to download. Specify a single number, e.g. <code>15</code>, or a range of numbers e.g. <code>0-4</code>. Be careful with this setting as you can easily go over the limits requested by the underlying tile server.</p> <p><code>--bbox=3.9,-6.3,14.5,10.2</code> or <code>-b=3.9,-6.3,14.5,10.2</code></p> <p>The bounding box to fetch. Should be specified as <code>min-lon,min-lat,max-lon,max-lat</code>. You can use <a href="http://bboxfinder.com/" rel="nofollow">bboxfinder.com</a> to find these for different areas.</p> <p><code>--city=london</code> or <code>--country=madagascar</code></p> <p>These options can be used instead of <code>--bbox</code>. The city or country specified will be looked up using the <a href="https://nominatim.org/release-docs/latest/api/Search/" rel="nofollow">Nominatum API</a> and used to derive a bounding box.</p> <p><code>--show-bbox</code></p> <p>Use this option to output the bounding box that was retrieved for the <code>--city</code> or <code>--country</code> without downloading any tiles.</p> <p><code>--name=Name</code></p> <p>A name for this tile collection, used for the <code>name</code> field in the <code>metadata</code> table. If not specified a UUID will be used, or if you used <code>--city</code> or <code>--country</code> the name will be set to the full name of that place.</p> <p><code>--attribution="Attribution string"</code></p> <p>Attribution string to bake into the <code>metadata</code> table. This will default to <code>© OpenStreetMap contributors</code> unless you use <code>--tiles-url</code> to specify an alternative tile server, in which case you should specify a custom attribution string.</p> <p>You can use the <code>--attribution=osm</code> shortcut to specify the <code>© OpenStreetMap contributors</code> value without having to type it out in full.</p> <p><code>--tiles-url=https://...</code></p> <p>The tile server URL to use. This should include <code>{z}</code> and <code>{x}</code> and <code>{y}</code> specifiers, and can optionally include <code>{s}</code> for subdomains.</p> <p>The default URL used here is for OpenStreetMap, <code>http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png</code></p> <p><code>--tiles-subdomains=a,b,c</code></p> <p>A comma-separated list of subdomains to use for the <code>{s}</code> parameter.</p> <p><code>--verbose</code></p> <p>Use this option to turn on verbose logging.</p> <p><code>--cache-dir=/tmp/tiles</code></p> <p>Provide a directory to cache downloaded tiles between runs. This can be useful if you are worried you might not have used the correct options for the bounding box or zoom levels.</p> <h2><a id="user-content-development" class="anchor" aria-hidden="true" href="#user-content-development"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Development</h2> <p>To contribute to this tool, first checkout the code. Then create a new virtual environment:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="cd download-tiles python -mvenv venv source venv/bin/activate "><pre><code>cd download-tiles python -mvenv venv source venv/bin/activate </code></pre></div> <p>Or if you are using <code>pipenv</code>:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="pipenv shell "><pre><code>pipenv shell </code></pre></div> <p>Now install the dependencies and tests:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="pip install -e '.[test]' "><pre><code>pip install -e '.[test]' </code></pre></div> <p>To run the tests:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="pytest "><pre><code>pytest </code></pre></div> </article></div>            

Links from other tables

  • 5 rows from repo in releases
Powered by Datasette · Queries took 1.368ms