/* ------------------------------------------------ */ /* Convert Lambert grid reference to UTM */ /* */ /* Assumed linear over area of interest, based on: */ /* */ /* NW point (W of Ribadesella) */ /* */ /* Lambert: 4800 9850 */ /* UTM: 324.65 4814.33 */ /* */ /* */ /* SE point (S of Cabezon de la Sal & Ruente): */ /* */ /* Lambert: 5550 9550 */ /* UTM: 399.27 4783.65 */ /* */ /* Hence the formulae: */ /* */ /* X: utmx = 0.09949 * lambx - 152.70 */ /* */ /* Y: utmy = 0.1023 * lamby + 3806.68 */ /* */ /* 23.08.2007 -- initial version by Mike Cowlishaw */ /* ------------------------------------------------ */ say 'Enter Lambert Grid reference as two 4-digit', 'numbers (e.g., 5282 9671):' pull lambx lamby if lambx<1000 | lambx>9999 then do say 'X coordinate not 4 digits!' exit; end if lamby<1000 | lamby>9999 then do say 'Y coordinate not 4 digits!' exit; end utmx = 0.09949 * lambx - 152.70 utmy = 0.1023 * lamby + 3806.68 say 'UTM reference: ' format(utmx,,1) format(utmy,,1)