Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@timwis
Created December 9, 2013 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timwis/7882901 to your computer and use it in GitHub Desktop.
Save timwis/7882901 to your computer and use it in GitHub Desktop.
Convert between 4326 and 2272 with Proj4js. Written by @davewalk. Uses http://trac.osgeo.org/proj4js/
convertCoordinates: function (coords) {
Proj4js.defs['EPSG:2272'] = '+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs';
var source = new Proj4js.Proj('EPSG:4326');
var dest = new Proj4js.Proj('EPSG:2272');
var point = new Proj4js.Point(-75.163789, 39.952335);
Proj4js.transform(source, dest, point);
return point;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment