[MetaCRS] Proj4js problem: EPSG:4236 to EPSG:26986 transformation

Ben Krepp bkrepp at ctps.org
Fri Sep 17 15:19:41 EDT 2010


Hi all,

 

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. 

 

The following snippet of JavaScript code is sufficient to expose the issue:

 

// Begin code snippet

                var oSrcPrj = new Proj4js.Proj('EPSG:4236');

                var oDestPrj = new Proj4js.Proj('EPSG:26986');

                var oPoint = new
Proj4js.Point(-71.11881762742996,42.37346263960867);

                Proj4js.transform(oSrcPrj,oDestPrj,oPoint);

                alert("Transformed LatLng->MassStatePlane coordinates are: X
= " + oPoint.x + " Y = " + oPoint.y);

// End code snippet

 

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.

 

When run, the coordinates of the transformed point are:

X = 230616.5448393133,  Y = 902165.5744436784

 

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:

               X = 231394.7344,  Y = 902622.1875

 

So, there is a large discrepancy between the actual and expected results.

Am I using the library incorrectly, or is there a bug in Proj4js?

 

Thanks for any light that can be shed on this.

 

Ben Krepp

Manager of Information Technology, GIS, and Data Services

Central Transportation Planning Staff

10 Park Plaza

Suite 2150

Boston, MA 02115

e-mail: bkrepp at ctps.org

phone: 617-973-7137

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/metacrs/attachments/20100917/3855d438/attachment.html


More information about the MetaCRS mailing list