Hi Steve,

I don't feel like you are overlooking anything simple. I've been  
wondering about this issue as well.

As you are finding, map.scale() only gives you the current map scale  
rather than accepting an argument.

I occasionally use map.zoom(factor) to effectively zoom in and out,  
but only after setting an appropriate bounding box with zoom_to_box().

Mapnik does not have any built in function to zoom to a given level  
because it depends on the projection.

For some hints on further understanding the google mercator based zoom  
levels, check out the code in the 'generate_tiles.py' script for a  
start: http://svn.openstreetmap.org/applications/rendering/mapnik

Hope that helps a bit,

Dane



On Oct 22, 2008, at 6:25 AM, Stephen Baker wrote:

>
> Hi everyone,
>
> I am working with Mapnik to render a series of New York City  
> shapefiles.  I
> have a few questions - apologies in advance if I am overlooking  
> something
> simple.
>
> 1. I would like to output an image of an entire shapefile (a city map)
> scaled to a Google Maps zoom/scale level.  (For example  zoom level=8
> scale_denom=2183915.09386).  How do I plug in this value?  I am  
> familiar
> with map.zoom_to_box(bounding_box), map.zoom_all(), and  
> map.zoom(factor).  I
> see map.scale(...) in the documentation and can't figure out the  
> required
> parameters to get this to work - I know that map.scale() gets the  
> scale -
> but is there a way to set the scale with map.scale(..)?
>
> Thanks,
>
> Steve
> -- 
> View this message in context: 
> http://www.nabble.com/Output-image-with-Scale-Denominator-tp20110669p20110669.html
> Sent from the Mapnik - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> 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