0

I am trying to use Proj4js, to convert to and from a couple(sweref99tm, rt90, kkj3, wgs84) of coordinates. For some reason I am getting wrong results. Here are my codes which result into wrong results, please check and help me fix it.

Thanks.

Links:

MyCode

Proj4Js Library

Online calculator for verification

rkrara
  • 442
  • 1
  • 6
  • 17
  • looking at your code, you SAY you're trying to convert WGS84(60,20) => SWEREF99tm, the code actually tries to proj4(wgs,swe,[60,18]) ... 18 is not 20 – Jaromanda X Jul 06 '15 at 09:59
  • yes, according to the library documentation the format is proj4(from, to, [lat,lon]), so from wgs84 to sweref99tm. I have done both ways(to and from) but both results are wrong – rkrara Jul 06 '15 at 10:05

1 Answers1

0

I got the answer. The problem was with the order of [lat, lon]. Changing from

proj4(wgs,swe,[60,18])

to

proj4(wgs,swe,[18,60]) 

solved the problem. Thanks.

rkrara
  • 442
  • 1
  • 6
  • 17