Jay,

Awesome. I've just added to that wiki page with a little info on the . 
28 mm pixel size assumption based on Chris's hint:
http://trac.mapnik.org/wiki/ScaleAndPpi?version=6

Also, last week I added a script to the mapnik-utils sandbox that  
pulls together a variety of python functions I've been collecting to  
help with scripting mapnik printed output.

http://mapnik-utils.googlecode.com/svn/sandbox/print2pixel/

`print2pixel.py` accepts as an argument either a common paper size or  
paper dimensions and units and spits back the pixel dimensions needed  
to create a map at a default 300 ppi/dpi. Feed it optional arguments  
to customize the ppi and a variety of other funky things.

Dane



On Nov 24, 2008, at 10:47 AM, Jay Douillard wrote:

> I've added a page to the trac wiki around this topic
>
> http://trac.mapnik.org/wiki/ScaleAndPpi
>
> Please consider it a first draft!
> ----
> Jay
>
> ----- Original Message -----
> From: "Dane Springmeyer" <[EMAIL PROTECTED]>
> To: "Christopher Schmidt" <[EMAIL PROTECTED]>
> Cc: "Mapnik users mailing-list" <[email protected]>
> Sent: Friday, November 21, 2008 9:21:56 AM GMT -08:00 US/Canada  
> Pacific
> Subject: Re: [Mapnik-users] 300 dpi images with Mapnik?
>
> Chris,
>
> Big thanks for the clarification. I'll take a closer look at the code
> with your description in mind.
>
> Dane
>
>
> On Nov 21, 2008, at 4:00 AM, Christopher Schmidt wrote:
>
>> On Thu, Nov 20, 2008 at 10:52:24PM -0800, Dane Springmeyer wrote:
>>> Isn't DPI just a printing/ink term? I don't think Mapnik's map scale
>>> is DPI dependent.
>>
>> Scale is "map units per unit on paper" -- so, 1:24000 is "one inch in
>> the map is 24,000 inches on the ground", etc.
>>
>> This definition of scale requires you to have some idea of how big
>> "one
>> inch" is in pixels -- which is where DPI calculations come into play.
>> If you are printing at 300 dots per inch, then a 300 pixel wide
>> image is
>> giong to be one inch wide -- therefore the calculations of what
>> 1:24000
>> is changes depending on the assumed output DPI. A map of Cambridge
>> which
>> is one inch across (300dpi) vs. 3.xx inches across (90.833 dpi) is
>> going
>> to have a very large scale diference, sicne "one inch" in the map is
>> much smaller geographic distance in the latter case.
>>
>>> Perhaps I missing something, but the scale is simply calculated as
>>> the
>>> the current map width in geographic units/ pixel width. That would  
>>> be
>>> the same as OpenLayers, right?
>>
>> It's unclear to me how the function you've just shared can relate to
>> the
>> style rules without DPI. Resolutions provided in the config file were
>> provided in scale, the last time I saw them...
>>
>> Regards,
>> -- 
>> Christopher Schmidt
>> MetaCarta
>
> _______________________________________________
> 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