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/sinu.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                            SINUSOIDAL
3
4PURPOSE:        Transforms input longitude and latitude to Easting and
5                Northing for the Sinusoidal 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----------              ----           
11D. Steinwand, EROS      May, 1991     
12
13This function was adapted from the Sinusoidal projection code (FORTRAN) in the
14General Cartographic Transformation Package software which is available from
15the U.S. Geological Survey National Mapping Division.
16 
17ALGORITHM REFERENCES
18
191.  Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
20    Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
21    State Government Printing Office, Washington D.C., 1987.
22
232.  "Software Documentation for GCTP General Cartographic Transformation
24    Package", U.S. Geological Survey National Mapping Division, May 1982.
25*******************************************************************************/
26
27Proj4js.Proj.sinu = {
28
29        /* Initialize the Sinusoidal projection
30          ------------------------------------*/
31        init: function() {
32                /* Place parameters in static storage for common use
33                  -------------------------------------------------*/
34                this.R = 6370997.0; //Radius of earth
35        },
36
37        /* Sinusoidal forward equations--mapping lat,long to x,y
38        -----------------------------------------------------*/
39        forward: function(p) {
40                var x,y,delta_lon;     
41                var lon=p.x;
42                var lat=p.y;   
43                /* Forward equations
44                -----------------*/
45                delta_lon = Proj4js.common.adjust_lon(lon - this.long0);
46                x = this.R * delta_lon * Math.cos(lat) + this.x0;
47                y = this.R * lat + this.y0;
48
49                p.x=x;
50                p.y=y; 
51                return p;
52        },
53
54        inverse: function(p) {
55                var lat,temp,lon;       
56
57                /* Inverse equations
58                  -----------------*/
59                p.x -= this.x0;
60                p.y -= this.y0;
61                lat = p.y / this.R;
62                if (Math.abs(lat) > Proj4js.common.HALF_PI) {
63                    Proj4js.reportError("sinu:Inv:DataError");
64                }
65                temp = Math.abs(lat) - Proj4js.common.HALF_PI;
66                if (Math.abs(temp) > Proj4js.common.EPSLN) {
67                        temp = this.long0+ p.x / (this.R *Math.cos(lat));
68                        lon = Proj4js.common.adjust_lon(temp);
69                } else {
70                        lon = this.long0;
71                }
72                 
73                p.x=lon;
74                p.y=lat;
75                return p;
76        }
77};
78
79
Note: See TracBrowser for help on using the repository browser.