mapnik/mapnik — pull request #2006 by nmichaud (2013-09-15 14:43:10+00:00)
Title: Implement the python datasource in the python bindings

This is mostly copied from the python plugin. The benefit to this approach is that the datasource object can be constructed in the python script and passed into the mapnik api. So, for example, in the concentric-circles example at the bottom of https://github.com/mapnik/mapnik/wiki/Python-Plugin, you can do this instead:

```python
if __name__ == '__main__':
m = mapnik.Map(640, 320)

m.background = mapnik.Color('white')
s = mapnik.Style()
r = mapnik.Rule()
r.symbols.append(mapnik.LineSymbolizer())
s.rules.append(r)
m.append_style('point_style',s)

######## This part is different
layer = mapnik.Layer('python')
datasource = CircleDatasource(centre_x=4, centre_y=50)
layer.datasource = mapnik.Python(datasource)
...
```

This means that later on you can change the values of centre_x and centre_y and the they will be reflected in the new map.