z-curve

0.0.1 • Public • Published

稳态 Z 曲线

github npm npm Build Status codebeat badge codecov

安装使用

const z = require('z-curve');
 
z.encode(lat, lng, scala);
 
z.decode(z_val);

在浏览器中测试: https://npm.runkit.com/z-curve

API

encode(latitude, longitude, scala = 0)

Encode a pair of latitude and longitude values into a z-curve.

const z = require('z-curve');
 
z.encode(32.05, 118.78333) === 471947;

decode(z_value)

Decode a hash string into pair of latitude and longitude values. A javascript object is returned with lat and lng keys.

const z = require('z-curve');
 
z.decode(471947);
// {
//   lat: 32.16796875,
//   lng: 118.65234375
// }

参考资料

Readme

Keywords

Package Sidebar

Install

npm i z-curve

Weekly Downloads

2

Version

0.0.1

License

Apache-2.0

Unpacked Size

16.7 kB

Total Files

11

Last publish

Collaborators

  • willin