You need to install GDAL/Ruby 1.8 bindings.

On Debian/Ubuntu:

sudo apt-get install libgdal-ruby1.8

Example script, to convert from lat/long in WGS84 into UTM coordinates

require 'gdal/osr'
from =
to   =
to.set_utm(32, 1) # UTM band 32, north

transform =, to)

Then, you can do the convertion with

x, y, z = transform.transform_point(longitude, latitude, altitude)
Last modified 10 years ago Last modified on 04/08/11 17:59:19