Skip to content

Transform from WGS84 to VN2000 #4

Answered by bosborn
thothai94 asked this question in Q&A
Discussion options

You must be logged in to vote
let location: CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: 10.785287181209878, longitude: 106.69332489927747)

let wgs84: PROJProjection = PROJProjectionFactory.projection(withName: "EPSG:4326")
let vn2000:PROJProjection = PROJProjectionFactory.projection(withAuthority: PROJ_AUTHORITY_EPSG, andIntCode: 9210, andParams: "+proj=tmerc +lat_0=0 +lon_0=105.75 +k=0.9999 +x_0=500000 +y_0=0 +ellps=WGS84 +towgs84=-191.90441429,-39.30318279,-111.45032835,-0.00928836,0.01975479,-0.00427372,0.252906278 +units=m +no_defs")

let transform: PROJProjectionTransform = wgs84.transformation(with: vn2000)
let transformed: CLLocationCoordinate2D = transform.transform(location)

print("transformed…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@thothai94
Comment options

@bosborn
Comment options

Answer selected by bosborn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants