<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On a more general note, this discussion points to the need for more
unit tests in Proj4J! A wider set of unit tests would surely have
caught the issue with the missing conversion of the datum transform
parameters. <br>
<br>
When the dust has settled over this I'll work on adding a unit test
based on this data.<br>
<br>
On 1/11/2012 3:03 PM, Gertjan Idema wrote:
<blockquote cite="mid:1326323013.2873.44.camel@laptop-ubuntu"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="GENERATOR" content="GtkHTML/3.32.2">
Hi Fitz,<br>
<br>
I just wrote a test script and can confirm your result.<br>
Then I remembered that there was a difference between proj
(c-version) and proj4j in handling the +towgs parameters.<br>
The c version has some conversion code for parameters 4-7.<br>
Parameters 4-6 get converted from arc seconds to radians.
(param=param*pi/180/3600)<br>
Parameter 7 gets converted from ppm to scaling factor
(param=1+param/1000000)<br>
<br>
Here's the code from pj_datum_set.c:<br>
/* transform from arc seconds to radians */<br>
projdef->datum_params[3] *= SEC_TO_RAD;<br>
projdef->datum_params[4] *= SEC_TO_RAD;<br>
projdef->datum_params[5] *= SEC_TO_RAD;<br>
/* transform from parts per million to scaling factor */<br>
projdef->datum_params[6] =
(projdef->datum_params[6]/1000000.0) + 1;<br>
<br>
This code seems to be missing in proj4j.<br>
<br>
Apart from that, as far as I know, the +towgs should be
:+towgs84=565.237,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812<br>
Applying the above calculation to the last 4 parameters as a work
around gives:<br>
+towgs84=565.237,50.0087,465.658,-1.972e-6,1.7004e-6,-9.0677e-6,1.0000040812<br>
<br>
When I put this into the nad/epsg file for proj4j I thought I
would get the same results you got from proj, but I didn't.<br>
I get 155029.79163595638 463109.9538034333 for your reference
point instead.<br>
<br>
However, the result seems to agree with some other data I have.
I'll do some more research tomorrow.<br>
<br>
<br>
</blockquote>
</body>
</html>