Grandine: Vector Tiles, Summary July 2017

Continuation of the documentation of my Prototype Fund related work. Previous summaries: March, April, May, June

This month I concentrated on picking up some loose ends and refining the both command line tools spatialize and tiler.

The other hard thing in programming

I’ve been reminded that there are already tools that are called “tiler”. I don’t intend “tiler” to be a canonical name for this tool, but as it isn’t production ready yet I didn’t want to invest too much time into a good name. Nevertheless I consider “tiler” and “spatialize” to be subcommands of grandine. So it actually might be called grandine-tiler in the future. But this is not set.


Spatialize is the tool for converting OSM data into a geospatial data format with proper geometries (collects ways and relations and assembles polygons, if specified) and feature and layer name mapping. For starters I implemented parts of the OpenMapTiles Vector Tile Schema.


Tiler has been rather slow if it needed to cover large areas, because it has been seeking in potentially large lists. With newly introduces changes it builds a rtree for fast geometry lookup if a lot of geometries are present and/or a lot of tiles need to be generated. Furthermore the work is now spread across a number workers, so it is able to utilize all CPU cores.

lib/spatial changes

The internal spatial library has been refined, but also received a new feature: It is now able to simplify lines using the Douglas-Peucker algorithm.


Broken Clipping

A thing that gets increasingly frustrating is the polygon clipping algorithm which still does not work correctly in some cases. If you have any insight into this and maybe have already implemented Weiler-Atherton I would love to hear from you.

Time ticking

There is one month of funding left for the project, so I am trying to push out a few more cool things, because on August 31st it’s demo time!