Changes between Version 5 and Version 6 of WikiStart/Ruby/Map


Ignore:
Timestamp:
04/11/11 13:39:54 (9 years ago)
Author:
sylvain.joyeux
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart/Ruby/Map

    v5 v6  
    44 
    55On Debian/Ubuntu: libgdal-ruby1.8 (no 1.9 packages are available yet) 
    6  
    7 In addition, install the gdal-helper gem 
    8  
    9 {{{ 
    10 gem install gdal-helper 
    11 }}} 
    126 
    137= Looking at a map = 
     
    6660 
    6761{{{ 
    68 require 'gdal_helper' 
    69 map = GdalFile.new(path) 
     62require 'envire/gdal' 
     63map = Gdal::Gdal.open(path) 
    7064map.number_of_bands 
    7165map.xsize => width 
     
    7367map.data_type => Ruby datatype corresponding to the band's datatype 
    7468map.read_band(0, 10, 10, 200, 200) => array of values 
    75 map.read_bands(10, 10, 200, 200) => array of array of values 
    7669}}} 
    77  
    78 '''WARN''': in GDAL, bands are 1-based (first band is 1, second 2 and so on). Unfortunately, gdal_helper changes that and uses a 0-base 
    79  
    8070 
    8171Looking at the file's projection