You make a mistake with the pyproj parameters
from pyproj import Proj, transform
inProj = Proj("+init=EPSG:3857"))
outProj = Proj("+init=EPSG:4326")
x1,y1 = (-20037507.0672, 20037509.6184)
x2,y2 = (-1467048.29156, 8625918.8737)
# with the x,y coordinates of pointx
print transform(inProj,outProj,x1,y1)
(-179.99998854118687, 85.08398750388278)
# with the x,y coordinates of point pointy
print transform(inProj,outProj,x2,y2)
(-13.178719028497799, 61.16289280460126)
Control with GDAL (Python GDAL/OGR Cookbook: Projections)
from osgeo import osr
from_srs = osr.SpatialReference()
from_srs.ImportFromEPSG(3857)
to_srs = osr.SpatialReference()
to_srs.ImportFromEPSG(4326)
transf = osr.CoordinateTransformation(from_srs,to_srs)
print transf.TransformPoint(x1,y1)[:2]
(-179.99998854118684, 85.05112976833757)
# with the x,y coordinates of point y
print transf.TransformPoint(x2,y2)[:2]
(-13.178719028497795, 61.000416666720845)
If you want to use lists of coordinates:
x = (-20037507.0672,-1467048.29156)
y = (20037509.6184, 8625918.8737)
for i,j in zip(x,y):
print transform(inProj,outProj,i, j)
(-179.99998854118687, 85.08398750388278)
(-13.178719028497799, 61.16289280460126)
The problem is poorly documented by authoritative sources for English speakers, despite affecting millions of people on an everyday basis. I've spend the past two days trying to understand the situation and I've created a Wikipedia article about the restrictions on mapping in China and about the China GPS shift problem. Below is the part of my research that answers the question.
The root of the problem is the severe restrictions that the Chinese State Council places on geographic data concerning China's air, land and waters. Mapping and surveying can only be done with authorization from the State Council, and foreigners must form a joint-venture in order to be granted authorization for surveys. There have been numerous examples of fines levied against individuals and companies breaking this (cough protectionist and isolationist cough) law.
Online map providers offering street maps of China must obtain an authorization from the State Council. These maps must use the GCJ-02 datum, instead of the WGS-84 that the most of the world uses. This causes WGS-84 coordinates, such as those coming from a regular GPS chip, to be plotted incorrectly on GCJ-02 maps.
The street maps displayed by both google.com/maps and google.cn/maps use GCJ-02 coordinates. This can be proved by getting the GPS (WGS-84) coordinates of a known landmark, such as the Monument to the People's Heroes in Shanghai, which is located at 31.24427 N, 121.48695 E:
I'm still unclear as to whether GPS chips manufactured in China return GCJ-02 coordinates directly, or if they return WGS-84 coordinates, which approved map software can convert to GCJ-02.
Best Answer
As of 30 March 2017, no, there are no coordinate reference system, nor transformations for BD-09 or GCJ-02 in the EPSG Registry. As far as I'm aware as a member of the subcommittee that maintains the registry, no request has been made to add either one.
A big issue with a request is getting reliable information as part of the request even of the geographic coordinate reference systems themselves.
It would highly unlikely that EPSG would add any transformations because that information is controlled by the Chinese government. Why would the government want that information in a public repository?
I looked at two online solutions that purported to handle the CGJ-02 offset. Neither one worked particularly well. The offsets are not regular in a way that lends itself to an easy solution as well.