Index: tools/rdnap.py
===================================================================
--- tools/rdnap.py	(revision 10368)
+++ tools/rdnap.py	(revision 10373)
@@ -1,4 +1,4 @@
 #
-# REMEMBER
+# !!!REMEMBER!!!
 # latitude  : phi
 # longitude : lam
@@ -33,11 +33,13 @@
     pass
 
-def etrs2rd(lam, phi):
-  """ Convert etrs to rd """
+def etrs2rd(phi, lam):
+  """ Convert etrs to rd coordinates
+  @Return: (X,Y)
+  """
   
+  item['phi'] = phi
   item['lam'] = lam
-  item['phi'] = phi
   item['func'] = 'etrs2rd'
-  url = 'http://vanderzwet.net/rdnap/%(func)s/%(xrd)s/%(yrd)s/0/' % item
+  url = 'http://vanderzwet.net/rdnap/%(func)s/%(phi)s/%(lam)s/0/' % item
 
   f = urllib.urlopen(url)
@@ -51,6 +53,7 @@
 def rd2etrs(xrd, yrd, hnap=0.0):
   """ 
-  Convert rd to etrs 
+  Convert rd to etrs
   JavaScript Version: https://rdinfo.kadaster.nl/rd/transformator.html
+  @Return: (latitude,longitude)
   """
   # Get cache is exists
@@ -76,11 +79,10 @@
   item['func'] = 'rd2etrs'
   url = 'http://vanderzwet.net/rdnap/%(func)s/%(xrd)s/%(yrd)s/%(hnap)s/' % item
-  print "### Not in Cache, Fetching coordinate %s, %s from %s" % (xrd, yrd, url) 
+  print "### Not in Cache, Fetching coordinate %s, %s from %s" % (xrd, yrd, url)
   f = urllib.urlopen(url)
   raw = f.read()
-  
-  # Coordinates returned in 'odd' order
+
   phi,lam,h = raw.split('/')
-  coordinates[(xrd, yrd)] = (lam, phi)
+  coordinates[(xrd, yrd)] = (phi, lam)
   write_yaml(CACHE_FILE, coordinates)
-  return (lam, phi)
+  return (phi, lam)
