Hi,

Rahkonen Jukka wrote:
> Actually I am after out-of-the-box solution, precompiled binaries,
> Windows installer and so, but I may be alone with my wish here.  I
> can render maps from OSM data with demo script generate_image.py, but
> they are a bit hard to use in GIS applications because the map area
> that is really rendered do not suit the LL coordinates that
> generate_image.py takes as input.  Now I am capturing the real
> coordinates from PostGIS log where SQL requests which are sent by
> Mapnik are recorded. 

A while ago a patch of mine has been incorporated that allows you to set 
a property on the map object, forcing it to change the size of the map 
image instead while sticking to the exact bbox you requested 
("setAspectFixMode" method on map). This will then result in an image of 
slightly different width or height than you requested, and you have to 
scale that image to the original request size. Artem has pointed out 
that Mapnik supports image resizing, giving this example:

ImageData32 source(100,100);
ImageData32 target(200,120);
scale_image<ImageData32>(target,source); // stretch source to fit taget

Unfortunately both the "setAspectFixMode" and the image resizing are 
probably not yet in the python bindings so they're only available from 
C. I have used this in my own Mapnik WMS implementation which is written 
in C but unfortunately not ready for prime time yet - it works but I 
have to brush up the code a bit to release the source.

Bye
Frederik

-- 
Frederik Ramm  ##  eMail [EMAIL PROTECTED]  ##  N49°00'09" E008°23'33"
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to