Technicality
· 24TH OF FEBRUARY, THE YEAR 2006USING GDAL IN RUBY
GDAL “is a translator library for raster geospatial data formats,” and Ruby is an “interpreted scripting language for quick and easy object-oriented programming.” You can compile GDAL with the --with-ruby flag to get the GDAL Ruby bindings for incorporating GDAL functionality into your Ruby code, but I didn’t find any documentation on the web describing how you do this. Thanks to some help from gdal-dev, though, I found a whole wealth of examples in the gdalautotest module, which you have to dig out of CVS with something like this
% export CVSROOT=:pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot
% cvs login Password: *enter*
% cvs checkout gdalautotest
So, here’s some example code to get you (or future me) started:
require 'gdal/gdal'
require 'gdal/osr'
file = Gdal::Gdal.open( 'mosaic.tif' )
projection = file.get_projection
puts projection
sr = Gdal::Osr::SpatialReference.new()
sr.import_from_wkt( projection )
puts sr.export_to_proj4

NO COMMENTS YET