I'm using proj4.js to convert geographic coordinates (degrees, minutes and seconds) to UTM coordinates (ETRS89 Zone 30). When I get my coordinates result of the transformation I'm checking them with several web coordinates converters and I never get the same result (I mean really different coordinates) so I don't know if I'm doing something wrong or what.
To make the conversion, I first transform the coordinates from degrees, minutes, seconds to decimal degrees and then make the conversion like this:
var firstProjection = "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs"; this.secondProjection = "+proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs"; var longLat = this.toDecimalsDegrees(); //Array with coordinates in decimal degrees var result = proj4(firstProjection, this.secondProjection, [longLat[0], longLat[1]]); Finally, it is correct the longitude coordinate first and latitude then?
The coordinates I'm using are:
Longitude: 6º 2' 32.929'' Latitude: 37º 21' 41.131''
And once I have converted them to decimal degrees:
Longitude: 6.042480466276646 Latitude: 37.361425499749146
The result of the reprojection that I get with the code mentiones above is:
X: 1301616.242 Y: 4173536.779
Meanwhile in other web conversors the rresult is:
X: 761940.319 Y: 4139140.14