Skip to content

Commit

Permalink
Talk about rendering tilesets in README
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Nov 18, 2013
1 parent 17300a6 commit 4fa743a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -65,3 +65,21 @@ an entire copy of the file into the process address space,
which isn't going to work for large files on 32-bit machines.
Performance, especially at low zoom levels, will be much better if the file actually fits
in memory instead of having to be swapped in.

Generating a tileset
--------------------

The <code>enumerate</code> and <code>render</code> programs work together
to generate a tileset for whatever area there is data for. If you do,
for example,

$ enumerate -z14 dirname | xargs -L1 -P8 ./tools/make-tile

<code>enumerate</code> will output a list of all the zoom/x/y
combinations that appear in <code>dirname</code> through zoom 18,
and <code>make-tile</code> will invoke <code>render</code> on each
of these to generate the tiles into <code>tiles/dirname</code>.

The <code>-P8</code> makes xargs invoke 8 instances of <code>make-tile</code>
at a time. If you have a different number of CPU cores, a different number
may work out better.
7 changes: 4 additions & 3 deletions tools/make-tile
@@ -1,5 +1,6 @@
#!/bin/sh

mkdir -p tiles/$1/$2/$3
echo "$1 $2 $3 $4"
./render -t 0 -c FF8800 $1 $2 $3 $4 > tiles/$1/$2/$3/$4.png
dir=$(basename $1)
mkdir -p tiles/$dir/$2/$3
echo "$* -> tiles/$dir/$2/$3"
./render -t 0 -c FF8800 $1 $2 $3 $4 > tiles/$dir/$2/$3/$4.png

0 comments on commit 4fa743a

Please sign in to comment.