utm.js
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*******************************************************************************
NAME TRANSVERSE MERCATOR
PURPOSE: Transforms input longitude and latitude to Easting and
Northing for the Transverse Mercator projection. The
longitude and latitude must be in radians. The Easting
and Northing values will be returned in meters.
ALGORITHM REFERENCES
1. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
State Government Printing Office, Washington D.C., 1987.
2. Snyder, John P. and Voxland, Philip M., "An Album of Map Projections",
U.S. Geological Survey Professional Paper 1453 , United State Government
Printing Office, Washington D.C., 1989.
*******************************************************************************/
/**
Initialize Transverse Mercator projection
*/
Proj4js.Proj.utm = {
dependsOn : 'tmerc',
init : function() {
if (!this.zone) {
Proj4js.reportError("utm:init: zone must be specified for UTM");
return;
}
this.lat0 = 0.0;
this.long0 = ((6 * Math.abs(this.zone)) - 183) * Proj4js.common.D2R;
this.x0 = 500000.0;
this.y0 = this.utmSouth ? 10000000.0 : 0.0;
this.k0 = 0.9996;
Proj4js.Proj['tmerc'].init.apply(this);
this.forward = Proj4js.Proj['tmerc'].forward;
this.inverse = Proj4js.Proj['tmerc'].inverse;
}
};