Problem converting projected coordinates to webmercator

1267
4
Jump to solution
08-22-2012 02:45 AM
ChristianLindholm
New Contributor
Hi,

I'm having a problem converting my coordinates in the Finnish KKJ2 coordinate system (i.e. Finland_Zone_2, wkid 2392) to webmercator in order to plot points on my map.

I am trying to do this with the code
esri.geometry.geographicToWebMercator(new esri.geometry.Point(east, north, new esri.SpatialReference(2392)))
,

No matter what spatial reference I put in the code, it appears that arcgis assumes the coordinates are given in WGS84. It does not matter what wkid i put in my code, my points end up on the exact same location on the map regardless of the wkid.

Where should I start looking for a solution?

BR
-Christian
0 Kudos
1 Solution

Accepted Solutions
DavideLimosani
Occasional Contributor II
0 Kudos
4 Replies
JohnnyPenet
New Contributor
Hi Christian,

I am not sure there is an easy way in Javascript for converting local geographic coordinates into projected coordinates. Having problems of converting WGS84 to Lambert 72 (31370), I wrote a number of javascript methods that did the job. One of the methods was the conversion between geographic and projected coordinates for Lambert 72. I think you will need something simular.
After some research, I used the conic conformal 2SP (Belgium) method, you will need 'JHS formulas' that can be found in the document http://www.epsg.org/guides/docs/G7-2.pdf

You can find a lot of documentation and code on a blog I wrote concerning conversions of projections in Javascript. First document is about the architecture. Second document contains the code. I hope the documents are easy readable.

http://jpenet.blogspot.be/2012/08/transformation-between-datums-in.html


Johnny
0 Kudos
ChristianLindholm
New Contributor
Thanks for the reply. I was hoping for a more ready built solution 🙂

I managed to use some of the examples available on the ArcGIS site in order to convert my coordinates.

-Christian
0 Kudos
DavideLimosani
Occasional Contributor II
0 Kudos
PaulLohr
Occasional Contributor III

Is it possible to output coordinates other than Web Mercator or WGS 1984 latitude / longitude with the Javascript API, not using a geometry service? esri/geometry/webMercatorUtils offers the Web Mercator and WGS 1984 conversions. I am interested in outputting coordinates to a projected state plane system. I briefly looked over the documentation but did not find an answer.

Here is the documentation for the webMercatorUtils (version 3.x)

esri/geometry/webMercatorUtils | API Reference | ArcGIS API for JavaScript 3.22 

Thank you for any help,

Paul Lohr

0 Kudos