Eric,
I've been pondering some kind of 'Annotation' or otherwise screen
pixel coordinated based datasource plugin or feature, so its good to
hear this would be useful as I think it would meet your need in a
generic, simple way perhaps.
But, likely a better approach for most cases and the only easy way now
is to draw directly on the map surface in screen coordinates after
rendering the geographic features on it. Mapnik does not currently
support any way for users to do this after rendering a png/jpeg with
the agg_renderer, but it is quite easy with the cairo_renderer (which
supports png,pdf, svg). You basically render your map to a cairo
context, then draw further on that context with pycairo (of course
learning pycairo from scratch is not terribly easy but its a fairly
good api).
for inspiration see:
http://oliverobrien.co.uk/2010/03/map-adornments-with-cairo/
and also a simple example here that shows drawing a neatline and title:
http://mapnik-utils.googlecode.com/svn/sandbox/testing/cairo_contexts/render_to_context.py
Please post back your progress to the mailing list or the trac wiki!
Dane
On Apr 2, 2010, at 9:16 AM, Eric France wrote:
I want to create a map legend box that will be rendered in a layer
above all the other map layers, using the same shapes mechanism that
I'm using for the geographical information. However, I want to
render the legend box in the same location in the bounding box, no
matter what lat/lon coordinates are being rendered.
It seems that the simplest way would be to have a layer whose
coordinate system is in absolute viewport pixels rather than
whatever projection the GIS shapes are rendered in (I'm using
"+proj=latlong +datum=WGS84" for everything else). Can I change the
proj and datum values to image pixel x,y for a single layer, and if
so, what are the proj and datum keys?
Or is there another way to do this?
Eric
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users