mapnik/mapnik — pull request #1337 by rjw57 (2012-07-21 17:10:56+00:00)
Title: Request for comments: python: a new plugin to use arbitrary Python as a data source

This pull request is a RFC about whether this feature would be useful. It is *not* yet ready for merging. (Or, perhaps, it is but it needs a lot of work before it should be built by default. The current issues are noted in the README.md file.) I've posted to the mailing list about this as well since I'm not sure which is the best place to discuss feature requests like this.

This plugin allows you to write data sources in the Python programming language.
This is useful if you want to rapidly prototype a plugin, perform some custom
manipulation on data or if you want to bind mapnik to a data source which is most
conveniently accessed through Python. Finally it is of utility if you have theoretically 'infinite' data sources which can be rendered in finite areas. The README.md file associated with this patch has the example of a data source which consists of infinite concentric circles centred on a point.

Mapnik already has excellent Python bindings but they only directly support
calling *into* mapnik *from* Python. This forces mapnik and its input plugins to
be the lowest layer of the stack. The role of this plugin is to allow mapnik to
call *into* Python itself. This allows mapnik to sit as rendering middleware
between a custom Python frontend and a custom Python datasource. This increases
the utility of mapnik as a component in a larger system.

Please see the README.md file for more information.