【问题标题】:latitude error when converting ESPG:3857 to ESPG:4326 with proj4js使用 proj4js 将 EPSG:3857 转换为 EPSG:4326 时出现纬度错误
【发布时间】:2013-09-26 11:04:40
【问题描述】:

在使用 Proj4js 将我的 Ruby 坐标转换代码重写为 Node.js 后,我总是在纬度上得到相同的错误 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/ 相同的投影字符串。

任何想法都将不胜感激,谢谢!

【问题讨论】:

    标签: node.js gis proj4js


    【解决方案1】:

    为 secondProjection 试试这个:

    +proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84 +units=degrees
    

    这是 Proj4js.defs["EPSG:4326"] 中的预定义值

    【讨论】:

      猜你喜欢
      • 2021-12-23
      • 2022-01-08
      • 1970-01-01
      • 2016-09-28
      • 2019-06-04
      • 2017-07-12
      • 2014-04-27
      • 2021-11-10
      • 2021-08-28
      相关资源
      最近更新 更多