0
我正在使用库Proj4js来转换坐标。我正在将坐标从EPSG:23029转换为EPSG:4326.问题是,通过转换坐标,与处理负载中使用的精度有些偏差。我注意到了这一点,将坐标系从原点转换到目标点,反之亦然。我用来进行转换的代码是:使用proj4js转换坐标时的精度错误
<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
任何人都知道如何解决这个问题?
谢谢。