Hi,
Using WebMercatorUtils to convert a point from webmercator to geographic and then back to webmercator doesn't give the original value back. Any ideas why?
point1: {x: -27763769.230105422, y: -6212655.210572942}
webMercatorUtils.webMercatorToGeographic() on point1 returns point2
point2: {x: 110.5938175582902, y: -48.63203914410154}
webMercatorUtils.geographicToWebMercator() on point2 returns point3
point3: {x: 12311247.455472855, y: -6212655.210572806}
I was hoping point1 and point3 to be same but that doesn't seem to be the case.
Thanks!
same datum for the geographic? There are many GCS's
Hi Dan,
I tried this instead:
point1 = {"spatialReference":{"wkid":3857},"x":-27763769.230105422,"y":-6212655.210572942}
let point2 = webMercatorUtils.project(point1, { wkid: 4326 });
point2 : {"spatialReference":{"wkid":4326},"x":110.5938175582902,"y":-48.63203914410154}
let point3 = webMercatorUtils.project(point2, { wkid: 3857 });
point3: {"spatialReference":{"latestWkid":3857,"wkid":102100},"x":12311247.455472855,"y":-6212655.210572806}
Does that address datum?
Thanks!
That isn't due to a datum difference assuming your long/lat values are correct
You can confirm using an online calculator
I'm getting the same response from https://tool-online.com/en/coordinate-converter.php#
-Thanks
here are the images for various combinations from there.
so assuming this is correct... and you have checked your inputs