Home

Awesome

pre-commit

tilequeue

A tile generator, used by itself for asyncronous tile generation or with tileserver for serving tiles.

Installation

We recommend following the vector-datasource installation instructions.

Note: Installation has been tested using Python 2.7 and results with other versions may vary.

In addition to the dependencies in requirements.txt, tileserver requires

These can be installed on Debian-based systems with

sudo apt-get install libpq-dev libgeos-c1v5

Then install the python requirements with

pip install -Ur requirements.txt

Then:

python setup.py develop

Coanacatl

Note that if you want to configure the coanacatl format (really an alternative MVT driver), you will need to install the coanacatl library. This is totally optional and tilequeue will work fine with the regular mvt format, but can provide some robustness and speed improvements.

Configuration

See config.yaml.sample

Layer definitions

To understand the language tilequeue layer definitions, it's best to look at the Tilezen vector-datasource

Running

A list of commands is available by running tilequeue --help. Each command also supports usage information by running tilequeue <CMD> --help. All commands require a configuration file to be passed through the --config argument. A brief summary of commands:

Testing

You can run the tests with the command python setup.py test in the top level source directory.

Code style

We use flake8 to check our source code is PEP8 compatible. You can run this using the command:

find . -not -path '*/.eggs/*' -not -path '*OSciMap4*'  -not -path '*/venv/*' -name '*.py' | xargs flake8

You might find it useful to add that as a git pre-commit hook, or to run a PEP8 checker in your editor.

Profiling

A great way to get a high level view of the time consumed by the code is to run it via python-flamegraph, which produces a profile suitable for processing into an SVG using another tool called FlameGraph. For example, to run a graph for a single tile:

python -m flamegraph -o perf.log `which tilequeue` tile --config config.yaml 10/163/395
flamegraph.pl --title "Tilequeue 10/163/395" perf.log > perf.svg

Note that you may need to add the path to flamegraph.pl from Brendan Gregg's repository if you haven't installed it in your $PATH.

License

Tilequeue is available under the MIT license.