Changeset 8293 in genesis
- Timestamp:
- Aug 10, 2010, 1:27:13 PM (14 years ago)
- Location:
- nodes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/CNodeRick/wleiden.conf
r8289 r8293 8 8 $status='up'; 9 9 10 11 10 # edugis x,y 12 $X='92 434';13 $Y='461 987';11 $X='92280'; 12 $Y='461707'; 14 13 15 14 $config{'vr0'}=sprintf <<SIS0; -
nodes/make-map.py
r8285 r8293 11 11 import urllib 12 12 import yaml 13 import math 13 14 14 15 def get_yaml(gfile): … … 27 28 coordinates = None 28 29 30 def etrs2rd(lam, phi): 31 """ Convert rd to etrs """ 32 33 item = dict() 34 (remainder, item['lam_deg']) = math.modf(lam) 35 remainder *= 60 36 (remainder, item['lam_min']) = math.modf(remainder) 37 item['lam_sec'] = remainder * 60 38 39 (remainder, item['phi_deg']) = math.modf(phi) 40 remainder *= 60 41 (remainder, item['phi_min']) = math.modf(remainder) 42 item['phi_sec'] = remainder * 60 43 44 item['func'] = 'etrs2rd' 45 46 args = "&".join(["%s=%s" % (k,v) for k,v in item.iteritems()]) 47 url = 'http://www.rdnap.nl/cgi-bin/rdetrs.pl?%s' % args 48 print "### Fetching coordinate %s, %s using: %s" % (phi, lam, url) 49 f = urllib.urlopen(url) 50 raw = f.read() 51 52 r = re.compile('name="([a-z_]+)" value="([0-9\.]+)"') 53 for i in r.finditer(raw): 54 name, value = i.group(1,2) 55 value = float(value) 56 item[name] = value 57 return (item['xrd'], item['yrd']) 58 59 29 60 def rd2etrs(xrd, yrd, hnap=0.0): 30 61 """ Convert rd to etrs """ 31 62 global coordinates 63 xrd = float(str(xrd)) 64 yrd = float(str(yrd)) 32 65 if coordinates == None: 33 66 try: … … 43 76 item['yrd'] = yrd 44 77 item['hnap'] = hnap 45 f = urllib.urlopen('http://www.rdnap.nl/cgi-bin/rdetrs.pl?func=rd2etrs&xrd=%(xrd)s&yrd=%(yrd)s&hnap=%(hnap)s' % item) 78 item['func'] = 'rd2etrs' 79 args = "&".join(["%s=%s" % (k,v) for k,v in item.iteritems()]) 80 url = 'http://www.rdnap.nl/cgi-bin/rdetrs.pl?%s' % args 81 print "### Fetching coordinate %s, %s from %s" % (xrd, yrd, url) 82 f = urllib.urlopen(url) 46 83 raw = f.read() 47 84 … … 54 91 lam = item['lam_deg'] + (item['lam_min'] + (item['lam_sec'] / 60)) / 60 55 92 phi = item['phi_deg'] + (item['phi_min'] + (item['phi_sec'] / 60)) / 60 56 coordinates[(xrd, yrd)] = ( phi, lam)93 coordinates[(xrd, yrd)] = (lam, phi) 57 94 write_yaml(CACHE_FILE, coordinates) 58 95 return (lam, phi)
Note:
See TracChangeset
for help on using the changeset viewer.