[GRASS-user] How to copy raster values into grid

stefano stefano at progettoarchivio.com
Wed May 24 03:15:00 EDT 2006


Hi folks!

I encountered little problems trying to use the Geo::Raster Perl module.
I am trying to create a new grid with the same size and data of an 
existing GRASS raster.

The first problem, is that I cannot open the GRASS raster and I am 
obliged to open the .tif file.
This is the error I get -> /
Can't call method "GetGeoTransform" on an undefined value at 
/usr/local/lib/perl/5.8.8/Geo/Raster.pm line 288.

/After this, I tried to create a new grid with the same sizes of the 
.tif raster opened before, using the command "my $gd = new 
Geo::Raster(like=>$rast_tif);".
Unfortunately, it didn't worked -->/
Use of uninitialized value in subroutine entry at 
/usr/local/lib/perl/5.8.8/Geo/Raster.pm line 266.
gd is not of type ral_gridPtr at /usr/local/lib/perl/5.8.8/Geo/Raster.pm 
line 266./

After opening the .tif file ("my $rast_tif = new 
Geo::Raster("<file_path>");"), I tried to copy its values, to the new 
grid I previously created with "my $gd = new Geo::Raster(<sizes>);", 
using the command "$gd->set($rast_tif);", but I get this error ->/
Can't locate auto/Geo/Raster/ral_gdcopy.al in @INC/.

What can I do to solve these problems?

Thanks in advance,

Stefano




More information about the grass-user mailing list