Skip to main content

Convert xy coordinates

Project description


This is a python package for converting xy coordinates (in lng,lat order) in numpy array between WGS-84, GCJ-02 and BD-09 system.

The conversion in numpy is much more efficient (50-70 times speedup) compared with previous Python implementations such as eviltransform and coordTransform_py that convert only a single point at each call.

Install the package

pip install xyconvert


from xyconvert import gcj2wgs
import numpy as np
gcj_xy = np.asarray([[104.07008157,  30.73199687],
       [104.07008159,  30.73177709],
       [104.06999188,  30.73147758]])
wgs_xy = gcj2wgs(gcj_xy)
print wgs_xy
[[104.06756309  30.73437796]
 [104.06756312  30.73415829]
 [104.06747357  30.73385904]]


The code is partly copied/modified from and

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xyconvert-0.1.2.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

xyconvert-0.1.2-py2-none-any.whl (3.0 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page