<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi all,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m trying to use the Proj4js library to transform coordinates from the Google Maps SRS (EPSG:4236) to the Massachusetts State Plane NAD83 meters SRS (EPSG:26986) SRS, but am running into problems. Specifically, the results I’m getting are off by a several hundred meters for both the X and Y values. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The following snippet of JavaScript code is sufficient to expose the issue:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>// Begin code snippet<o:p></o:p></p><p class=MsoNormal> var oSrcPrj = new Proj4js.Proj('EPSG:4236');<o:p></o:p></p><p class=MsoNormal> var oDestPrj = new Proj4js.Proj('EPSG:26986');<o:p></o:p></p><p class=MsoNormal> var oPoint = new Proj4js.Point(-71.11881762742996,42.37346263960867);<o:p></o:p></p><p class=MsoNormal> Proj4js.transform(oSrcPrj,oDestPrj,oPoint);<o:p></o:p></p><p class=MsoNormal> alert("Transformed LatLng->MassStatePlane coordinates are: X = " + oPoint.x + " Y = " + oPoint.y);<o:p></o:p></p><p class=MsoNormal>// End code snippet<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The oPoint variable represents the location of the Harvard Square MBTA station in Cambridge, MA., as reported by Google Maps .The coordinate values were obtained by printing them out in a simple Google Maps onclick event handler.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When run, the coordinates of the transformed point are:<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>X = 230616.5448393133, Y = 902165.5744436784<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>According to the MassGIS MBTA_NODE GIS layer, which uses the Massachusetts State Plane NAD83 meters (i.e., EPSG:26986) SRS, the coordinates of this point are:<o:p></o:p></p><p class=MsoNormal> X = 231394.7344, Y = 902622.1875<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So, there is a large discrepancy between the actual and expected results.<o:p></o:p></p><p class=MsoNormal>Am I using the library incorrectly, or is there a bug in Proj4js?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for any light that can be shed on this.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Ben Krepp<o:p></o:p></p><p class=MsoNormal>Manager of Information Technology, GIS, and Data Services<o:p></o:p></p><p class=MsoNormal>Central Transportation Planning Staff<o:p></o:p></p><p class=MsoNormal>10 Park Plaza<o:p></o:p></p><p class=MsoNormal>Suite 2150<o:p></o:p></p><p class=MsoNormal>Boston, MA 02115<o:p></o:p></p><p class=MsoNormal>e-mail: <a href="mailto:bkrepp@ctps.org">bkrepp@ctps.org</a><o:p></o:p></p><p class=MsoNormal>phone: 617-973-7137<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>