[OpenLayers-Users] How do I transform deg decimal to TransverseMercator projection NAD27

Robert Sanson SansonR at asurequality.com
Tue Feb 16 15:28:56 EST 2010


Hi Joel
 
This is how I do something similar. I use proj4 - with appropriate projection files specified:
 

 <script src="lib/proj4js-combined.js"></script>
 <script src="lib/EPSG2193.js"></script>
 <script src="lib/EPSG4326.js"></script>
Here is the code that does the re-projection:
 
src = new OpenLayers.Projection('EPSG:4326');
dest = new OpenLayers.Projection('EPSG:2193');
markergeom = new OpenLayers.Geometry.Point(gpsx,gpsy);
//now in-place re-projection
OpenLayers.Projection.transform(markergeom, src, dest); 
gpsx = markergeom.x;
gpsy = markergeom.y;
alert("from WGS84:" + gpsx + "," + gpsy);
 
Regards,
 
Robert Sanson

>>> Joel <joel at srcti.com> 17/02/2010 6:11 a.m. >>>

How do I transform deg decimal to Transverse Mercator projection for the
following?


SRS WKT:  PROJCS["NAD27 / Illinois East", GEOGCS["NAD27", DATUM["North
American Datum 1927", SPHEROID["Clarke 1866", 6378206.4, 294.9786982138982,
AUTHORITY["EPSG","7008"]], TOWGS84[-4.2, 135.4, 181.9, 0.0, 0.0, 0.0, 0.0],
AUTHORITY["EPSG","6267"]], PRIMEM["Greenwich", 0.0,
AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295],
AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH],
AUTHORITY["EPSG","4267"]], PROJECTION["Transverse Mercator",
AUTHORITY["EPSG","9807"]], PARAMETER["central_meridian",
-88.33333333333333], PARAMETER["latitude_of_origin", 36.666666666666664],
PARAMETER["scale_factor", 0.999975], PARAMETER["false_easting", 500000.0],
PARAMETER["false_northing", 0.0], UNIT["foot_survey_us",
0.30480060960121924], AXIS["Easting", EAST], AXIS["Northing", NORTH],
AUTHORITY["EPSG","26771"]]  
Native SRS WKT:  PROJCS["NAD_1983_StatePlane_Illinois_East_FIPS_1201_Feet",
GEOGCS["GCS_North_American_1983", DATUM["D_North_American_1983",
SPHEROID["GRS_1980", 6378137.0, 298.257222101]], PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295], AXIS["Longitude", EAST],
AXIS["Latitude", NORTH]], PROJECTION["Transverse_Mercator"],
PARAMETER["central_meridian", -88.33333333333333],
PARAMETER["latitude_of_origin", 36.666666666666664],
PARAMETER["scale_factor", 0.999975], PARAMETER["false_easting", 984250.0],
PARAMETER["false_northing", 0.0], UNIT["foot_survey_us",
0.3048006096012192], AXIS["X", EAST], AXIS["Y", NORTH]]


I have tried numerious combinations including :

        var proj3 = new OpenLayers.Projection("EPSG:4326");
        var proj1 = new OpenLayers.Projection("EPSG:900913");
        itemloc = new OpenLayers.LonLat(gpslon2, gpslat2);
        itemloc.transform( proj3, proj1);

I end up with:
        -87.66646666666666 lon: -9758986.427620362 deglat: 41.90336666666667
lat: 5146515.211664708
should be:
        -87.66646666666666 lon: 1160049.27959 deglat: 41.90336666666667 lat:
1912889.44114

        -87.68734166666668 lon: -9761310.22199035 deglat: 41.91610833333334
lat: 5148421.150384361
should be:
        -87.68734166666668 lon: 1163172.7780096494 deglat: 41.91610833333334
lat: 1909982.150384361

-- 
View this message in context: http://n2.nabble.com/How-do-I-transform-deg-decimal-to-Transverse-Mercator-projection-NAD27-tp4581461p4581461.html 
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org 
http://openlayers.org/mailman/listinfo/users 

------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------


This message has been scanned for malware by SurfControl plc. www.surfcontrol.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100217/ece662f5/attachment.html


More information about the Users mailing list