Geo::GDAL  2.4
Reading a raster dataset

The code here does not have any warranty. It is recommended that before using any of this code, you look into it and try to understand what it does, what input it needs, etc. Do not blindly execute anything!

$file = shift @ARGV;
$dataset = Geo::GDAL::OpenEx($file);
die "can't open $file as a raster dataset" unless $dataset;
($minx, $dx, undef, $maxy, undef, $dy) = $dataset->GeoTransform();
($width, $height) = $dataset->Size;
$band = $dataset->GetRasterBand(1);
$data = $band->ReadTile;
print @$data == $height ? "ok\n" : "not ok\n";
Geo::GDAL::OpenEx
public Geo::GDAL::Dataset OpenEx(hash params)
Geo::GDAL
GDAL utility functions and a root class for raster classes.
Definition: all.pm:15