Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.
Origionally a port of [PROJ.4](http://trac.osgeo.org/proj/) and [GCTCP C](http://edcftp.cr.usgs.gov/pub//software/gctpc) it is
a part of the [MetaCRS](http://wiki.osgeo.org/wiki/MetaCRS) group of projects.
This library is a port of both the [PROJ.4](http://trac.osgeo.org/proj/) and [GCTCP C](http://edcftp.cr.usgs.gov/pub//software/gctpc) libraries to JavaScript. Enabling these transformations in the browser allows geographic data stored in different projections to be combined in browser-based web mapping applications.
##Installing
Proj4js is a part of the [MetaCRS](http://wiki.osgeo.org/wiki/MetaCRS) group of projects and uses the same MIT style license as PROJ.4.
Depending on your preferences
```bash
npm install proj4js
bower install proj4js
jam install proj4js
```
or just manually grab the file `dist/proj4.js`
##Using
the basic signature is:
```javascript
proj4(fromProjection[,toProjection2,coordinates])
```
Projections can be proj or wkt strings, or a proj4.Proj object.
Coordinates may be proj4.Point objects, an object of the form `{x:x,y:y}`, or an array of the form `[x,y]`.
When all 3 arguments are given, the result is that the coordinates are transformed from projection1 to projection 2. And returned in the same format that they were given in.
//I'm not going to redefine those two in latter examples.
proj4(firstProjection,secondProjection,[2,5]);
// [-2690666.2977344505, 3662659.885459918]
```
If only 1 projection is given then it is assumed that it is being projected *from* WGS84 (fromProjection is WGS84).
```javascript
proj4(firstProjection,[-71,41]);
// [242075.00535055372, 750123.32090043]
```
If no coordinates are given an object with two methods is returned, its methods are `forward` which projects from the first projection to the second and `inverse` which projects from the second to the first.