[MAPSERVER-USERS] Problems calculating MAXSCALES
Tamas Szekeres
szekerest at gmail.com
Wed Aug 13 06:26:51 PDT 2008
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;
In case if UNITS is decimal_degrees then the value may be corrected
based of the latitude of the center of the map, (See msInchesPerUnit
for more details) otherwise the following constants are used:
static char *unitText[5]={"in", "ft", "mi", "m", "km"};
double inchesPerUnit[6]={1, 12, 63360.0, 39.3701, 39370.1, 4374754};
Best regards,
Tamas
2008/8/13 Rob <gis at vanbooth.com>:
> OK, I hesitate to say it, but this looks like a bug to me. But I'm
> still convinced that it must be something I have done wrong as this
> seems too fundamental to have slipped through the net without anybody
> else noticing it.
>
> I have created a test case, and can reproduce on an MS4W installation
> on my laptop away from the server.
>
> Using MS4W (MapServer 5.0.2) the scales don't seem to match as per my
> previous message, and no image is created by a basic shp2img call.
> Using MS4W 1.5.4 (MapServer 4.8.3) the scales work as I would expect,
> and shp2img creates a valid image.
>
> I've uploaded my test data here -
> http://sites.google.com/a/vanbooth.com/transfer/Home
>
> There are two test map files - one for MapServer 5.0.2, and one for 4.8.3
> There is a TIF (apols for the size) and a corresponding TFW file.
>
> Can someone confirm that I haven't made a stupid mistake? - which is
> what I am expecting :)
>
> Many thanks in advance
>
> Rob
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list