views:

6

answers:

0

Hello everyone. I am using the library Proj4js to transform coordinates. I'm transforming coordinates from EPSG: 23029 to EPSG: 4326. The problem is that by transforming the coordinates there is some deviation from the precision used in the processing load. I noticed this by transforming a coordinate system from origin to destination and vice versa. The code I use to make the transformation is:

<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);

when I do the transformation in both directions, the point of origin is not the same.

 x1= -6.34378379330039
 y1=  39.48007480688388

 x2= -6.343783791584894
 y2= 39.4800748068322604

Anyone know how to solve this problem?

thanks.