I am pulling a JSON list of features into a web page. The points come as esriMeters and the rest of my app uses Lat/Lng. How can I do this conversion in the browser (javascript)?
Asked
Active
Viewed 1,517 times
3
-
Are you using the ArcGIS API for JavaScript? – blah238 Mar 15 '13 at 04:09
-
I haven't used that but would if that's the most efficient way. It looked to be a limited set of six specific functions. – Joe Beuckman Mar 15 '13 at 04:16
-
Where are you seeing that? This is the API I'm talking about: http://help.arcgis.com/en/webapi/javascript/arcgis/ – blah238 Mar 15 '13 at 04:22
-
I see the API reference now. On this page, it just said "download all six javascript functions" http://www.esri.com/getting-started/developers/get-started/javascript – Joe Beuckman Mar 15 '13 at 04:25
-
So if I use their JS library, do you know the function that will do the conversion? – Joe Beuckman Mar 15 '13 at 04:25
-
If you aren't already building your app on top of it, I don't know whether it can or should be shoehorned in just to do the coordinate conversion. You might try proj4js instead. – blah238 Mar 15 '13 at 04:28
-
This looks like exactly what I need! If I am getting wkid=26915 features from ArcGIS, is that the same as EPSG:26915 referenced in the proj4js? – Joe Beuckman Mar 15 '13 at 04:39
-
Yes they should be the same: Do ArcGIS SpatialReference object factory codes correspond with EPSG numbers? – blah238 Mar 15 '13 at 04:42
2 Answers
3
If you're executing a query against an ArcGIS service, just set the output spatial reference to the geographic coordinate system of your choice (e.g. 4326 for WGS84). This will give you lat / long.
Craig Williams
- 2,258
- 15
- 14
-
Ha - I swear I had tried requesting several combinations of formats last night but this time it's working. Getting data as needed from arcgis now. – Joe Beuckman Mar 15 '13 at 12:12
-