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/cea.js @ 76

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

Ajout du répertoire web

  • Property svn:executable set to *
Line 
1/*******************************************************************************
2NAME                    LAMBERT CYLINDRICAL EQUAL AREA
3
4PURPOSE:        Transforms input longitude and latitude to Easting and
5                Northing for the Lambert Cylindrical Equal Area projection.
6                This class of projection includes the Behrmann and
7                Gall-Peters Projections.  The
8                longitude and latitude must be in radians.  The Easting
9                and Northing values will be returned in meters.
10
11PROGRAMMER              DATE           
12----------              ----
13R. Marsden              August 2009
14Winwaed Software Tech LLC, http://www.winwaed.com
15
16This function was adapted from the Miller Cylindrical Projection in the Proj4JS
17library.
18
19Note: This implementation assumes a Spherical Earth. The (commented) code
20has been included for the ellipsoidal forward transform, but derivation of
21the ellispoidal inverse transform is beyond me. Note that most of the
22Proj4JS implementations do NOT currently support ellipsoidal figures.
23Therefore this is not seen as a problem - especially this lack of support
24is explicitly stated here.
25 
26ALGORITHM REFERENCES
27
281.  "Cartographic Projection Procedures for the UNIX Environment -
29     A User's Manual" by Gerald I. Evenden, USGS Open File Report 90-284
30    and Release 4 Interim Reports (2003)
31
322.  Snyder, John P., "Flattening the Earth - Two Thousand Years of Map
33    Projections", Univ. Chicago Press, 1993
34*******************************************************************************/
35
36Proj4js.Proj.cea = {
37
38/* Initialize the Cylindrical Equal Area projection
39  -------------------------------------------*/
40  init: function() {
41    //no-op
42  },
43
44
45  /* Cylindrical Equal Area forward equations--mapping lat,long to x,y
46    ------------------------------------------------------------*/
47  forward: function(p) {
48    var lon=p.x;
49    var lat=p.y;
50    /* Forward equations
51      -----------------*/
52    dlon = Proj4js.common.adjust_lon(lon -this.long0);
53    var x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
54    var y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
55   /* Elliptical Forward Transform
56      Not implemented due to a lack of a matchign inverse function
57    {
58      var Sin_Lat = Math.sin(lat);
59      var Rn = this.a * (Math.sqrt(1.0e0 - this.es * Sin_Lat * Sin_Lat ));
60      x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
61      y = this.y0 + Rn * Math.sin(lat) / Math.cos(this.lat_ts);
62    }
63   */
64
65
66    p.x=x;
67    p.y=y;
68    return p;
69  },//ceaFwd()
70
71  /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long
72    ------------------------------------------------------------*/
73  inverse: function(p) {
74    p.x -= this.x0;
75    p.y -= this.y0;
76
77    var lon = Proj4js.common.adjust_lon( this.long0 + (p.x / this.a) / Math.cos(this.lat_ts) );
78
79    var lat = Math.asin( (p.y/this.a) * Math.cos(this.lat_ts) );
80
81    p.x=lon;
82    p.y=lat;
83    return p;
84  }//ceaInv()
85};
Note: See TracBrowser for help on using the repository browser.