Coder Social home page Coder Social logo

cyang-kth / xyconvert Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 3.0 6 KB

Converting xy coordinates between WGS-84, GCJ-02 and BD-09 system

Home Page: https://pypi.org/project/xyconvert/

License: MIT License

Python 100.00%
numpy coordinate-conversion gcj02 wgs84 bd09 gps xy

xyconvert's Introduction

xyconvert

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

Usage

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]]
'''

Reference

The code is partly copied/modified from https://github.com/Argons/nextlocation and https://github.com/wandergis/coordTransform_py.

xyconvert's People

Contributors

cyang-kth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.