Skip to content

Commit b746263

Browse files
committed
docs
1 parent 08d17df commit b746263

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ There is no cloud, just dedicated servers. The HTTPS server is nginx on Ubuntu.
5656

5757
Production-quality hosting of 300 million tiny files is hard. The average file size is just 450 byte. Dozens of tile servers have been written to tackle this problem, but they all have their limitations.
5858

59-
The original idea of this project is to avoid using tile servers altogether. Instead, the tiles are directly served from Btrfs partition images + hard links using an optimised nginx config. I wrote [extract_mbtiles](scripts/tile_gen/extract_mbtiles) and [shrink_btrfs](scripts/tile_gen/shrink_btrfs) scripts for this very purpose.
59+
The original idea of this project is to avoid using tile servers altogether. Instead, the tiles are directly served from Btrfs partition images + hard links using an optimised nginx config. I wrote [extract_mbtiles](scripts/tile_gen/scripts/extract_mbtiles.py) and [shrink_btrfs](scripts/tile_gen/scripts/shrink_btrfs.py) scripts for this very purpose.
6060

6161
This replaces a running service with a pure, file-system-level implementation. Since the Linux kernel's file caching is among the highest-performing and most thoroughly tested codes ever written, it delivers serious performance.
6262

@@ -91,7 +91,7 @@ _note: Tile generation is 100% optional, as we are providing the processed full
9191

9292
The `tile_gen` script downloads a full planet OSM extract and runs it through Planetiler.
9393

94-
The created .mbtiles file is then extracted into a Btrfs partition image using the custom [extract_mbtiles](scripts/tile_gen/extract_mbtiles) script. The partition is shrunk using the [shrink_btrfs](scripts/tile_gen/shrink_btrfs) script.
94+
The created .mbtiles file is then extracted into a Btrfs partition image using the custom [extract_mbtiles](scripts/tile_gen/scripts/extract_mbtiles.py) script. The partition is shrunk using the [shrink_btrfs](scripts/tile_gen/scripts/shrink_btrfs.py) script.
9595

9696
Finally, it's uploaded to a public Cloudflare R2 bucket using rclone.
9797

@@ -111,10 +111,9 @@ See [self hosting docs](docs/self_hosting.md).
111111

112112
### Full planet downloads
113113

114-
You can directly download the processed full planet runs on the following URLs:
114+
You can directly download the processed full planet runs on the following URL patterns:
115115

116-
https://planet.openfreemap.com/20240607_232801_pt/tiles.mbtiles // 89 GB, mbtiles file
117-
https://planet.openfreemap.com/20240607_232801_pt/tiles.btrfs.gz // 86 GB, Btrfs partition image
116+
https://planet.openfreemap.com/20240607_232801_pt/tiles.btrfs.gz // 86 GB
118117

119118
Replace the `20240607_232801_pt` part with any newer run, from the [index file](https://planet.openfreemap.com/index.txt).
120119

scripts/tile_gen/tile_gen.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ def make_tiles(area):
2525
Generate tiles for a given area
2626
"""
2727

28-
# run_planetiler(area)
29-
make_btrfs(Path('/data/ofm/tile_gen/runs/monaco/20240826_230406_pt'))
28+
run_folder = run_planetiler(area)
29+
make_btrfs(run_folder)
30+
# make_btrfs(Path('/data/ofm/tile_gen/runs/monaco/20240826_230406_pt'))
3031

3132

3233
@cli.command()

scripts/tile_gen/tile_gen_lib/extract.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def make_btrfs(run_folder: Path):
6666
stderr=err,
6767
)
6868

69+
os.unlink('tiles.mbtiles')
70+
6971
shutil.copy('mnt_rw/extract/osm_date', '.')
7072

7173
# process logs
@@ -122,15 +124,13 @@ def make_btrfs(run_folder: Path):
122124
os.unlink('image.btrfs')
123125
shutil.move('image2.btrfs', 'tiles.btrfs')
124126

125-
# parallel gzip
127+
# parallel gzip (pigz)
126128
subprocess.run(['pigz', 'tiles.btrfs', '--fast'], check=True)
127129

128-
# logs
130+
# move logs
129131
Path('logs').mkdir()
130132
for pattern in ['*.log', '*.txt']:
131133
for file in Path().glob(pattern):
132134
shutil.move(file, 'logs')
133135

134136
print('extract_btrfs.py DONE')
135-
136-
return run_folder
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
## Self-hosting
22

3-
You can also download our processed planet MBTiles and Btrfs images if you want to self-host yourself. Details can be found on [GitHub](https://github.com/hyperknot/openfreemap).
3+
You can also download our processed full planet Btrfs images if you want to self-host yourself. Details can be found on [GitHub](https://github.com/hyperknot/openfreemap).
4+

0 commit comments

Comments
 (0)