[Geomoose-users] Possible Bug / Issue with the scale - geomoose 2.2?

Brent Fraser bfraser at geoanalytic.com
Thu Jan 12 15:55:31 EST 2012


Mark,

   The glib answer is "don't measure on the screen".  Now for the long 
answer....

   I did an evaluation of the scale in GeoMoose v1.6.1 a couple of years 
ago and found the same problem as you.  Back then (before OpenLayers), 
there was a GeoMoose config setting called MAP_PIXELS_PER_INCH with a 
default setting of 72.  When I adjusted it to my screen's dpi the scale 
was fine.  I expect there is a similar setting in OpenLayers 
(DOTS_PER_INCH?).  But the problem is you can't depend on a monitor 
having a particular dpi (the browser can look it up though).  Here's 
some of the chatter from Sept 2009 (it that email archived somewhere?):

  I'm not really too concerned about the map scale on the screen,
but I wanted to make sure I understood how Mapserver/Geommoose/FPDF was scaling
the images (since the printed scale is very important).

So the first step is to get the screen scale close:

    Measuring the boxes in the link you provided below (https://gis.ci.stpaul.mn.us/10in-test.html), I saw that they were 5%
too big (the 10cm box measured 10.5cm).  I looked up the "pixel pitch" of my
monitor (0.281 mm/pixel), calculated the dpi (90.391), set that value (it was
originally set to 96 dpi) in the Display (Control
panel->display->settings->advanced->general), rebooted. ... Perfect!

    Now to measure my graticule.  With "MAP_PIXELS_PER_INCH = 72" in the Geomoose
config.js file, the grid spacing was about 20% too small; not good.  I changed
my site settings from "MAP_PIXELS_PER_INCH = 72" to MAP_PIXELS_PER_INCH =
90.391; ... Perfect!


The bottom line is, while most (all?) monitor drivers dpi setting may be off,
Geomoose would be better off doing the calculation as Bob pointed out below,
rather than "hard-coding" it in the site settings.

    Now I need to look at the printed map scale process...

==================================================================

    To sum up:

1. Printing to Scale
--------------------
    I made some mods to v1.6.1 to pass the value of the ScaleBox to the PHP
printing system, and added some code to re-calc the extents of the map portion
of the page.   It seems to work well.  If others are interested, I can talk with
Dan to get the changes integrated into geomoose-trunk (AKA v1.6.1+).   Some
parts may even be useful for GM v2.

2. Map to Scale on the Screen
-----------------------------
    There's no need to adjust your display driver DPI setting, just set the
MAP_PIXELS_PER_INCH value in Geomoose's config.js and you'll get a map displayed
exactly to scale.  However, this value will be used for all client screens (and
they likely all have different DPI), so unless one of your users complains,
don't bother.

3. Better Screen Scale
----------------------
    A low priority enhancement for GM v2 would be to have the JavaScript
calculate the screen resolution (see Bob's earlier posting in this thread) to
get the screen scale to within 5%-ish (instead of the current 20% to 30%).



Best Regards,
Brent Fraser


On 1/12/2012 12:47 PM, Mark Volz wrote:
> Hello,
> I noticed that the text on the scale dropdown is incorrect.  For 
> example, I measured 1 foot on my screen, which measured out to be 1200 
> feet on the map; which works out to be a scale of 1:1200.  The stated 
> scale on the textbox on the bottom of the screen reported that the 
> scale is 1:864 not 1:1200, which it should be.  I noticed that 
> 864/1200 is .72, which mapserver assumes a 72 DPI, so I don't know if 
> that has something to do with the scale being incorrect.
> This bug / issue is on all of many of the 2.2 sites that I are out there.
> Thanks
> Mark Volz
> GIS Specialist
>
>
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geomoose-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20120112/b5589df3/attachment.html


More information about the Geomoose-users mailing list