I have an issue converting lat longs to UTM with the ArcGIS javscript API.

Lets say that I have a map, based on the UTM zone 29N, also known as WKID 32629.

I have a known set of coordinates from a GPS, in this format:

Latitude:  62.220596 
Longitude: -6.564331

The geograpic coordinates are in WKID 4326.

To convert using javascript I have been trying to use the Geometry Service's project method.

If we look at this post in the ArcGIS forum, it is about the same issue. Here, I have tried using the same code, and adjusting the wkid of the output spatialReference to 32629, and you see it returns only NaN, try in the JSfiddle to change the wkid to 4326, and you will see geographic coordinates.

Edit 1

Looking at the HTTP requests made to the server, I see this url is requested (now using the map of the Faroe Islands)


This looks like a correct url, containing outSR, inSR, geometries, and callback. However, simulating requests to this url gives me either a 500 Internal Server Error, or this string:

dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"error":{"code":400,"message":"Unable to complete Project operation.","details":["Error projecting geometries"]}});

Any ideas?

5 Answers 5


I haven't looked at your code, but in the URL you provided, your X and Y are flipped around. For Faroe Islands, X should be -6.7866 (longitude) while Y should be 62.01387 (latitude). Here's a working URL of what you're trying to do:


That correctly returns:


As for 500s, I seem to get those quite frequently with sampleserver3 as well tonight. Try using sampleserver1 instead, that one seems to be more stable.


By changing the WKID in the code on JSFiddle you're asking the geometry service to project from one UTM zone to another. That doesn't really makes sense...

Try this: http://jsfiddle.net/swingley/Yab7E/

The code there takes a map click point (which is web mercator), converts it to lat, long, sends the lat, long point to the geometry service and says project it to WGS84 UTM Zone 29N.

Edit: Here's a URL generated from that fiddle that returns a point in UTM Zone 29N:


I bagged the code form here and it works grand. Integrated client side, you dont actually need a call to the server. Integrated server side in a script, which I have also done, keeps it all encapsulated.


You are asking for a UTM Zone 29N coordinate for a point in Michigan.
UTM Zone 29N does not exist in Michigan, you are outside the bounds of the coordinate system.

To demonstrate, on your original example zoom out 14 times then click about a half inch under the M in "Mercator". You will get a result because you are now inside the bounds of the UTM Zone 29N coordinate system.

Or, try changing to Zone 16N, wkid 32616, which does exist in Michigan and you will see that your sample code returns a point without any problem.

As an additional note to this, ESRI really needs to fix the documentation of the error. Now that I know what the problem was, the error makes sense, but can you really figure out from that error that you are trying to project outside the bounds of the coordinate system?


10 seconds solution for this one would by to copy/paste your lat/long to http://www.hamstermap.com - you will get them instantly converted to UTM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.