Select to view content in your preferred language

UTM NAD 1927 to DMS

1372
2
02-26-2013 03:33 AM
Udaya_BhaskerCheerala
Emerging Contributor
Hi All,

I have requirement to convert UTM NAD 1927 Northing (4804172), Esting(753352) to Geographic coordinatesystem(Degrees Minutes, Seconds).

Iam doing like below

m_mapPoint[0] = new esri.geometry.Point(4804172, 753352, new esri.SpatialReference({ wkid: 26712 }));
var geogPt = esri.geometry.webMercatorToGeographic(m_mapPoint[0]);
gsvc.project([geogPt], outSRgc83, convrtCord83);

when I project the point I am getting result as NaN. But It's equivalent DMS should be 42 21' 58.42'', 107 52' 29.28''
and map point should be 42.5698, -107.5229

Please help me how to resolve it.

Thanks,
Uday
0 Kudos
2 Replies
ReneRubalcava
Esri Frequent Contributor
I'm a little confused at these two lines.
m_mapPoint[0] = new esri.geometry.Point(4804172, 753352, new esri.SpatialReference({ wkid: 26712 }));
var geogPt = esri.geometry.webMercatorToGeographic(m_mapPoint[0]);


wkid 26712 is not a web mercator projection. Web Mercator wkid is 102100 (and 102113? the two still throw me off).
esri.geometry.webMercatorToGeographic will convert it to 4326.

You should be able to skip the above step and go straight to the geometry service project() method specifying what output spatial reference you are looking for once you create your m_mapPoint[0].

Granted I haven't had a need to project very often beyond geographc and web mercator, so take this with a grain of salt.
0 Kudos
Udaya_BhaskerCheerala
Emerging Contributor
It is working after changing the code as below.

m_mapPoint[0] = new esri.geometry.Point(4804172, 753352, new esri.SpatialReference({ wkid: 26712 }));
var params = new esri.tasks.ProjectParameters();
// add array of points
params.geometries = m_mapPoint;
// Output Spatial Reference in lat/long (wkid 4326)
params.outSR = new esri.SpatialReference({wkid: 4326});
// run callback once the geometry service returns the reprojected results.
gsvc.project(params, callback, errback);


Thankyou very much.

Thanks,
Uday
0 Kudos