Decimal degree units

Stephen Lime steve.lime at dnr.state.mn.us
Thu Aug 26 09:26:52 PDT 1999


I'd love to see it supported, but have been unable to figure out an easy
way to account for changing measures as you move around. There is
no one conversion from DD to inches. It would be easy to figure an
average x cellsize value for a map, then one could figure out the dd to inches
conversion factor and with that you could calculate a scale. Scales are
rough to begin with as they are monitor dependent. MapServer uses a
pixels/inch value of 72 to generate scales.

To add DD support only 3 things have to change. 

  - add MS_DD to ms_units enumeration in map.h
  - change the lexer to recognize a DD keyword in mapfiles (edit mapfile.h, mapfile.c and maplexer.l)

I could do that easily. Rebuilding the lexer requires flex.

  - edit msCalculateScale function in mapscale.c to deal with the nuances of DD

Anyone got ideas/code to figure out DD to inches relationship depending on where
you are in the world?

The other workaround is to project your data on-the-fly using the Proj.4 library. A bit slower
as every coordinate is projected but it does work.

Steve

Stephen Lime
Internet Applications Analyst
MIS Bureau - MN DNR

(651) 297-2937
steve.lime at dnr.state.mn.us

>>> Banister Trevor <TBanister at SpaceImaging.com> 08/26 11:07 AM >>>
Is anyone using decimal degree units?
It looks like they aren't supported from the looks of map.h
enum ms_units {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS};
I've gotten the shape files to work ok, but I have to fake a unit type which
throws off the legend and absolute zoom factor.
Any work arrounds? or should I start coding DD support?

Thanks.

Trevor





More information about the MapServer-users mailing list