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

Ethan Alpert ealpert at digitalglobe.com
Mon May 3 16:44:35 EDT 2004

```Still if you're using a rectilinear projection you should be able to set
this up provided you're not crossing the date line. Mercator or
Cylindrical equidistant should work. I can understand not being able to
do this with say a polar stereographic or a conic projection.

-e

-----Original Message-----
From: mapserver-users-admin at lists.gis.umn.edu
[mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of Ed
McNierney
Sent: Monday, May 03, 2004 1:27 PM
To: Matthew Perry; mapserver-users at lists.gis.umn.edu
Cc: Gregor Mosheh
Subject: RE: [Mapserver-users] Using mapserv.js with decimal degrees

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
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

```