Bienvenue sur PostGIS.fr

Bienvenue sur PostGIS.fr , le site de la communauté des utilisateurs francophones de PostGIS.

PostGIS ajoute le support d'objets géographique à la base de données PostgreSQL. En effet, PostGIS "spatialise" le serverur PostgreSQL, ce qui permet de l'utiliser comme une base de données SIG.

Maintenu à jour, en fonction de nos disponibilités et des diverses sorties des outils que nous testons, nous vous proposons l'ensemble de nos travaux publiés en langue française.

source: trunk/workshop-routing-foss4g/web/proj4js/lib/projCode/mill.js @ 76

Revision 76, 2.4 KB checked in by djay, 12 years ago (diff)

Ajout du répertoire web

  • Property svn:executable set to *
Line 
1/*******************************************************************************
2NAME                    MILLER CYLINDRICAL
3
4PURPOSE:        Transforms input longitude and latitude to Easting and
5                Northing for the Miller Cylindrical projection.  The
6                longitude and latitude must be in radians.  The Easting
7                and Northing values will be returned in meters.
8
9PROGRAMMER              DATE           
10----------              ----           
11T. Mittan               March, 1993
12
13This function was adapted from the Lambert Azimuthal Equal Area projection
14code (FORTRAN) in the General Cartographic Transformation Package software
15which is available from the U.S. Geological Survey National Mapping Division.
16 
17ALGORITHM REFERENCES
18
191.  "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
20    The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
21
222.  Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
23    Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
24    State Government Printing Office, Washington D.C., 1987.
25
263.  "Software Documentation for GCTP General Cartographic Transformation
27    Package", U.S. Geological Survey National Mapping Division, May 1982.
28*******************************************************************************/
29
30Proj4js.Proj.mill = {
31
32/* Initialize the Miller Cylindrical projection
33  -------------------------------------------*/
34  init: function() {
35    //no-op
36  },
37
38
39  /* Miller Cylindrical forward equations--mapping lat,long to x,y
40    ------------------------------------------------------------*/
41  forward: function(p) {
42    var lon=p.x;
43    var lat=p.y;
44    /* Forward equations
45      -----------------*/
46    var dlon = Proj4js.common.adjust_lon(lon -this.long0);
47    var x = this.x0 + this.a * dlon;
48    var y = this.y0 + this.a * Math.log(Math.tan((Proj4js.common.PI / 4.0) + (lat / 2.5))) * 1.25;
49
50    p.x=x;
51    p.y=y;
52    return p;
53  },//millFwd()
54
55  /* Miller Cylindrical inverse equations--mapping x,y to lat/long
56    ------------------------------------------------------------*/
57  inverse: function(p) {
58    p.x -= this.x0;
59    p.y -= this.y0;
60
61    var lon = Proj4js.common.adjust_lon(this.long0 + p.x /this.a);
62    var lat = 2.5 * (Math.atan(Math.exp(0.8*p.y/this.a)) - Proj4js.common.PI / 4.0);
63
64    p.x=lon;
65    p.y=lat;
66    return p;
67  }//millInv()
68};
Note: See TracBrowser for help on using the repository browser.