So, I did some cleanups etc. and the current state of the transformation
plugins code doesn't look too bad. But there are some questions that turned
up:
* What about not only changing existing attributes, but adding new attributes
(or remove existing ones)? I tried this, but get an error message. It seems
I can add a new attribute to the feature (with put_new()), but the expression
parser complains that this attribute is not in the datasource. Adding new
attributes could be very useful, I think we should support this. Either we
have to somehow associate the information with attributes are available
with the transformations and change existing code to check that instead of
the datasource. Or we have to ignore all this and just dynamically see
what attributes are there and just return empty string or whatever when
non-existing attributes are accessed.
* What about geometries on vector layers? I have only manipulated attributes
so far? There are already other places in Mapnik that do geometry
transformations. Maybe they should be in these plugins, too? Instead?
Do we need extra checks, say that datasource, transformation, style all
fit together with regards to the geometry type?
* What about raster layers? I haven't taken them into account at all. Do
we need transformation plugins for raster layers? Maybe have two different
classes of transformations, one for vector and one for raster layers?
Should the code make sure that you can't add a raster transformation to
a vector layer or so?
Any thoughts on these issues?