[Proj] proj and Dutch RD
tvijlbrief
tomtor at xs4all.nl
Wed Oct 18 07:56:22 PDT 2006
>Isn't this part of the spec controlling what the source data is?
>>From Bessel to wgs84? If my source data IS wgs84, why would I do this?
Because RD is defined in Bessel, not in WGS84!
So the conversion code needs to convert from WGS84 to Bessel, and it will
use the inverse of the towgs specification, if it can find it in the toProj
specification...
Your code is ok, just add the +towgs specification to toProj.
Tom
=====================
I program from the C API where the specification of the source and the
specification of the destination are explicitly stated. Perhaps this is
why there is confusion on my part.
My code for RD is:
fromProj = pj_init_plus("+proj=latlong +ellps=WGS84");
toProj = pj_init_plus("+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");
Then I use
lng = LONG * DEGREE_TO_RADIAN;
lat = LAT * DEGREE_TO_RADIAN;
alt = 0; // We do not give this a height
pj_transform(fromProj, toProj, 1, 0, &lng, &lat, &alt);
local_easting = lng;
local_northing = lat;
All with proper error checking.
>
> You can compare the results by trying both:
>
> tom at giant:~$ cs2cs +init=epsg:4326 +to +init=epsg:28992
> 6 53
> 196139.44 557179.10 -41.78
> tom at giant:~$ cs2cs +init=epsg:4326 +to +proj=sterea
> +lat_0=52.15616055555555
> +lon_0=5.38763888888889+k=0.9999079 +x_0=155000 +y_0=463000 +ellps=WGS84
> +units=m +nodefs
> 6 53
> 196114.10 557077.21 0.00
>
> The error is about 25 meters!!
>
> Tom
>
>
--
View this message in context: http://www.nabble.com/proj-and-Dutch-RD-tf895401.html#a6878111
Sent from the PROJ.4 mailing list archive at Nabble.com.
More information about the Proj
mailing list