[mapserver-users] Problems calculating MAXSCALES

Rob gis at vanbooth.com
Mon Aug 11 06:47:21 PDT 2008


Hi Guys

This is probably a bit of a schoolboy error, but I'm having real
problems with my latest mapfile and MIN/MAXSCALEDENOMs.

My mapfile contains sections like this....

MAP
 EXTENT 235000 132715 300000 200000
 RESOLUTION 96.00
 UNITS METERS
 SIZE 500 500

PROJECTION
 "init=epsg:27700"
END

LAYER
  MAXSCALEDENOM 500000
  MINSCALEDENOM 0
  NAME 'TEST'
  TILEINDEX "SHAPEFILE"
  TILEITEM "location"
END

Now, my basic maths suggests that if I do a shp2img on this mapfile, I
should get a valid map.  Heres my working

minx=235000
miny=132715
maxx=300000
maxy=200000


pixels per screen meter (ppsm)= ( 100 cm / 2.54 cm ) * resolution of
96 = 3779.527555

Scale = ( ( ( ( maxx - minx) * ppsm ) / imagewidth ) + ( ( ( maxy -
miny) * ppsm ) / imageheight ) / 2

I calculate this to be 499974.8026

However, the map is empty.  An image finally appears if I change the
MAXSCALEDENOM value to 509631

What schoolboy error have I made?  Its all the more confusing because,
before my MapServer 5 upgrade, this seemed to be working fine!

Many thanks in advance

Rob



More information about the MapServer-users mailing list