On Apr 2, 2010, at 12:11 PM, Eric France wrote:

Dane,

Thanks for the pointers, I'll dig into them.


you are welcome.

I think the annotation you are pondering would be an excellent addition to Mapnik, for myself and anyone else who has moved beyond the "feeding-tiles-to-OpenLayers" feature of their mapping application, and needs complete printable map images for reporting and document production.

yep. the pressure is mounting. For a few years now I and others have solved these issues through programmatic tools, which is powerful and rewarding. But at the end of the day, friendly ways to do it will be welcome I think by all. Just a tricky thing to design right. Thanks goodness the Mapnik community is so wicked smart :)


- dane





Eric


From: Dane Springmeyer <[email protected]>
To: Eric France <[email protected]>
Cc: Mapnik Users <[email protected]>
Sent: Fri, April 2, 2010 2:36:20 PM
Subject: Re: [Mapnik-users] Layer In Pixel Coordinates?

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

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to