The proj module exports a Projection constructor and methods for transforming geometries between coordinate reference systems.
js> var PROJ = require("geoscript/proj");
| Parameters: |
|
|---|---|
| Returns: |
Tranform a geometry from one coordinate reference system to another. Returns a new geometry. The from and to arguments can be proj.Projection instances or the string values used to construct them.
Example use:
js> var GEOM = require("geoscript/geom");
js> var p1 = new GEOM.Point([-111.0, 45.7]);
js> var p2 = PROJ.transform(p1, "epsg:4326", "epsg:26912");
js> Math.floor(p2.x)
499999
js> Math.floor(p2.y)
5060716