[MAPSERVER-USERS] Problems calculating MAXSCALES
Rob
gis at vanbooth.com
Wed Aug 13 06:53:29 PDT 2008
2008/8/13 Tamas Szekeres <szekerest at gmail.com>:
> You can refer to the msCalculateScale in mapscale.c to see how the
> scaledenom is calculated by mapserver:
>
> center_y = (extent.miny+extent.maxy)/2.0;
> md = (width-1)/(resolution*msInchesPerUnit(units, center_y)); /*
> remember, we use a pixel-center to pixel-center extent, hence the
> width-1 */
> gd = extent.maxx - extent.minx;
> *scale = gd/md;
>
Thanks Tamas. From plugging in my numbers into this formula, it looks
like this could be where we are getting the discrepancy.
If I change the (width-1) to be width, then I get scale figures that
correspond to what I would expect, and what the ESRI GIS Clients
hitting my WMS service seems to think that the scale should be. From
the dates in TRAC it certainly looks like this was changed between
4.8.3 and 5.0.2.
So, I guess my questions now are -
1) Is this a bug?
2) How can I make it work again, short of hacking mapscale.c myself to
remove the -1 in the md calculation? Checking TRAC (Change 6529), it
looks like I would have to hack the maptemplate.c as well. FWIW, I'm
not using the cgi interface, but am using shp2img and mapscript.
6529 seems to have come about to fix Bug #2166 -
http://trac.osgeo.org/mapserver/ticket/2166
Any advice VERY greatfully accepted
Rob
More information about the MapServer-users
mailing list