Ik vind het feit dat er verkeerde Rd-coordinataten op de NL tileserver erg irritant. Als je het niet goed kunt krijgen, doe het dan niet.

Zelf gebruik ik een perl program (RDgpx.pl) om gpx-tracklogs om te zetten naar RD:


#!/usr/bin/perl -w
# usage: ./RDgpx.pl wgs84file.gpx > RDfile.gpx
use strict;

use Geo::Coordinates::RDNAP qw/to_rd/;
# from http://search.cpan.org/~pijll/Geo-Coordinates-RDNAP-0.11

# in gpx files we are looking for rows like these:
#<bounds minlat="53.22195" minlon="6.50688" maxlat="53.27026" maxlon="6.56861"/>
#<trkpt lat="53.237783333" lon="6.553150000">

my ($x, $y, $x2, $y2);

while (<>) { 
  chomp;
  if (/<trkpt lat="(\d+\.\d+)" lon="(\d+\.\d+)">/) {
        ($y, $x) = to_rd($1, $2);
    print '<trkpt lat="',$x,'" lon="',$y,'">',"\n";
  }
  elsif (/<bounds minlat="(\d+\.\d+)" minlon="(\d+\.\d+)" maxlat="(\d+\.\d+)" maxlon="(\d+\.\d+)"/) {
        ($y, $x) = to_rd($1, $2);
        ($y2, $x2) = to_rd($3, $4);
    print '<bounds minlat="',$x,'" minlon ="',$y,'" maxlat="',$x2,
    '" maxlon="',$y2,'" />',"\n";
  }
  else { print $_,"\n"; }
}