[Proj] proj and Dutch RD
Roger Oberholtzer
roger at opq.se
Wed Oct 18 16:21:30 EDT 2006
On Wed, 2006-10-18 at 07:56 -0700, tvijlbrief wrote:
>
>
> >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.
OK. But I thought the fromProj in my code was referring to the source
data only. The ellps=WGS84 there said I have WGS84.
Then, in the toProj part, I thought the ellps=bessel handled the fact
that RD is Bessel. Stating Bessel as a property of the source data seems
odd. Stating it as a property of the desired calculated data makes
sense. To me.
I will of course try your suggestion and see what I get.
>
> 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
> >
> >
>
More information about the Proj
mailing list