[mapserver-users] What does scale mean?
Steve Lime
steve.lime at dnr.state.mn.us
Fri Mar 8 14:43:49 PST 2002
Scale is unitless, that is a scale of 1:200,000 means 1 inch on the map
equals 200,000 inches
on the ground. You can the convert the 200,000 inches to meters, miles
or whatever. Scale
computations for DD are provided, that is, we know how many inches
there are in a single
DD. The issue is that value is valid only at the equator (recall that
dx gets smaller as you
move north) and we had to pick some reference point. For this reason
using scale values
with DD is discouraged other then when doing things like toggling
layers at certain values.
MapServer uses a standard value for the size of a pixel, 1/72 of an
inch. This obviously varies
by monitor, but again it's a decent approximation.
Scale values (1:30,000) are subject to display characteristics.
Scalebars are not, they match
the map and are correct. Myself, I tend to avoid absolute numbers and
stick with scalebars...
Also note that for simplicity scale in MapServer is given using the
denominator of the scale RF,
so a value of 30000 in any of the mapfile parameters or url parameters
means 1/30000 internally.
Steve
Stephen Lime
Data & Applications Manager
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> <imap at chesapeake.net> 03/07/02 11:40PM >>>
Steve,
in mapscale.c....
For METERS inchesPerUnit = 39370.1
resolution = 72 (pixels per inch)
md = width / (resolution*inchesPerUnit)
gd = extent.maxx - extent.minx
scale = gd/md
However, when I plug my METERS values into this formula,
I had to multiply scale by 100 to get the right answer.
I am not sure why that is, but... it seemed to produce
the correct value (or very close to it).
I could not find anything in the code to deal with UNITS
(inchesPerUnit) for DD Decimal Degrees...
When going thru this exercise, I generated a map with UNITS
METERS a scale of 1:200000, but I am not sure what this 200000
actually is. Maybe it is 200000 map units or something???
The scalebar with the map I generated was measures the map width
on the screen to be approximately 28 miles across. I was trying
to extrapolate miles from the scale, but I could not figure that
part out. Does any know how to convert the mapscale units to miles?
Regards,
Chris Stuber (mapsurfer)
Silicon Mapping Solutions, Inc.
Stephen Woodbridge wrote:
>
> OK, this may seem like a dumb question, but it occurs to me that I
don't
> think I know what scale means in MapServer context.
>
> For example, if I am displaying a map file with units METERS and my
> Scale is 1:1000 how are SCALE, UNITS, PIXELs related? What if my
units
> are DD?
>
> TIA,
> -Steve
More information about the MapServer-users
mailing list