我正在使用库 Proj4js 来转换坐标。我正在将坐标从 EPSG: 23029 转换为 EPSG: 4326。问题是通过转换坐标与处理负载中使用的精度存在一些偏差。我通过将坐标系从原点转换到目的地来注意到这一点,反之亦然。我用来进行转换的代码是:
<script type="text/javascript" src="/proj4js/lib/proj4js-compressed.js"> </ script>
<script type="text/javascript" src="/proj4js/lib/projCode/merc.js"> </ script>
<script type="text/javascript" src="/projCode/tmerc.js"> </ script>
<script type="text/javascript" src="/proj4js/defs/EPSG23029.js"> </ script>
<script type="text/javascript" src="/proj4js/defs/EPSG4326.js"> </ script>
source = new Proj4js.Proj ('EPSG: 23029');
dest = new Proj4js.Proj (map.projection.toString ());
x = feature_selected.geometry.x;
y = feature_selected.geometry.y;
p = new Proj4js.Point (x, y);
p = Proj4js.transform (source, dest, feature_selected.geometry);
当我在两个方向上进行转换时,原点不一样。
x1= -6.34378379330039
y1= 39.48007480688388
x2= -6.343783791584894
y2= 39.4800748068322604
有谁知道如何解决这个问题?
谢谢。