Skip to content

A location converter between WGS84 GCJ-02(国测局坐标) and BD-09(百度坐标).

License

Notifications You must be signed in to change notification settings

Dwarven/DYLocationConverter

Repository files navigation

DYLocationConverter

CocoaPods Compatible Platform Twitter

A location converter between WGS84 GCJ-02 and BD-09.

Podfile

To integrate DYLocationConverter into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'DYLocationConverter'

How to use

#import "DYLocationConverter.h"

WGS-84 -> GCJ-02

+ (CLLocationCoordinate2D)gcj02FromWgs84:(CLLocationCoordinate2D)coordinate;
+ (CLLocation *)gcj02LocationFromWgs84:(CLLocation *)location;

GCJ-02 -> WGS-84

+ (CLLocationCoordinate2D)wgs84FromGcj02:(CLLocationCoordinate2D)coordinate;
+ (CLLocation *)wgs84LocationFromGcj02:(CLLocation *)location;

WGS-84 -> BD-09

+ (CLLocationCoordinate2D)bd09FromWgs84:(CLLocationCoordinate2D)coordinate;
+ (CLLocation *)bd09LocationFromWgs84:(CLLocation *)location;

BD-09 -> WGS-84

+ (CLLocationCoordinate2D)wgs84FromBd09:(CLLocationCoordinate2D)coordinate;
+ (CLLocation *)wgs84LocationFromBd09:(CLLocation *)location;

GCJ-02 -> BD-09

+ (CLLocationCoordinate2D)bd09FromGcj02:(CLLocationCoordinate2D)coordinate;
+ (CLLocation *)bd09LocationFromGcj02:(CLLocation *)location;

BD-09 -> GCJ-02

+ (CLLocationCoordinate2D)gcj02FromBd09:(CLLocationCoordinate2D)coordinate;
+ (CLLocation *)gcj02LocationFromBd09:(CLLocation *)location;