NAD27 to NAD 83

3495
1
06-24-2015 12:06 AM
Udaya_BhaskerCheerala
New Contributor

Hi All,

I have Geographic coordinates as 42 33 9.22 ,-107 33 35.53 Datum NAD27. I would like to convert the same coordinates to Datum NAD83 using Javascript API, can anyone suggest me how ho to proceed.

Thanks,

Uday

0 Kudos
1 Reply
OwenEarley
Occasional Contributor III

You can project the point using a GeometryService. Note that you will need to convert your coordinates to decimal degrees before projecting them.

There is also a good sample that shows how to do this:

            var inSR = new esri.SpatialReference({
              wkid: incoord
            });
            var outSR = new esri.SpatialReference({
              wkid: outcoord
            });
            var geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
            var inputpoint = new esri.geometry.Point(inlon, inlat, inSR);
            var PrjParams = new esri.tasks.ProjectParameters();
            PrjParams.geometries = [inputpoint];
            PrjParams.outSR = outSR;
            if (datumtrans != 'Default') {
              PrjParams.transformation = {
                wkid: parseInt(datumtrans, 10)
              };
            }
            geometryService.project(PrjParams, function (outputpoint) {
              console.log('Conversion completed. Input SR: ' + incoord + '. Output SR: ' + outcoord + '. Datum Transformation: ' + datumtrans + '.');
              dojo.byId("outLat").value = outputpoint[0].y;
              dojo.byId("outLon").value = outputpoint[0].x;
            });