[OSM-dev] Announcing Golang bindings for mapnik

Fabian Wickborn fabian at wickborn.net
Wed Dec 18 18:26:54 UTC 2013


Hi OSM-dev readers,

I would like to introduce my Go bindings package for Mapnik.

The source code as well as some demo code is available at
http://github.com/fawick/go-mapnik under a BSD-style license.

So far, the functionality of the package is a small subset of Mapniks
features, as it uses the mapnik C API
(http://github.com/springmeyer/mapnik-c-api) and not the C++ API
directly. This may change, however, as I need to explore different ways
to interface C++ and Go directly without using C code and Cgo.

Nevertheless, the bindings come with 
- a fully working Go port of OSM's own generate_tiles.py
- an efficient TileServer for generating and HTTP-serving tiles based on
  one or more different mapnik stylesheets,
- a MBTiles-1.2-compatible Sqlite DB that is currently used by the 
  TileServer for caching the generated tiles (multiple layers can be 
  cached, too).

Especially the TileServer is pretty handy, as it allows you to easily
add a on-demand tile layer to your openlayers/leafletjs application.

I am using the package under Windows and Linux, but it should work just
fine on MacOS as well. However, on Windows, I restricted myself to the
32-bit builds (Go windows/386), as I simply used the Windows 32 bit SDK
from the Mapnik webpage http://mapnik.org/download/. The package uses an
intermediate C DLL on Windows to allow linking MinGW compiled code
against thre MSVC-based Mapnik SDK. I have 

Currently I have no plans to add more of the Mapnik API to the package,
as that would require adding those API calls to the mapnik-c-api first,
and the current feature set is sufficient for my present-day
applications.

However I plan to maintain the bindings packages and to recreated any new
contributions to the Mapnik C API for go-mapnik package. Of course I am
happy to receive pull requests in case you want make any contributions
to the package bindings directly. 

Fabian



More information about the dev mailing list