[MAPSERVER-USERS] Problems calculating MAXSCALES

BrainDrain paulborodaev at gmail.com
Wed Aug 13 02:16:12 EDT 2008


For calculating MIN/MAXSCALEDENOM I use openlayers ria js lib (automatic zoom
levels, supports map server layers), which is part of my web project. I have
the same question as you - howto to get current scale value with mapscript.
You can dig js code (openlayers: Map.js (getScale function)
FixedZoomLevels.js (getResolution function)) to find solution.


gisrob wrote:
> 
> 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
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Problems-calculating-MAXSCALES-tp18926188p18957581.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list