Scale and extents: relationship?

Avi A Blackmore sysadmin at SATSHOT.COM
Tue May 17 14:39:41 EDT 2005


Hi, folks.

        This question may sound rather peculiar, but I'm wondering about the
relationship between map extents and the scale of the map.  Specifically, how
can I convert between the scale value of MINSCALE (or MAXSCALE) and map
extents?

        I ask this because, in my PHP Mapscript application, I have zooming to
queried features implemented in terms of zooming to a box around the extents
of the feature; I want to ensure that this doesn't enable anyone to zoom in
closer than MINSCALE, but the way that I do this (by calculating the length
of one side of the feature's bounding box, and ensuring the "zoom-to"
bounding box is larger than a minimum) requires that I know what the minimum
length is, in map coordinates.

        In my current app, I was able to calculate this "minimum delta" by eyeballing
the extents of the box at maximum zoom in the mapfile I'm testing with, but
that's hardly general enough to work with different mapfiles, as I need to
do.  So I'm hoping to find out how I can convert between the two units.

        Any help would be much appreciated.
--
Avi Blackmore
System Administrator/Software Analyst
Agri ImaGIS Technologies, Inc.



More information about the mapserver-users mailing list