[Mapnik-users] Output Format

Dane Springmeyer blake at hailmail.net
Sat Oct 18 05:09:45 CEST 2008


I concur with Chris that it seems like you are mixing up what  
TileCache is handling and what is possible with your custom python  

If you are using TileCache with a configuration to read from a mapnik  
xml like:


Then, no, png256 support is not supported. Png256 ( or paletted 8-bit  
png's) are also not yet supported in the mapnik OGCServer, but I agree  
that they are the idea format to use since they look nearly the same  
as 32 bit png at roughly half the size.

But if you are accessing mapnik natively via the python bindings then  
yes, something like:

>> render_to_file(m, map_output,'png256')

should work great to create smaller png's.

You can also do render_to_file(m, map_output,'jpeg')

If you want to render with the Cairo backend then see some examples  


On Oct 17, 2008, at 4:29 AM, Christopher Schmidt wrote:

> On Fri, Oct 17, 2008 at 04:07:16AM -0700, spillocaster wrote:
>> Hi list,
>> I have defined a very nice map with MapNik, which I provide with  
>> TileCache.
>> I used a XML-configuration (based on the
>> http://trac.mapnik.org/wiki/XMLGettingStarted XMLGettingStarted- 
>> Tutorial ).
>> Now I want to change the output format to a paletted PNG with alpha
>> transparency using the 'PNG256'-parameter. The filesize of the  
>> 32bit PNG is
>> a bit too big. Where do I have to define it? In the python script,  
>> in the
>> XML or in TileCache?
> In TileCache; and the answer to "What should I change" is "You can't":
> TileCache doesn't have support for this at this time. (Or rather,  
> "You'd
> need to write a patch.")
>> I tried this:
>> render_to_file(m, map_output,'png256')
>> and I added this:
>> m.save('test.png','png256')
>> to the python script, but no success.
> It's note clear to me what Python script you're changing that you  
> think
> will have an effect on TileCache...
>> Is it also possible to switch the
>> renderer from AGG to CAIRO? I also want to experiment with the  
>> vector output
>> formats.
> Not within TileCache...
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Mapnik-users mailing list
> Mapnik-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/mapnik-users

More information about the Mapnik-users mailing list