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 1,000,000+ packages pre-installed, including guess-projection with all npm packages installed. Try it out:

var guessProjection = require("guess-projection")

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

guess-projection v0.4.0

Find the geographic projection which best turns a given (X,Y) into an expected (lng, lat).

Guess projection

Find the geographic projection which best turns a given (X,Y) into an expected (lng, lat).

Returns an array of { projection, distance, def }, reverse sorted by distance. So the best guess for the name of the projection is results[0].projection.

const guess = require('guess-projection');
const results = guess(16137423.630081, -4553353.774948, 144.9, -37.85)
console.log(results[0]);
// {
//    "projection": "EPSG:900914",
//    "distance": 6.891712664568894,
//    "def": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"
//  }

Metadata

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