Great that you're looking into this, guys.<div><br></div><div>If you can confirm that those parameter conversions need to happen, I'm happy to add them.<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 3:03 PM, Gertjan Idema <span dir="ltr"><<a href="mailto:g.idema@zonnet.nl">g.idema@zonnet.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
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><font color="#888888">
<br>
Gertjan Idema</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
On Wed, 2012-01-11 at 09:51 -0400, jeff fitzgerald wrote:<br>
<blockquote type="CITE">
I believe the problem is due to the fact that in the constructor for BasicCoordinateTransform, doDatumTransform gets set to true when I'm using EPSG:4326 and EPSG:28992. Since I'm already starting with unprojected coordinates, am I correct in thinking that that operation is not necessary?<br>
<br>
When I set the flag in the debugger to false, and BasicCoordinateTransform.datumTransform is not run, I get values I would expect (x = 155000.0000076025 y = 463000.00004944694).<br>
<br>
Fitz<br>
<br>
On Wed, Jan 11, 2012 at 9:41 AM, Gertjan Idema <<a href="mailto:g.idema@zonnet.nl" target="_blank">g.idema@zonnet.nl</a>> wrote:<br>
<blockquote>
I haven't seen this, but then I haven't used proj4j for a while.<br>
The result you give for proj4j is definitely wrong. Any valid EPSG:28992 coordinate has x<y .<br>
<br>
<font color="#888888">Gertjan</font> <br>
<br>
<br>
On Wed, 2012-01-11 at 09:09 -0400, jeff fitzgerald wrote:<br>
<blockquote type="CITE">
Hey Martin,<br>
<br>
There just seems to be a big discrepancy for me between proj and proj4j.<br>
<br>
Using the string with the tows84 method and 5.387638889,52.156160556 as my test point, <br>
- Proj gives me 154976.16420640881,463086.51164757559<br>
- proj4j gives me x = 4761867.817294979 y = 2527483.7229957823<br>
<br>
Does anyone else get similar results?<br>
<br>
Thanks.<br>
<br>
Fitz<br>
<br>
On Tue, Jan 10, 2012 at 1:13 AM, Martin Davis <<a href="mailto:mtnclimb@gmail.com" target="_blank">mtnclimb@gmail.com</a>> wrote:<br>
<blockquote>
Some more information on this issue.<br>
<br>
The addition of the towgs84 parameter happened last August, as a result of this ticket:<br>
<br>
<a href="http://trac.osgeo.org/proj/ticket/96" target="_blank">http://trac.osgeo.org/proj/ticket/96</a><br>
<br>
The SVN version of EPSG:28992 has the +towgs parameter, whereas the version in the PROJ.4 distro archive does not. <br>
<br>
Apparently this change was due to user demand, for what is a apparently a more accurate definition. If you search for "EPSG:28992" you'll find lots of discussion about this. This blog post seems to be authoritative on the subject:<br>
<br>
<a href="http://oegeo.wordpress.com/2008/05/20/note-to-self-the-one-and-only-rd-projection-string/" target="_blank">http://oegeo.wordpress.com/2008/05/20/note-to-self-the-one-and-only-rd-projection-string/</a><br>
<br>
Out of curiousity, what are the issues that you're seeing with this new definition? <br>
<br>
<br>
On Mon, Jan 9, 2012 at 8:16 AM, <<a href="mailto:jeffery.fitzgerald@gmail.com" target="_blank">jeffery.fitzgerald@gmail.com</a>> wrote:<br>
<br>
<blockquote>
Hey,<br>
<br>
I noticed that the epsg file that ships with proj4j has a different entry for ESPG:28992 than I have seen in proj.<br>
<br>
proj4j epsg<br>
# Amersfoort / RD New<br>
<28992> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs <><br>
<br>
gdal epsg<br>
# Amersfoort / RD New<br>
<28992> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs <><br>
<br>
Does anyone know why? It was causing me some trouble until I removed the towgs84.<br>
<br>
<br>
<br>
</blockquote>
<br>
<br>
<br>
_______________________________________________<br>
Proj4j mailing list<br>
<a href="mailto:Proj4j@lists.osgeo.org" target="_blank">Proj4j@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/proj4j" target="_blank">http://lists.osgeo.org/mailman/listinfo/proj4j</a><br>
<br>
</blockquote>
<br>
<pre>_______________________________________________
Proj4j mailing list
<a href="mailto:Proj4j@lists.osgeo.org" target="_blank">Proj4j@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/proj4j" target="_blank">http://lists.osgeo.org/mailman/listinfo/proj4j</a>
</pre>
</blockquote>
<br>
<br>
<br>
_______________________________________________<br>
Proj4j mailing list<br>
<a href="mailto:Proj4j@lists.osgeo.org" target="_blank">Proj4j@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/proj4j" target="_blank">http://lists.osgeo.org/mailman/listinfo/proj4j</a><br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
</div></div></div>
<br>_______________________________________________<br>
Proj4j mailing list<br>
<a href="mailto:Proj4j@lists.osgeo.org">Proj4j@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/proj4j" target="_blank">http://lists.osgeo.org/mailman/listinfo/proj4j</a><br>
<br></blockquote></div><br></div>