Conversion to Lat/Lon from EPSG:54004?
Kirk Holbrook
kholbrook at GWI.NET
Mon Apr 16 12:16:17 PDT 2007
Hi,
Does anyone have Javascript code to convert to Lat/Lon from EPSG:54004?
I found the following, but I'm not sure if it's correct. Also, I assume
that I'd use two different radii for the R values below: for x, R =
6378137.0 m; for y, R = 6356752.3142 m.
x = R(lon_rad)
y = R ln [tan((pi/4)+lat_rad/2)]
where R=radius of a sphere in map units, lon_rad=longitude in radians
(rad=deg/57.2957795), lat_rad=latitude in radians, pi=3.14159...,
ln=natural
log, x and y in meters.
If this is correct, then:
lon_degrees = x_meters / 6378137.0 * 57.2957795
lat_degrees = ??? [sorry my math skills are a bit out of date]
Any help is greatly appreciated!
Thanks,
Kirk
More information about the MapServer-users
mailing list