Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including proj4node with all npm packages installed. Try it out:

var proj4node = require("proj4node")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

proj4node v0.0.6

Proj4js ported for Node.js without the asynchronous definition loading.

Proj4node

Synchronous Proj4js slimmed down for Node.js

Usage

Convert a WGS884 coordinate to SWEREF99 TM.

var proj4node = require('proj4node'),
    sweref = proj4node('+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'),
    p = sweref.transform(proj4node.WGS84, {x:11.901, y:57.689});

console.log(p);

Syncing with Proj4js SVN repository

$ git clone https://github.com/icetan/proj4node.git
$ cd proj4node
$ ./connect-proj4js-repo.sh

Then read instructions from output.

Attributions

Important to note, I have only removed functionality from the original Proj4js project. All the hard stuff (algorithms and parsing) is solely thanks to the authors of Proj4js.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free