Fred, Image32 does appear to be a pretty basic type (yes it's a mapnik class). If you're using C++ at all (or have the option to) I'd highly suggest you take a look at CImg...convert the Image32 type to a CImg class and you can do all your processing there. I suggest CImg over other libraries because of its very good documentation and general ease of use. If you're not using C++ then ImageMagick is probably you're best bet.
I'm not familiar with Cairo, but I'll need to figure it out soon since I need to start supporting PDF output. Is there a compelling reason why you aren't just using UMN MapServer? It supports AGG rendering now. matt -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Frederik Ramm Sent: Thursday, June 12, 2008 8:25 PM To: Dave Stubbs Cc: [email protected] Subject: Re: [Mapnik-users] Mapnik reprojection - how? Hi, gettig back to this 4 week old thread, slightly on the dev side now but since it was started on Mapnik-users and I'm not subscribed to anything else, I'll just continue here: Dave Stubbs wrote: > Mapnik will always produce the image at the size you specify, the > actual geographic area covered will be automatically adjusted to fit > by either increasing the bbox height or width. ie: the geo bbox's > aspect ratio is made to fit the image's. You should end up with the > area you requested centred on the image. The WMS specification mandates that in a situation where the geographic area requested doesn't (after projection) have the same aspect ratio as the given width/height, the server must still return exactly the geographic area, stretched or shrunk to fit the width/height. I'm implementing a WMS with mapnik and found it difficult to deal with this. I have looked at the "OGC server" code (a Python/FastCGI based WMS included with Mapnik) and found nothing obvious where the code handles this issue so I *assume* - please correct me if I'm wrong - that it doesn't comply to this aspect of the spec. (I didn't yet manage to get OGC server to run on my machine otherwise I would just have tested it myself.) It is not a hugely important thing since most WMS clients will only ever request a geo bbox that matches the given width/height, but if I have to implement a standard then I want to do it properly and not end up being told that the UMN mapserver is still better than mine. The workflow in my WMS server would probably have to be like this: 1. ask mapnik to render map 2. find out what geographic area mapnik has really included (as opposed to what was requested) 3. cut the extra stuff off of the resulting bitmap 4. scale remainig bitmap to fill requested area I'm currently unsure how to do 2, 3, and 4. I assume that there must be some info structure I could use to achieve 2. I currently use the agg renderer to produce an output image of type Image32; am I right in assuming that this is a special Mapnik image type for which there are no standard bitmap operations like cutting and stretching? That would leave me with the options of either converting it to an ImageMagick or GD compatible structure and use the processing methods available there; or I could perhaps switch to using the cairo renderer which would probably allow me to let cairo do the work for me. Feel free to ignore my babbling, I'll just plod on and see where I get, but if you have any comments on what I'm up to, I'd be glad to hear them. 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 _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

