Skip to content

Commit

Permalink
SOI: make the download as mbtiles option easier to use
Browse files Browse the repository at this point in the history
  • Loading branch information
ramSeraph committed Mar 3, 2025
1 parent d521cbf commit ae88c52
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/maps/SOI/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ All the data below is updated monthly
# Get A Copy
The data is also hosted as a mosaic of [pmtiles](https://protomaps.com/docs/pmtiles) files in the [releases](https://github.com/ramSeraph/opendata/releases/tag/soi-latest)

This can be downloaded as local [mbtiles](https://docs.mapbox.com/help/glossary/mbtiles/) by running the following commands:

This can be downloaded as local [mbtiles](https://docs.mapbox.com/help/glossary/mbtiles/) by running the following commands( after installing [uv](https://docs.astral.sh/uv/getting-started/installation/):


```
git clone https://github.com/ramSeraph/opendata.git
cd opendata/maps/SOI/
pip install pmtiles==3.2.0 mercantile==1.2.1 requests==2.30.0
python download_as_mbtiles.py
uv run https://raw.githubusercontent.com/ramSeraph/opendata/refs/heads/master/maps/SOI/download_as_mbtiles.py
```

Expand Down
10 changes: 10 additions & 0 deletions maps/SOI/download_as_mbtiles.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "mercantile",
# "pmtiles",
# "requests",
# ]
# ///

import json
import shutil
import sqlite3
Expand Down Expand Up @@ -175,3 +184,4 @@ def mark_done(stage):
Path(mosaic_file).unlink()
print('done')


0 comments on commit ae88c52

Please sign in to comment.