# Wherer is wrong with transforming a WGS84 [lon,lat] point onto google maps

I want to convert a longitude latitude point in WGS84 coordinate system to Google Maps(not google earth) coordinate, But when I put the converted point on google map, it always has a roughly 10km offset(moved to south) on y axis.

First correct me if my understanding is wrong with the two projections:

Google Maps:
spheroid parameters: a = b = 6378137
projection: Mercator;
To WGS84 Datum offset: no, (means 0,0,0)

WGS84:
spheroid parameters: a = 6378137;b=6356752.314
projection: WGS84;(like no projection, the coordinate is just longitude and latitude)


What I did:

Convert the WGS84 longitude, latitude(we call it point1) to geocentric coordinate(point2) with WGS84's spheroid;
//because no datum offset between Google Maps and WGS84, no need to convert point2 to Google Maps' geocentric
Convert point2 to geodentic coordinate(point3) with Google map's spheroid
Project point3 with Mercator projection into meter coordinate(point4).
Linearly transform point4 onto google maps.


On internet everybody is saying that Google Maps' projection is 'EPSG:3857' which means a and b are the same 6378137, but if I just use standard WGS84's spheroid parameters, which means a and b are different, the whole process is always correct, the result is very accurate.

• Why are you projecting the point youself? Why not use the functions inbuilt in the GoogleMaps API? Commented Jul 14, 2014 at 3:28
• I developed a GIS system by myself. The system is a desktop application, I put google map as the background of a vector map, letting user to edit their map with google map as reference. I have to deal with the projection in my application. Commented Jul 14, 2014 at 6:54
• Not relevant the original question, but you're probably getting close to breaking the ToS for Google Maps with this approach (see 10.1.3 Restrictions against Data Export or Copying, where derivative work is probably close to what you're doing - this is why OSM doesn't support gmaps as a source) Commented Jul 14, 2014 at 7:57
• You have to either use a = b = 6378137.0 m with a standard ellipsoid-supporting Mercator implementation OR use a Mercator implementation that supports spheres only. The error is when you converted to XYZ using WGS84, then back to lat/lon using the sphere. That changed the latitude values which is not needed to match Google's data. Commented Jul 14, 2014 at 17:52
• It is easy for me to match the data. I just want to understand what is really wrong. Commented Jul 14, 2014 at 18:03

The coordinate systems you mentioned, WGS 1984 and WGS84 Web Mercator (Auxiliary Sphere) (EPSG:3857), use the same spheroid and datum with parameters you written for WGS84. The semiminor and semimajor axis are not the same. Maybe that is the source of the error. See the description of the EPSG:3857 spatial reference.

• But everywhere people say, including google maps' official website,'EPSG:3857' uses sphere, WGS 1984 use ellipsiod. They use different spheroid. This confused me a lot. Commented Jul 14, 2014 at 17:59

The error is not on your side, but on Google's side. See