1

This question already has an answer here:

When I attempt to add XY Data to my map the lat and lon coordinates are projected in meters for example (-82, 34) becomes -82 meters and 34 meters. The GCS and Projection for both the new layer and the data frame are WGS 1984 Web Mercator (auxiliary sphere). Why is the new layer's XY Data displaying incorrectly?

marked as duplicate by mkennedy, Midavalo, Michael Stimson, PolyGeo arcgis-desktop Aug 8 '16 at 22:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    Welcome to GIS SE, can you edit your question or tag to indicate what software you are using? Try changing your data frame projection to match the CRS of the xy coordinates you are wanting to add in. – artwork21 Aug 8 '16 at 13:46
  • 1
    please see meta.gis.stackexchange.com/questions/3349/… for a discussion on how to ask a good question – Ian Turton Aug 8 '16 at 15:10
0

Web Mercator is in Meters (3857) Projected, WGS94 is (4326) is Lat/Longs, Geographic Projection. It's really one or the other, they both use the same datum but one(Web Mercator)is projected the other not.

The data was stored in Web Mercator for mapping, thus the geometry shows these coordinates in Meters, Lat/Longs in the feature attributes are the coordinates for the Geographic projection.

To convert from Web to Lat/ Long in JavaScript:

function MercatorToLatLon(mercX, mercY) {

var rMajor = 6378137; //Equatorial Radius, WGS84
var shift  = Math.PI * rMajor;
var lon    = mercX / shift * 180.0;
var lat    = mercY / shift * 180.0;
lat = 180 / Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180.0)) - Math.PI / 2.0);

return { 'Lon': lon, 'Lat': lat };

}

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