CoordinateUtils

CoordinateUtils

提供了百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换,GCJ02 可以通过反复迭代的形式降低精度损失,精度基本可以精确到米,迭代1次,可以达到 0.1 米的精度

Constructor

new CoordinateUtils()

Methods

(static) simpleTransformGCJ02ToWGS84(coordinate) → {Coordinate}

简单的GCJ02 转 WGS84

Parameters:
Name Type Description
coordinate Coordinate

GCJ02经纬度

Returns:
Type:
Coordinate

WGS84坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.simpleTransformGCJ02ToWGS84(coordinate);

(static) simpleTransformGCJ02ToWGS84(coordinate) → {Coordinate}

简单的GCJ02 转 WGS84

Parameters:
Name Type Description
coordinate Coordinate

GCJ02经纬度

Returns:
Type:
Coordinate

WGS84坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.simpleTransformGCJ02ToWGS84(coordinate);

(static) transformBD09ToGCJ02(coordinate) → {Coordinate}

百度坐标(BD09)转 火星坐标(GCJ02)

Parameters:
Name Type Description
coordinate Coordinate

百度经纬度

Returns:
Type:
Coordinate

坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformBD09ToGCJ02(coordinate);

(static) transformBD09ToGCJ02(coordinate) → {Coordinate}

百度坐标(BD09)转 火星坐标(GCJ02)

Parameters:
Name Type Description
coordinate Coordinate

百度经纬度

Returns:
Type:
Coordinate

坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformBD09ToGCJ02(coordinate);

(static) transformBD09ToWGS84(coordinate) → {Coordinate}

百度坐标BD09 转 WGS84

Parameters:
Name Type Description
coordinate Coordinate

经纬度

Returns:
Type:
Coordinate

WGS84 坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformBD09ToWGS84(coordinate);

(static) transformBD09ToWGS84(coordinate) → {Coordinate}

百度坐标BD09 转 WGS84

Parameters:
Name Type Description
coordinate Coordinate

经纬度

Returns:
Type:
Coordinate

WGS84 坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformBD09ToWGS84(coordinate);

(static) transformGCJ02ToBD09(coordinate) → {Coordinate}

GCJ02 转百度坐标

Parameters:
Name Type Description
coordinate Coordinate

GCJ02 经纬度

Returns:
Type:
Coordinate

百度坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformGCJ02ToBD09(coordinate);

(static) transformGCJ02ToBD09(coordinate) → {Coordinate}

GCJ02 转百度坐标

Parameters:
Name Type Description
coordinate Coordinate

GCJ02 经纬度

Returns:
Type:
Coordinate

百度坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformGCJ02ToBD09(coordinate);

(static) transformGCJ02ToWGS84(gcj) → {Coordinate}

GCJ02 转 WGS84

Parameters:
Name Type Description
gcj Coordinate

GCJ02经纬度

Returns:
Type:
Coordinate

WGS84坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformGCJ02ToWGS84(coordinate);

(static) transformGCJ02ToWGS84(gcj) → {Coordinate}

GCJ02 转 WGS84

Parameters:
Name Type Description
gcj Coordinate

GCJ02经纬度

Returns:
Type:
Coordinate

WGS84坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformGCJ02ToWGS84(coordinate);

(static) transformWGS84ToBD09(coordinate) → {Coordinate}

WGS84 转 百度坐标BD09

Parameters:
Name Type Description
coordinate Coordinate

经纬度

Returns:
Type:
Coordinate

BD09 坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformWGS84ToBD09(coordinate);

(static) transformWGS84ToBD09(coordinate) → {Coordinate}

WGS84 转 百度坐标BD09

Parameters:
Name Type Description
coordinate Coordinate

经纬度

Returns:
Type:
Coordinate

BD09 坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformWGS84ToBD09(coordinate);

(static) transformWGS84ToGCJ02(coordinate) → {Coordinate}

WGS84 坐标 转 GCJ02

Parameters:
Name Type Description
coordinate Coordinate

WGS84经纬度

Returns:
Type:
Coordinate

GCJ02 坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformWGS84ToGCJ02(coordinate);

(static) transformWGS84ToGCJ02(coordinate) → {Coordinate}

WGS84 坐标 转 GCJ02

Parameters:
Name Type Description
coordinate Coordinate

WGS84经纬度

Returns:
Type:
Coordinate

GCJ02 坐标:[经度,纬度]

Example
cnUtils.CoordinateUtils.transformWGS84ToGCJ02(coordinate);