rurseekatze / node-tileserver

A lightweight tileserver based on NodeJS for serving bitmap and vector tiles.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compress vector tiles

rurseekatze opened this issue · comments

It seems that vector rendering is very slow not because of the browser rendering itself, but large vector data tiles.

Another way of reducing tile size is removing tags that are not rendered (such as source=, fixme=, description=, note=) and compressing tags since there are a lot tags that occur at almost every feature (like railway=rail).

And some compression could be achieved by using shorter property names (e.g. 'c' instead of 'coordinates').

Also think of using binary formats like protocol buffers and compressing tiles with e.g. gzip.

I suggest that the tiles are gzipped right at the creation, and also saved this way. This could save some byte of disk space if a compressed file then becomes a disk block smaller, but it is also expected that it's the common case that clients support gzip encoding. The few clients that do not can be served by _de_compressing the data when sending to them, which is less expensive than _com_pressing on the fly.