Geo-Coordinates-RDNAP
view release on metacpan or search on metacpan
lib/Geo/Coordinates/RDNAP.pm view on Meta::CPAN
} while (abs($oldphi-$phi) > 1e-8);
my $h = $r/cos($phi) - $n;
return (_from_rads($phi), _from_rads($lon), $h);
}
sub _transform_datum {
my ($x, $y, $z, $t, $centre) = @_;
return (
$x + $t->{d}*($x-$centre->[0]) + $t->{c}*($y-$centre->[1])
- $t->{b}*($z-$centre->[2]) + $t->{tx},
$y - $t->{c}*($x-$centre->[0]) + $t->{d}*($y-$centre->[1])
+ $t->{a}*($z-$centre->[2]) + $t->{ty},
$z + $t->{b}*($x-$centre->[0]) - $t->{a}*($y-$centre->[1])
+ $t->{d}*($z-$centre->[2]) + $t->{tz}
);
}
1;
__END__
=head1 NAME
Geo::Coordinates::RDNAP - convert to/from Dutch RDNAP coordinate system
=head1 SYNOPSIS
use Geo::Coordinates::RDNAP qw/from_rd to_rd dd dms/;
# RD coordinates and height in meters
my ($lat, $lon, $h) = from_rd( 150_000, 480_000, -2.75 );
printf "%d %d' %.2f\" %d %d' %.2f\"", dms($lat, $lon);
lat/lon coordinates in degrees; height in meters
my ($x, $y, $h) = to_rd( 52.75, 6.80, 10 );
# equivalent: to_rd( deg(52,45,0, 6,48,0), 10 );
=head1 DESCRIPTION
This module converts between two coordinate systems: RD-NAP and ETRS89.
ETRS89 is a geodesic frame of reference used in Europe, which is
approximately equal to the international reference frame WGS84.
GPS data. Coordinates in ETRS89 are given in degrees (latitude and
longitude) and meters (height above the reference ellipsoid).
RD-NAP (or "Amersfoort datum") is a Dutch coordinate system, consisting
of the X and Y coordinates of the Rijksdriehoekmeting, used e.g. in
topographical maps, and a Z coordinate which is the height above Normaal
Amsterdams Peil, the mean sea level at Amsterdam. X, Y, and Z are all
expressed in meters (this is a change compared to the previous versions
of this module!)
These transformations should only be used for locations in or close to
the Netherlands.
See http://www.rdnap.nl/ for a description of the RD-NAP system;
especially http://www.rdnap.nl/download/rdnaptrans.pdf for the formulas
used in this module.
=head2 Precision
This module implements an approximated transformation, which should be
accurate to about 25 cm in X and Y, and about 1 meter in the vertical
direction, for all locations in the Netherlands. The full
transformation, called RDNAPTRANS, is NOT implemented in this module. It
takes into account small deviations, measured at more than 5000 points
in the Netherlands.
Coordinates in ETRS89 deviate from WGS84 and ITRS because the former is
coupled to the Eurasian plate, which drifts a few cm per year compared
to other plates. The current (2006) difference between these coordinate
systems is in the order of 40 cm.
=head2 Disclaimer
Although this module implements conversion to/from the RD-NAP coordinate
system, it is not a product of RDNAP, the cooperation between the
Kadaster and Rijkwaterstaat, which maintains this coordinate system.
RDNAPTRANS is a trademark, presumably by Kadaster and/or
Rijkswaterstaat. This module is not an implementation of RDNAPTRANS. For
the official transformation software, visit http://www.rdnap.nl.
=head1 FUNCTIONS
=over 4
=item from_rd( $x, $y, $h )
Converts coordinates in the RD-NAP coordinate system to geographical
coordinates. The input are the X and Y coordinates in the RD system,
given in meters, and optionally the height above NAP in meters.
This should only be used for points in or close to the Netherlands. For
this area, X should roughly be between 0 and 300_000, and Y between
300_000 and 650_000.
The output is a list of three numbers: latitude and longitude in
degrees, according to the ETRS89 coordinate system, and height above the
ETRS89 reference geoid, in meters.
=item to_rd( $lat, $lon, $h )
Converts geegraphical coordinates to coordinates in the RD-NAP
coordinate system. The input are the latituse and longitude in degrees,
and optionally the height above the ETRS89 reference geoid in meters.
This should only be used for points in or close to the Netherlands.
The output is a list of three numbers: X and Y in the RD system in
meters, and the height above NAP in meters.
=item deg
Helper function to convert degrees/minutes/seconds to decimal degrees.
Works only for positive latitude and longitude.
( run in 0.493 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )