Hello Warren,

Yes, generate_tiles.py uses the 'Image' class from Mapnik, which  
supports a fairly limited set of functions:

http://svn.mapnik.org/trunk/docs/api_docs/python/mapnik._mapnik.Image-class.html

However we can add more that are useful. I think of PIL.Image as a  
very similar class that we can borrow functionality from if needed,  
and perhaps you could get what you need working using PIL natively  
right now which would help assess the benefit of eventually folding  
more methods into mapnik.Image.

Here is how to turn a mapnik.Image into a PIL.Image:

 >>> img = mapnik.Image(w, h)
 >> mapnik.render(map, img)
 >> pil_img = PIL.Image.fromstring('RGBA', (w, h), img.tostring())

Dane

On Sep 6, 2009, at 12:56 AM, Warren Vick wrote:

> In the generate_tiles.py script which generates map tiles using  
> Mapnik, what is the image class used? I don't know if this is  
> something internal to Python or an external class imported by  
> Mapnik. I'd like to be able to add a black 1-pixel frame around each  
> map before saving but don't know if the image class has any pixel/ 
> line writing methods.
>
> Regards,
> Warren
> _______________________________________________
> 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