Default layer units

Steve Lime steve.lime at DNR.STATE.MN.US
Tue Mar 29 10:43:25 EST 2005


I've thought about this a bit too. What really should happen is that a
layer without
a projection set should inherit the map->units. For the CGI that's easy
to enforce.
Just add a check with the end of the mapfile is hit. It's a bit
trickier for MapScript,
although when a layer is created it has to be done so in the context of
a mapObj
(correct?) and could take on the value then.

Now I'm wondering if we really need layer units at all. Features are
always projected
before being used so why not just use map->units instead?

Steve

>>> Jerry Pisk <jerry.pisk at GMAIL.COM> 3/24/2005 7:35:42 PM >>>
Hi all,

I noticed that initLayer in mapfile.c initializes layer units to
meters, is that what we should do? Shouldn't default layer units be -1
meaning map units, or at least the current map units if -1 caused
problems (I believe it would)?

The problem is that some (but only some) parts of the mapserver code
transform layer units to map units and this assumption that layer
units are meters unless specified otherwise breaks that code. I went
ahead and removed that transformation from msDrawShape in circle
layers, since no other layer type was doing this. But there may be
more.

Jerry Pisk



More information about the mapserver-dev mailing list