在用Proj4js将我的Ruby坐标转换代码重写为Node.js之后,我总是在latitude中得到相同的错误0.17876359947293707:
var proj4 = require('proj4js');
function(pair) {
var firstProjection = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@null +no_defs"
var secondProjection = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
return proj4(firstProjection, secondProjection, pair);
}([4156404,7480076.5])
[ 37.33761240175516, 55.7832340897427 ]Ruby代码给出了37.33761240175515,55.60447049026976,这与上面投影字符串的http://cs2cs.mygeodata.eu/是一样的。
任何想法都将不胜感激,谢谢!
发布于 2014-02-28 09:17:50
在secondProjection上试试这个:
+proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84 +units=degrees这是Proj4js.defs"EPSG:4326“中的预定值。
https://stackoverflow.com/questions/19026505
复制相似问题