[Mapserver-users] Using mapserv.js with decimal degrees

Matthew Perry mtperry78 at sbcglobal.net
Tue May 4 12:02:39 EDT 2004

We have, for the time being, decided that we must use
projected data with mapserv.js. In order to get
accurate scale calculations necessary for the
navigation tools, the units must be planar.

The solution might involve some javascript conversion
of lat/long mouse clicks and extents into planar
distances, doing the scale calculations, then
converting back to lat/long. It would be much easier
to simply reproject the datasets.

Thanks to everyone for their help.

Matt Perry
Natural Resources Planning
Humboldt State University
mtperry78 at sbcglobal.net

--- Ed McNierney <ed at topozone.com> wrote:
> Matt -
> The problem with unprojected data is that it's a
> strange and
> hard-to-interpret data set when you try to measure
> something!
> If your data is displayed in "decimal degrees" that
> means that one
> degree of latitude and one degree of longitude form
> a square.  Of
> course, they don't really do that anywhere on the
> Earth.  And unless
> you're really close to the equator, one degree of
> longitude is
> noticeably shorter than one degree of latitude.  And
> the length of one
> degree of longitude varies depending on the
> latitude.
> So you've got a map that lets users measure "one
> degree" - what does
> that mean?  It means that you're taking those
> angular units and trying
> to pretend they're linear units.  If someone
> measures between two points
> on your map and measures one degree, they will know
> that the square root
> of the sum of the latitude difference squared and
> the longitude
> difference squared equals one.  It does not tell
> them anything about how
> far apart those two points are in any useful linear
> measurement (feet,
> miles, meters, cubits, chains, furlongs, etc.).
> And if you display a scalebar on that map, the units
> must be in
> "degrees", whatever they are <g>.
> What kind of measurement are you hoping to display?
> 	- Ed
> Ed McNierney
> President and Chief Mapmaker
> TopoZone.com / Maps a la carte, Inc.
> 73 Princeton Street, Suite 305
> North Chelmsford, MA  01863
> ed at topozone.com
> (978) 251-4242 
> -----Original Message-----
> From: Matthew Perry [mailto:mtperry78 at sbcglobal.net]
> Sent: Monday, May 03, 2004 3:01 PM
> To: mapserver-users at lists.gis.umn.edu
> Cc: Gregor Mosheh
> Subject: [Mapserver-users] Using mapserv.js with
> decimal degrees
> Hey all,
>   I have been using the mapserv.js and dbox.js
> libraries for developing
> mapserver interfaces. It works great for projected
> data but now we're
> trying to get the navigation tools (panning,
> zooming, etc) to work with
> decimal degrees. 
> In the mapserv.js, there is a global variable called
> InchesPerMapUnit
> that you need to set correctly if not using meters.
> Since lat/long is
> measured in angular units (degrees), how would you
> set this variable? 
> Are there any other tricks to get the coordinate
> calculations working
> with lat/long? Anyone had any luck with this? Is it
> even possible?
> Thanks for any input!
> Matt Perry
> Natural Resources Planning
> Humboldt State University
> mtperry78 at sbcglobal.net
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu

More information about the mapserver-users mailing list